X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=colorspace_conversion_effect.cpp;h=ca1661b7868b95c7a7765fe8712f164dade2db9e;hp=1ac5465ebd97935a00700fb99c5c481b4fdce09c;hb=57acdb174fffed295ee2255146b03d9efbec1b5f;hpb=ece88bd25d49a3c16c79f39063ccd574fbef060f diff --git a/colorspace_conversion_effect.cpp b/colorspace_conversion_effect.cpp index 1ac5465..ca1661b 100644 --- a/colorspace_conversion_effect.cpp +++ b/colorspace_conversion_effect.cpp @@ -16,7 +16,7 @@ double rec601_625_y_R = 0.330, rec601_625_y_G = 0.600, rec601_625_y_B = 0.060; // The D65 white point. Given in both Rec. 601 and 709. double d65_x = 0.3127, d65_y = 0.3290; -ColorSpaceConversionEffect::ColorSpaceConversionEffect() +ColorspaceConversionEffect::ColorspaceConversionEffect() : source_space(COLORSPACE_sRGB), destination_space(COLORSPACE_sRGB) { @@ -24,7 +24,7 @@ ColorSpaceConversionEffect::ColorSpaceConversionEffect() register_int("destination_space", (int *)&destination_space); } -void get_xyz_matrix(ColorSpace space, Matrix3x3 m) +void get_xyz_matrix(Colorspace space, Matrix3x3 m) { if (space == COLORSPACE_XYZ) { m[0] = 1.0f; m[3] = 0.0f; m[6] = 0.0f; @@ -73,7 +73,7 @@ void get_xyz_matrix(ColorSpace space, Matrix3x3 m) // Some algebraic fiddling yields (unsurprisingly): // // X_R = (x_R / y_R) Y_R - // Z_R = (z_R / y_R) Z_R + // Z_R = (z_R / y_R) Y_R // // We also know that since RGB=(1,1,1) should give us the // D65 illuminant, we must have @@ -121,7 +121,7 @@ void get_xyz_matrix(ColorSpace space, Matrix3x3 m) m[2] = Z_R; m[5] = Z_G; m[8] = Z_B; } -std::string ColorSpaceConversionEffect::output_fragment_shader() +std::string ColorspaceConversionEffect::output_fragment_shader() { // Create a matrix to convert from source space -> XYZ, // another matrix to convert from XYZ -> destination space,