Add API to have accessor functions on pixman
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Wed, 16 May 2007 14:56:08 +0000 (10:56 -0400)
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>
Wed, 16 May 2007 14:56:08 +0000 (10:56 -0400)
pixman/pixman-image.c
pixman/pixman-private.h
pixman/pixman.h

index 2ae0655..f790538 100644 (file)
@@ -91,6 +91,8 @@ allocate_image (void)
        common->alpha_map = NULL;
        common->component_alpha = FALSE;
        common->ref_count = 1;
+       common->read_func = NULL;
+       common->write_func = NULL;
     }
 
     return image;
@@ -394,6 +396,17 @@ pixman_image_set_component_alpha   (pixman_image_t       *image,
 #define SCANLINE_BUFFER_LENGTH 2048
 
 void
+pixman_image_set_accessors (pixman_image_t             *image,
+                           pixman_read_memory_func_t   read_func,
+                           pixman_write_memory_func_t  write_func)
+{
+    return_if_fail (image != NULL);
+
+    image->common.read_func = read_func;
+    image->common.write_func = write_func;
+}
+
+void
 pixman_image_composite_rect (pixman_op_t        op,
                             pixman_image_t     *src_img,
                             pixman_image_t     *mask_img,
index 5cdd2a6..dd1488c 100644 (file)
@@ -113,17 +113,19 @@ struct point
 
 struct image_common
 {
-    image_type_t       type;
-    int32_t            ref_count;
-    pixman_region16_t   clip_region;
-    pixman_transform_t *transform;
-    pixman_repeat_t    repeat;
-    pixman_filter_t    filter;
-    pixman_fixed_t     *filter_params;
-    int                        n_filter_params;
-    bits_image_t       *alpha_map;
-    point_t            alpha_origin;
-    pixman_bool_t      component_alpha;
+    image_type_t               type;
+    int32_t                    ref_count;
+    pixman_region16_t          clip_region;
+    pixman_transform_t        *transform;
+    pixman_repeat_t            repeat;
+    pixman_filter_t            filter;
+    pixman_fixed_t            *filter_params;
+    int                                n_filter_params;
+    bits_image_t              *alpha_map;
+    point_t                    alpha_origin;
+    pixman_bool_t              component_alpha;
+    pixman_read_memory_func_t  read_func;
+    pixman_write_memory_func_t write_func;
 };
 
 struct source_image
index ccbd31c..4684429 100644 (file)
@@ -296,6 +296,9 @@ typedef  union pixman_image         pixman_image_t;
 typedef struct pixman_indexed          pixman_indexed_t;
 typedef struct pixman_gradient_stop    pixman_gradient_stop_t;
 
+typedef uint32_t (* pixman_read_memory_func_t) (const void *src, int size);
+typedef void     (* pixman_write_memory_func_t) (void *dst, uint32_t value, int size);
+
 struct pixman_gradient_stop {
     pixman_fixed_t x;
     pixman_color_t color;
@@ -446,7 +449,9 @@ void            pixman_image_set_alpha_map           (pixman_image_t
                                                      int16_t                       y);
 void            pixman_image_set_component_alpha     (pixman_image_t               *image,
                                                      pixman_bool_t                 component_alpha);
-
+void           pixman_image_set_accessors           (pixman_image_t               *image,
+                                                     pixman_read_memory_func_t     read_func,
+                                                     pixman_write_memory_func_t    write_func);
 
 /* Composite */
 void            pixman_image_composite_rect          (pixman_op_t                   op,
@@ -462,10 +467,4 @@ void            pixman_image_composite_rect          (pixman_op_t
                                                      int                           width,
                                                      int                           height);
 
-
-
-
-
-
-
 #endif /* PIXMAN_H__ */