[Pixman] [PATCH] Add pixman_image_get_format() accessor

Søren Sandmann sandmann at daimi.au.dk
Wed Apr 21 07:00:43 PDT 2010


From: Søren Sandmann Pedersen <ssp at redhat.com>

---
 pixman/pixman-image.c |    9 +++++++++
 pixman/pixman.h       |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index 9b44aa9..9604bfe 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -739,6 +739,15 @@ pixman_image_get_depth (pixman_image_t *image)
     return 0;
 }
 
+PIXMAN_EXPORT pixman_format_code_t
+pixman_image_get_format (pixman_image_t *image)
+{
+    if (image->type == BITS)
+	return image->bits.format;
+
+    return 0;
+}
+
 uint32_t
 _pixman_image_get_solid (pixman_image_t *     image,
                          pixman_format_code_t format)
diff --git a/pixman/pixman.h b/pixman/pixman.h
index 964d04a..7b95fed 100644
--- a/pixman/pixman.h
+++ b/pixman/pixman.h
@@ -778,6 +778,7 @@ int		pixman_image_get_width               (pixman_image_t               *image);
 int             pixman_image_get_height              (pixman_image_t               *image);
 int		pixman_image_get_stride              (pixman_image_t               *image); /* in bytes */
 int		pixman_image_get_depth               (pixman_image_t		   *image);
+pixman_format_code_t pixman_image_get_format	     (pixman_image_t		   *image);
 pixman_bool_t	pixman_image_fill_rectangles	     (pixman_op_t		    op,
 						      pixman_image_t		   *image,
 						      pixman_color_t		   *color,
-- 
1.7.0.1



More information about the Pixman mailing list