diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-06-08 15:04:13 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-08-30 10:59:17 +0200 |
commit | 903366f8699d730345e560dcaf854da69150a8d9 (patch) | |
tree | 5ef957e94efbc8a78e000e46960c9809cbf4f6cc /lib/igt_color_encoding.c | |
parent | 7beba5bd2f6a01127bccfe4158555a9874ab2860 (diff) |
lib/kms: Remove special enum handling and replace with call to igt_plane_set_prop_enum, v2.
We now have infrastructure for generic enum handling. This will make it easier
to write new tests without defining all enum constants beforehand.
Changes since v1:
- Fix compile error, sent old version by accident.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Diffstat (limited to 'lib/igt_color_encoding.c')
-rw-r--r-- | lib/igt_color_encoding.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/igt_color_encoding.c b/lib/igt_color_encoding.c index f445dbbc..03e16e0c 100644 --- a/lib/igt_color_encoding.c +++ b/lib/igt_color_encoding.c @@ -23,6 +23,7 @@ #include "igt_color_encoding.h" #include "igt_matrix.h" +#include "igt_core.h" struct color_encoding { float kr, kb; @@ -141,3 +142,22 @@ struct igt_mat4 igt_rgb_to_ycbcr_matrix(enum igt_color_encoding color_encoding, return igt_matrix_multiply(&r, &c); } + +const char *igt_color_encoding_to_str(enum igt_color_encoding encoding) +{ + switch (encoding) { + case IGT_COLOR_YCBCR_BT601: return "ITU-R BT.601 YCbCr"; + case IGT_COLOR_YCBCR_BT709: return "ITU-R BT.709 YCbCr"; + case IGT_COLOR_YCBCR_BT2020: return "ITU-R BT.2020 YCbCr"; + default: igt_assert(0); return NULL; + } +} + +const char *igt_color_range_to_str(enum igt_color_range range) +{ + switch (range) { + case IGT_COLOR_YCBCR_LIMITED_RANGE: return "YCbCr limited range"; + case IGT_COLOR_YCBCR_FULL_RANGE: return "YCbCr full range"; + default: igt_assert(0); return NULL; + } +} |