]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[pixel-buffer] Add get width and height functions
authorCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 18 Apr 2010 14:47:00 +0000 (15:47 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 18 Apr 2010 14:47:00 +0000 (15:47 +0100)
These were accessible by the get_size function, but individual functions are
more convenient.

src/libply-splash-core/ply-pixel-buffer.c
src/libply-splash-core/ply-pixel-buffer.h

index 57650784740c90b416f48f1d9322c46635b9e4a7..79ff91612cd805c0c0c6db417d1a146f798f74c2 100644 (file)
@@ -287,6 +287,20 @@ ply_pixel_buffer_get_size (ply_pixel_buffer_t *buffer,
   *size = buffer->area;
 }
 
+unsigned long 
+ply_pixel_buffer_get_width (ply_pixel_buffer_t *buffer)
+{
+  assert (buffer != NULL);
+  return buffer->area.width;
+}
+
+unsigned long 
+ply_pixel_buffer_get_height (ply_pixel_buffer_t *buffer)
+{
+  assert (buffer != NULL);
+  return buffer->area.height;
+}
+
 ply_region_t *
 ply_pixel_buffer_get_updated_areas (ply_pixel_buffer_t *buffer)
 {
index 9a0a216b8afc1020db99d96c32263bcb40dcf2fe..18ac0946620e8a98c4175c8cfae37f657fe171e9 100644 (file)
@@ -43,6 +43,10 @@ ply_pixel_buffer_t *ply_pixel_buffer_new (unsigned long width,
 void ply_pixel_buffer_free (ply_pixel_buffer_t *buffer);
 void ply_pixel_buffer_get_size (ply_pixel_buffer_t *buffer,
                                 ply_rectangle_t    *size);
+
+unsigned long ply_pixel_buffer_get_width (ply_pixel_buffer_t *buffer);
+unsigned long ply_pixel_buffer_get_height (ply_pixel_buffer_t *buffer);
+
 ply_region_t *ply_pixel_buffer_get_updated_areas (ply_pixel_buffer_t *buffer);
 
 void ply_pixel_buffer_fill_with_color (ply_pixel_buffer_t *buffer,