summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-02-17 12:35:14 +0100
committerBenjamin Otte <otte@redhat.com>2010-04-23 23:30:09 +0200
commitafb26f759a0dc6ea5ba5973297ef7acce4387be6 (patch)
treec2f3fc75dd4567b26e9d064c391a93a4a2ea013b
parent14abc50fd6f9b9b282e3f9ae604a492d545957f4 (diff)
API: Add YUV color spaces
-rw-r--r--src/cairo-image-surface.c9
-rw-r--r--src/cairo.h11
-rw-r--r--src/cairoint.h2
3 files changed, 20 insertions, 2 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 817b04d3..473777f5 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -299,6 +299,15 @@ _cairo_color_space_to_pixman_color_space (cairo_color_space_t color_space)
case CAIRO_COLOR_SPACE_ARGB_UNMULTIPLIED:
ret = PIXMAN_COLOR_SPACE_ARGB_UNMULTIPLIED;
break;
+ case CAIRO_COLOR_SPACE_YCBCR_SD:
+ ret = PIXMAN_COLOR_SPACE_YCBCR_SD;
+ break;
+ case CAIRO_COLOR_SPACE_YCBCR_HD:
+ ret = PIXMAN_COLOR_SPACE_YCBCR_HD;
+ break;
+ case CAIRO_COLOR_SPACE_YCBCR_JPEG:
+ ret = PIXMAN_COLOR_SPACE_YCBCR_JPEG;
+ break;
case CAIRO_COLOR_SPACE_ARGB:
default:
ret = PIXMAN_COLOR_SPACE_ARGB;
diff --git a/src/cairo.h b/src/cairo.h
index 350ccc47..8448bded 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -2288,6 +2288,12 @@ typedef enum _cairo_format {
* greater than the alpha value is undefined.
* @CAIRO_COLOR_SPACE_ARGB_UNMULTIPLIED: RGB data. The RGB values
* are not premultiplied with the alpha value.
+ * @CAIRO_COLOR_SPACE_YCBCR_SD: Standard definition YCbCr data as
+ * defined by ITU-R BT.601
+ * @CAIRO_COLOR_SPACE_YCBCR_HD: ITU-R BT.709 YCbCr data, also known as
+ * HDTV.
+ * @CAIRO_COLOR_SPACE_YCBCR_JPEG: YCbCr data as defined by the JPEG
+ * standard.
*
* #cairo_color_space_t is used to interpret the color values
* of image data.
@@ -2296,7 +2302,10 @@ typedef enum _cairo_format {
**/
typedef enum _cairo_color_space {
CAIRO_COLOR_SPACE_ARGB,
- CAIRO_COLOR_SPACE_ARGB_UNMULTIPLIED
+ CAIRO_COLOR_SPACE_ARGB_UNMULTIPLIED,
+ CAIRO_COLOR_SPACE_YCBCR_SD,
+ CAIRO_COLOR_SPACE_YCBCR_HD,
+ CAIRO_COLOR_SPACE_YCBCR_JPEG,
} cairo_color_space_t;
cairo_public cairo_surface_t *
diff --git a/src/cairoint.h b/src/cairoint.h
index b8408743..2d37ac50 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -2150,7 +2150,7 @@ _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure;
(format) <= CAIRO_FORMAT_RGB16_565)
#define CAIRO_FORMAT_MAX_PLANES 4
-#define CAIRO_COLOR_SPACE_VALID(colorspace) ((colorspace) <= CAIRO_COLOR_SPACE_ARGB_UNMULTIPLIED)
+#define CAIRO_COLOR_SPACE_VALID(colorspace) ((colorspace) <= CAIRO_COLOR_SPACE_YCBCR_JPEG)
/* pixman-required stride alignment in bytes. */
#define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))