From: Steinar H. Gunderson Date: Sat, 13 Oct 2012 22:54:07 +0000 (+0200) Subject: Support conversion to and from the XYZ color space. X-Git-Tag: 1.0~254 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=0490917aca6b8e6057c04c8becc820a8e849a801;hp=c9a573370a976df3675d4bd3195a49c854ab7db9 Support conversion to and from the XYZ color space. --- diff --git a/colorspace_conversion_effect.cpp b/colorspace_conversion_effect.cpp index 9726b3b..2f74a27 100644 --- a/colorspace_conversion_effect.cpp +++ b/colorspace_conversion_effect.cpp @@ -25,6 +25,13 @@ ColorSpaceConversionEffect::ColorSpaceConversionEffect() void get_xyz_matrix(ColorSpace space, Matrix3x3 m) { + if (space == COLORSPACE_XYZ) { + m[0] = 1.0f; m[3] = 0.0f; m[6] = 0.0f; + m[1] = 0.0f; m[4] = 1.0f; m[7] = 0.0f; + m[2] = 0.0f; m[5] = 0.0f; m[8] = 1.0f; + return; + } + double x_R, x_G, x_B; double y_R, y_G, y_B; double Y_R, Y_G, Y_B; diff --git a/image_format.h b/image_format.h index 55aa8d4..f84a0f4 100644 --- a/image_format.h +++ b/image_format.h @@ -9,6 +9,7 @@ enum ColorSpace { COLORSPACE_REC_709 = 0, // Same as sRGB. COLORSPACE_REC_601_525 = 1, COLORSPACE_REC_601_625 = 2, + COLORSPACE_XYZ = 3, // Mostly useful for testing and debugging. }; enum GammaCurve {