From: Steinar H. Gunderson Date: Fri, 5 Oct 2012 14:55:21 +0000 (+0200) Subject: Mark some appropriate effects as not needing sRGB primaries, and expand the comment... X-Git-Tag: 1.0~382 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=2293282969ee51d9c244df8a3082de0605512537 Mark some appropriate effects as not needing sRGB primaries, and expand the comment on when it is appropriate not to use them. --- diff --git a/blur_effect.h b/blur_effect.h index d90f99a..3e516b7 100644 --- a/blur_effect.h +++ b/blur_effect.h @@ -17,6 +17,8 @@ class BlurEffect : public Effect { public: BlurEffect(); + virtual bool needs_srgb_primaries() const { return false; } + virtual std::string output_fragment_shader() { assert(false); } @@ -38,6 +40,7 @@ public: SingleBlurPassEffect(); std::string output_fragment_shader(); + virtual bool needs_srgb_primaries() const { return false; } virtual bool needs_texture_bounce() const { return true; } virtual bool needs_mipmaps() const { return true; } diff --git a/diffusion_effect.h b/diffusion_effect.h index 4223d22..3eab502 100644 --- a/diffusion_effect.h +++ b/diffusion_effect.h @@ -22,6 +22,8 @@ public: DiffusionEffect(); std::string output_fragment_shader(); + virtual bool needs_srgb_primaries() const { return false; } + virtual void add_self_to_effect_chain(EffectChain *chain, const std::vector &input); virtual bool set_float(const std::string &key, float value); diff --git a/effect.h b/effect.h index fcb7526..082c234 100644 --- a/effect.h +++ b/effect.h @@ -60,7 +60,9 @@ public: // set of RGB primaries; you would currently not get YCbCr // or something similar). // - // Again, most effects will want this. + // Again, most effects will want this, but you can set it to false + // if you process each channel independently, equally _and_ + // in a linear fashion. virtual bool needs_srgb_primaries() const { return true; } // Whether this effect expects its input to come directly from diff --git a/vignette_effect.h b/vignette_effect.h index c9a08bf..2567e83 100644 --- a/vignette_effect.h +++ b/vignette_effect.h @@ -11,6 +11,8 @@ public: VignetteEffect(); std::string output_fragment_shader(); + virtual bool needs_srgb_primaries() const { return false; } + void set_uniforms(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); private: