diff options
author | Benjamin Otte <otte@gnome.org> | 2009-12-11 13:49:50 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-04-07 10:38:42 +0200 |
commit | c07cb56e1088a138cd5289fc5a8fb38fa3bbf172 (patch) | |
tree | 2e23d25a33a6336098156b09e134915e54e71e9c | |
parent | 718f6612df71b3630b6ab5223ac7ae3b169e6160 (diff) |
Add pixman_format_num_planes()
-rw-r--r-- | pixman/pixman-format.c | 15 | ||||
-rw-r--r-- | pixman/pixman.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/pixman/pixman-format.c b/pixman/pixman-format.c index 6706476..f3b8ce3 100644 --- a/pixman/pixman-format.c +++ b/pixman/pixman-format.c @@ -33,7 +33,7 @@ typedef struct { pixman_format_code_t format; pixman_bool_t supported_source; pixman_bool_t supported_destination; - unsigned int n_planes; + unsigned int num_planes; } format_info_t; static const format_info_t format_infos[] = { @@ -144,3 +144,16 @@ pixman_format_supported_destination (pixman_format_code_t format) return _get_format_info (format)->supported_destination; } +/** + * pixman_format_num_planes: + * @format: A pixman_format_code_t format + * + * Returns value: the number of planes for the given format. If + * this number is different from 1, you must use + * pixman_image_create_planar() to create images in this format. + **/ +PIXMAN_EXPORT unsigned int +pixman_format_num_planes (pixman_format_code_t format) +{ + return _get_format_info (format)->num_planes; +} diff --git a/pixman/pixman.h b/pixman/pixman.h index 85fcc8c..830fe7a 100644 --- a/pixman/pixman.h +++ b/pixman/pixman.h @@ -712,6 +712,7 @@ typedef enum { /* 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); +unsigned int pixman_format_num_planes (pixman_format_code_t format); /* Constructors */ pixman_image_t *pixman_image_create_solid_fill (pixman_color_t *color); |