1 #ifndef _MOVIT_COLORSPACE_CONVERSION_EFFECT_H
2 #define _MOVIT_COLORSPACE_CONVERSION_EFFECT_H 1
4 // An effect to convert between different color spaces.
5 // Can convert freely between sRGB/Rec. 709 and the two different Rec. 601
6 // color spaces (which thankfully have the same white point).
8 // We don't do any fancy gamut mapping or similar; colors that are out-of-gamut
9 // will simply stay out-of-gamut, and probably clip in the output stage.
15 #include "image_format.h"
17 class ColorspaceConversionEffect : public Effect {
19 // Should not be instantiated by end users.
20 ColorspaceConversionEffect();
21 friend class EffectChain;
24 virtual std::string effect_type_id() const { return "ColorspaceConversionEffect"; }
25 std::string output_fragment_shader();
27 virtual bool needs_srgb_primaries() const { return false; }
28 virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
30 // Get a conversion matrix from the given color space to XYZ.
31 static Eigen::Matrix3d get_xyz_matrix(Colorspace space);
34 Colorspace source_space, destination_space;
37 #endif // !defined(_MOVIT_COLORSPACE_CONVERSION_EFFECT_H)