Add pixman_image_get_format() accessor
authorSøren Sandmann Pedersen <ssp@redhat.com>
Wed, 21 Apr 2010 13:59:29 +0000 (09:59 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Wed, 21 Apr 2010 13:59:29 +0000 (09:59 -0400)
pixman/pixman-image.c
pixman/pixman.h

index 9b44aa9..9604bfe 100644 (file)
@@ -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)
index 964d04a..7b95fed 100644 (file)
@@ -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,