diff options
-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); |