X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=padding_effect.h;h=acd555fa3511bd27414e4bf38c9411e49cb384b8;hp=901f892b9dd14f999776f823bb897370f32d25d5;hb=fbb1247a1996c6dbe54114eb5cc23dc79e17099c;hpb=8ea03db1932e4a76f457e0ecdfe31a4c8be0e0eb diff --git a/padding_effect.h b/padding_effect.h index 901f892..acd555f 100644 --- a/padding_effect.h +++ b/padding_effect.h @@ -11,6 +11,10 @@ // The border color is taken to be in linear gamma, sRGB, with premultiplied alpha. // You may not change it after calling finalize(), since that could change the // graph (need_linear_light() etc. depend on the border color you choose). +// +// IntegralPaddingEffect is like PaddingEffect, except that "top" and "left" parameters +// are int parameters instead of float. This allows it to guarantee one-to-one sampling, +// which can speed up processing by allowing more effect passes to be collapsed. #include #include @@ -31,6 +35,7 @@ public: virtual AlphaHandling alpha_handling() const; virtual bool changes_output_size() const { return true; } + virtual bool sets_virtual_output_size() const { return false; } virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const; virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height); @@ -41,6 +46,15 @@ private: float top, left; }; +class IntegralPaddingEffect : public PaddingEffect { +public: + IntegralPaddingEffect(); + virtual std::string effect_type_id() const { return "IntegralPaddingEffect"; } + virtual bool one_to_one_sampling() const { return true; } + virtual bool set_int(const std::string&, int value); + virtual bool set_float(const std::string &key, float value); +}; + } // namespace movit #endif // !defined(_MOVIT_PADDING_EFFECT_H)