X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=image_format.h;h=1bd19f953e6ddc27102baf601229a44eb8b33cbd;hp=3766235db670f3437d427d52e851597e2190c424;hb=f216b7bef5a968c89f6fc78e83cc26a91e504a8a;hpb=ac4fc36aa70ffefb6b9632dc0abea5cbbce5387b diff --git a/image_format.h b/image_format.h index 3766235..1bd19f9 100644 --- a/image_format.h +++ b/image_format.h @@ -1,6 +1,18 @@ #ifndef _MOVIT_IMAGE_FORMAT_H #define _MOVIT_IMAGE_FORMAT_H 1 +// Note: Movit's internal processing formats do not have enough +// accuracy to support 12-bit input, so if you want to use Rec. 2020, +// you should probably stick to 10-bit, or accept somewhat reduced +// accuracy for 12-bit. Input depths above 8 bits are also generally +// less tested. +// +// We also only support “conventional non-constant luminance” for Rec. 2020, +// where Y' is derived from R'G'B' instead of RGB, since this is the same +// system as used in Rec. 601 and 709. + +namespace movit { + enum MovitPixelFormat { FORMAT_RGB, FORMAT_RGBA_PREMULTIPLIED_ALPHA, @@ -8,7 +20,9 @@ enum MovitPixelFormat { FORMAT_BGR, FORMAT_BGRA_PREMULTIPLIED_ALPHA, FORMAT_BGRA_POSTMULTIPLIED_ALPHA, - FORMAT_GRAYSCALE + FORMAT_GRAYSCALE, + FORMAT_RG, + FORMAT_R }; enum Colorspace { @@ -18,6 +32,7 @@ enum Colorspace { COLORSPACE_REC_601_525 = 1, COLORSPACE_REC_601_625 = 2, COLORSPACE_XYZ = 3, // Mostly useful for testing and debugging. + COLORSPACE_REC_2020 = 4, }; enum GammaCurve { @@ -26,11 +41,14 @@ enum GammaCurve { GAMMA_sRGB = 1, GAMMA_REC_601 = 2, GAMMA_REC_709 = 2, // Same as Rec. 601. + GAMMA_REC_2020_10_BIT = 2, // Same as Rec. 601. + GAMMA_REC_2020_12_BIT = 3, }; enum YCbCrLumaCoefficients { YCBCR_REC_601 = 0, YCBCR_REC_709 = 1, + YCBCR_REC_2020 = 2, }; struct ImageFormat { @@ -38,4 +56,6 @@ struct ImageFormat { GammaCurve gamma_curve; }; +} // namespace movit + #endif // !defined(_MOVIT_IMAGE_FORMAT_H)