diff options
author | Benjamin Otte <otte@redhat.com> | 2010-03-05 14:52:27 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-04-23 23:30:29 +0200 |
commit | f7cb33fd52eeb2a696e07f306d315ab2699aee66 (patch) | |
tree | 23133e2d20ae423bb038e04e76a399d4e7034d68 | |
parent | 7bfcb0ebbc3ee1911cb2c4379ef365f9e47d597f (diff) |
Add CAIRO_FORMAT_PLANAR_422
-rw-r--r-- | src/cairo-image-surface.c | 7 | ||||
-rw-r--r-- | src/cairo-xlib-display.c | 1 | ||||
-rw-r--r-- | src/cairo.h | 7 | ||||
-rw-r--r-- | src/cairoint.h | 2 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 105d0ae7..2040a394 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -96,6 +96,8 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format) return CAIRO_FORMAT_BGRA32; case PIXMAN_y444: return CAIRO_FORMAT_PLANAR_444; + case PIXMAN_y422: + return CAIRO_FORMAT_PLANAR_422; case PIXMAN_yuy2: return CAIRO_FORMAT_PACKED_YUYV; case PIXMAN_yvyu: @@ -294,6 +296,9 @@ _cairo_format_to_pixman_format_code (cairo_format_t format) case CAIRO_FORMAT_PLANAR_444: ret = PIXMAN_y444; break; + case CAIRO_FORMAT_PLANAR_422: + ret = PIXMAN_y422; + break; case CAIRO_FORMAT_PACKED_YUYV: ret = PIXMAN_yuy2; break; @@ -821,6 +826,7 @@ _cairo_content_from_format (cairo_format_t format) case CAIRO_FORMAT_RGB24: case CAIRO_FORMAT_RGB16_565: case CAIRO_FORMAT_PLANAR_444: + case CAIRO_FORMAT_PLANAR_422: case CAIRO_FORMAT_PACKED_YUYV: case CAIRO_FORMAT_PACKED_YVYU: case CAIRO_FORMAT_PACKED_UYVY: @@ -855,6 +861,7 @@ _cairo_format_bits_per_pixel (cairo_format_t format) return 16; case CAIRO_FORMAT_A8: case CAIRO_FORMAT_PLANAR_444: + case CAIRO_FORMAT_PLANAR_422: return 8; case CAIRO_FORMAT_A1: return 1; diff --git a/src/cairo-xlib-display.c b/src/cairo-xlib-display.c index 5470558b..6bacf402 100644 --- a/src/cairo-xlib-display.c +++ b/src/cairo-xlib-display.c @@ -599,6 +599,7 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t *display, case CAIRO_FORMAT_ABGR32: case CAIRO_FORMAT_BGRA32: case CAIRO_FORMAT_PLANAR_444: + case CAIRO_FORMAT_PLANAR_422: case CAIRO_FORMAT_PACKED_YUYV: case CAIRO_FORMAT_PACKED_YVYU: case CAIRO_FORMAT_PACKED_UYVY: diff --git a/src/cairo.h b/src/cairo.h index e1bb7f1a..70302a7e 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -2282,6 +2282,10 @@ cairo_surface_has_show_text_glyphs (cairo_surface_t *surface); * @CAIRO_FORMAT_PLANAR_444: A planar format with 3 planes. The * red, green and blue values are stored in their own plane * each. + * @CAIRO_FORMAT_PLANAR_422: A subsampled planar format with 3 + * planes. The red plane contains all values, the green and + * blue planes are subsampled in the horizontal direction and + * each pixel covers 2 red pixels. * * #cairo_format_t is used to identify the memory format of * image data. @@ -2311,7 +2315,8 @@ typedef enum _cairo_format { CAIRO_FORMAT_PACKED_YUYV = 9, CAIRO_FORMAT_PACKED_YVYU = 10, CAIRO_FORMAT_PACKED_UYVY = 11, - CAIRO_FORMAT_PACKED_VYUY = 12 + CAIRO_FORMAT_PACKED_VYUY = 12, + CAIRO_FORMAT_PLANAR_422 = 13 } cairo_format_t; /** diff --git a/src/cairoint.h b/src/cairoint.h index 3a4d86aa..a9f9422d 100644 --- a/src/cairoint.h +++ b/src/cairoint.h @@ -2117,7 +2117,7 @@ _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure; /* cairo-image-surface.c */ #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ - (format) <= CAIRO_FORMAT_PACKED_VYUY) + (format) <= CAIRO_FORMAT_PLANAR_422) #define CAIRO_FORMAT_MAX_PLANES 4 #define CAIRO_COLOR_SPACE_VALID(colorspace) ((colorspace) <= CAIRO_COLOR_SPACE_YCBCR_JPEG) |