Add new function pixman_image_set_indexed()
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Fri, 18 May 2007 15:54:01 +0000 (11:54 -0400)
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Fri, 18 May 2007 15:54:01 +0000 (11:54 -0400)
pixman/pixman-image.c
pixman/pixman.h

index f790538..ac0088e 100644 (file)
@@ -361,6 +361,26 @@ pixman_image_set_filter (pixman_image_t       *image,
 }
 
 void
+pixman_image_set_indexed (pixman_image_t        *image,
+                         const pixman_indexed_t *indexed)
+{
+    bits_image_t *bits = (bits_image_t *)image;
+
+    if (bits->indexed == indexed)
+       return;
+
+    if (bits->indexed)
+       free (bits->indexed);
+    
+    bits->indexed = malloc (sizeof (pixman_indexed_t));
+
+    if (!bits->indexed)
+       return;
+
+    memcpy (bits->indexed, indexed, sizeof (pixman_indexed_t));
+}
+
+void
 pixman_image_set_alpha_map (pixman_image_t *image,
                            pixman_image_t *alpha_map,
                            int16_t         x,
index 4684429..bb5739a 100644 (file)
@@ -452,6 +452,8 @@ void            pixman_image_set_component_alpha     (pixman_image_t
 void           pixman_image_set_accessors           (pixman_image_t               *image,
                                                      pixman_read_memory_func_t     read_func,
                                                      pixman_write_memory_func_t    write_func);
+void           pixman_image_set_indexed             (pixman_image_t               *image,
+                                                     const pixman_indexed_t       *indexed);
 
 /* Composite */
 void            pixman_image_composite_rect          (pixman_op_t                   op,