X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=ycbcr_conversion_effect.h;h=752eb43934d5682f00651dc8ededb5626f07432c;hp=46113bfc790ecc84289d50681b60412ea765a249;hb=eff011224abc5dc81f801f3ea44572287a55bcac;hpb=80fc4a6e806e5638ae050c3020962137ca5fd76b diff --git a/ycbcr_conversion_effect.h b/ycbcr_conversion_effect.h index 46113bf..752eb43 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(); - virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } - virtual bool one_to_one_sampling() const { return true; } + std::string effect_type_id() const override { return "YCbCrConversionEffect"; } + std::string output_fragment_shader() override; + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override; + AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; } + bool strong_one_to_one_sampling() const override { 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