1 #ifndef _MOVIT_YCBCR_CONVERSION_EFFECT_H
2 #define _MOVIT_YCBCR_CONVERSION_EFFECT_H 1
4 // Converts from R'G'B' to Y'CbCr; that is, more or less the opposite of YCbCrInput,
5 // except that it keeps the data as 4:4:4 chunked Y'CbCr; you'll need to subsample
6 // and/or convert to planar somehow else.
17 class YCbCrConversionEffect : public Effect {
19 // Should not be instantiated by end users;
20 // call EffectChain::add_ycbcr_output() instead.
21 YCbCrConversionEffect(const YCbCrFormat &ycbcr_format, GLenum type);
22 friend class EffectChain;
25 virtual std::string effect_type_id() const { return "YCbCrConversionEffect"; }
26 std::string output_fragment_shader();
27 void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
28 virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
29 virtual bool one_to_one_sampling() const { return true; }
31 // Should not be called by end users; call
32 // EffectChain::change_ycbcr_output_format() instead.
33 void change_output_format(const YCbCrFormat &ycbcr_format) {
34 this->ycbcr_format = ycbcr_format;
38 YCbCrFormat ycbcr_format;
41 Eigen::Matrix3d uniform_ycbcr_matrix;
42 float uniform_offset[3];
43 bool uniform_clamp_range;
44 float uniform_ycbcr_min[3], uniform_ycbcr_max[3];
49 #endif // !defined(_MOVIT_YCBCR_CONVERSION_EFFECT_H)