X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=vignette_effect.h;h=926a5be0e0e5dd794c72b2ee0c7c507bedbee919;hp=a39470398a0dba9cda171f34cf4f96c2ec04411b;hb=2fd06b9c44225d1e740cb2de08a9dfa5c9cd0031;hpb=b10c546f579c7ccb5939161e61a71cd18a3f9bbd diff --git a/vignette_effect.h b/vignette_effect.h index a394703..926a5be 100644 --- a/vignette_effect.h +++ b/vignette_effect.h @@ -1,11 +1,16 @@ -#ifndef _VIGNETTE_EFFECT_H -#define _VIGNETTE_EFFECT_H 1 +#ifndef _MOVIT_VIGNETTE_EFFECT_H +#define _MOVIT_VIGNETTE_EFFECT_H 1 // A circular vignette, falling off as cos² of the distance from the center // (the classic formula for approximating a real lens). +#include +#include + #include "effect.h" +namespace movit { + class VignetteEffect : public Effect { public: VignetteEffect(); @@ -14,12 +19,18 @@ public: virtual bool needs_srgb_primaries() const { return false; } virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + virtual bool one_to_one_sampling() const { return true; } + virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); private: Point2D center; + Point2D uniform_aspect_correction, uniform_flipped_center; float radius, inner_radius; + float uniform_pihalf_div_radius; }; -#endif // !defined(_VIGNETTE_EFFECT_H) +} // namespace movit + +#endif // !defined(_MOVIT_VIGNETTE_EFFECT_H)