X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr_conversion_effect.h;h=f57e5fa5f399a0457227838ebe43ffd23864fba4;hp=46113bfc790ecc84289d50681b60412ea765a249;hb=425d68dcbdd681ad3157000360521e8f36eb6c4c;hpb=80fc4a6e806e5638ae050c3020962137ca5fd76b diff --git a/ycbcr_conversion_effect.h b/ycbcr_conversion_effect.h index 46113bf..f57e5fa 100644 --- a/ycbcr_conversion_effect.h +++ b/ycbcr_conversion_effect.h @@ -6,6 +6,7 @@ // and/or convert to planar somehow else. #include +#include #include #include "effect.h" @@ -17,17 +18,30 @@ class YCbCrConversionEffect : public Effect { private: // Should not be instantiated by end users; // call EffectChain::add_ycbcr_output() instead. - YCbCrConversionEffect(const YCbCrFormat &ycbcr_format); + YCbCrConversionEffect(const YCbCrFormat &ycbcr_format, GLenum type); friend class EffectChain; public: virtual std::string effect_type_id() const { return "YCbCrConversionEffect"; } std::string output_fragment_shader(); + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } virtual bool one_to_one_sampling() const { return true; } + // Should not be called by end users; call + // EffectChain::change_ycbcr_output_format() instead. + void change_output_format(const YCbCrFormat &ycbcr_format) { + this->ycbcr_format = ycbcr_format; + } + private: YCbCrFormat ycbcr_format; + GLenum type; + + Eigen::Matrix3d uniform_ycbcr_matrix; + float uniform_offset[3]; + bool uniform_clamp_range; + float uniform_ycbcr_min[3], uniform_ycbcr_max[3]; }; } // namespace movit