diff options
author | Benjamin Otte <otte@gnome.org> | 2009-12-14 15:48:47 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-04-07 10:38:42 +0200 |
commit | dec875bad712cd0f39cce903ce8cd4939e0417f8 (patch) | |
tree | 8d28362a848d38167ec57c3f6576b69e1c1f2127 /pixman/pixman.h | |
parent | b60d75cbd4ae9ac60f88617cf290b70bcf514298 (diff) |
Add pixman_color_space_t
This differentiates pixel data from just having a format code to having
a pixel layout - pixman_format_code_t - and color space -
pixman_color_space_t.
No new formats were added, only the option to create unmultiplied ARGB
images exists now.
In the future the general code path will look like this:
Each colorspace provides a "canonical" format. pixman-access.c will
provide accessors to read/write data from/to the image representation to
the canonical format. Additional functions that convert between
different color spaces will be added. These will be called from the
generic store/fetch paths, so the accessors do not need to care about
the color space.
As a first step, compositing will still be done in ARGB, so the general
path will look like this:
src => fetch => convert \
> combine => convert => store => dest
dest => fetch => convert /
Benefits of this approach for adding more formats:
- Minimal changes required to current code.
With a simple check of the color space, all optimizations can continue
working with a minimal performance impact. Even in the general case
optimized store/fetch functions can be used.
- Ease of optimization for common paths
Common cases can be optimized easily. For example, Pixel-aligned
rectangular fills with PIXMAN_OP_SRC and the same color space can
be done with:
src => fetch => store => dest
and not a lot of code is required to do this.
- Extensibility
More color spaces can easily be added later, possibly even making use
of the same accessors for data storage, i.e. linear RGB, more color
matrices for YCbCr or even CMYK.
Diffstat (limited to 'pixman/pixman.h')
-rw-r--r-- | pixman/pixman.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pixman/pixman.h b/pixman/pixman.h index 89ce899..f483163 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -709,6 +709,14 @@ typedef enum { PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0) } pixman_format_code_t; +typedef enum { + PIXMAN_COLOR_SPACE_ARGB, + PIXMAN_COLOR_SPACE_ARGB_UNMULTIPLIED, + PIXMAN_COLOR_SPACE_YCBCR_HD, + PIXMAN_COLOR_SPACE_YCBCR_SD, + PIXMAN_COLOR_SPACE_YCBCR_JPEG +} pixman_color_space_t; + /* Querying supported format values. */ pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format); pixman_bool_t pixman_format_supported_source (pixman_format_code_t format); @@ -736,6 +744,7 @@ pixman_image_t *pixman_image_create_bits (pixman_format_code_t uint32_t *bits, int rowstride_bytes); pixman_image_t *pixman_image_create_planar (pixman_format_code_t format, + pixman_color_space_t color_space, int width, int height, unsigned int num_planes, |