diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-13 10:00:18 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-05-13 10:00:18 +0100 |
commit | 18b48a6ebc044c07f08bafd0abcb68c595c5746c (patch) | |
tree | ba5da724ef2006aaa6fabf75271e4b1122ea4ba9 /src/cairo-types-private.h | |
parent | dfa2544f158930b002df74e676f3ef7aeeee1bd4 (diff) | |
download | cairo-18b48a6ebc044c07f08bafd0abcb68c595c5746c.tar.gz |
Make cairo_color_stop_t a unique type.
Hopefully reduce the occurrence of the confusion between the
premultiplied shorts in cairo_color_t and the non-premultiplied shorts
in cairo_color_stop_t.
The existence of the two separate types is debatable and open for
review.
Diffstat (limited to 'src/cairo-types-private.h')
-rw-r--r-- | src/cairo-types-private.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/cairo-types-private.h b/src/cairo-types-private.h index 6657de845..fa65677e7 100644 --- a/src/cairo-types-private.h +++ b/src/cairo-types-private.h @@ -52,6 +52,7 @@ typedef struct _cairo_composite_rectangles cairo_composite_rectangles_t; typedef struct _cairo_clip cairo_clip_t; typedef struct _cairo_clip_path cairo_clip_path_t; typedef struct _cairo_color cairo_color_t; +typedef struct _cairo_color_stop cairo_color_stop_t; typedef struct _cairo_device_backend cairo_device_backend_t; typedef struct _cairo_font_face_backend cairo_font_face_backend_t; typedef struct _cairo_gstate cairo_gstate_t; @@ -147,6 +148,20 @@ struct _cairo_color { unsigned short alpha_short; }; +struct _cairo_color_stop { + /* unpremultiplied */ + double red; + double green; + double blue; + double alpha; + + /* unpremultipled, for convenience */ + uint16_t red_short; + uint16_t green_short; + uint16_t blue_short; + uint16_t alpha_short; +}; + typedef enum _cairo_paginated_mode { CAIRO_PAGINATED_MODE_ANALYZE, /* analyze page regions */ CAIRO_PAGINATED_MODE_RENDER, /* render page contents */ @@ -352,7 +367,7 @@ typedef struct _cairo_surface_pattern { typedef struct _cairo_gradient_stop { double offset; - cairo_color_t color; + cairo_color_stop_t color; } cairo_gradient_stop_t; typedef struct _cairo_gradient_pattern { |