From 28ca40f6d5091179623ea9336f85f97a69bf8dd3 Mon Sep 17 00:00:00 2001 From: Charlie Brej Date: Sun, 18 Apr 2010 15:47:00 +0100 Subject: [PATCH] [pixel-buffer] Add get width and height functions These were accessible by the get_size function, but individual functions are more convenient. --- src/libply-splash-core/ply-pixel-buffer.c | 14 ++++++++++++++ src/libply-splash-core/ply-pixel-buffer.h | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/src/libply-splash-core/ply-pixel-buffer.c b/src/libply-splash-core/ply-pixel-buffer.c index 57650784..79ff9161 100644 --- a/src/libply-splash-core/ply-pixel-buffer.c +++ b/src/libply-splash-core/ply-pixel-buffer.c @@ -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) { diff --git a/src/libply-splash-core/ply-pixel-buffer.h b/src/libply-splash-core/ply-pixel-buffer.h index 9a0a216b..18ac0946 100644 --- a/src/libply-splash-core/ply-pixel-buffer.h +++ b/src/libply-splash-core/ply-pixel-buffer.h @@ -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,