]> git.sesse.net Git - movit/blobdiff - padding_effect.h
Fix a comment.
[movit] / padding_effect.h
index fdefbe0fe1a7b0fe329ed094bacaf3065b113697..acd555fa3511bd27414e4bf38c9411e49cb384b8 100644 (file)
 // 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).
 //
-// As a convenience, if the flag “pad_from_bottom” is nonzero, the “top” parameter
-// will mean pixels from the bottom (matching OpenGL's usual bottom-left convention),
-// instead of from the top as usual.
+// 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 <GL/glew.h>
+#include <epoxy/gl.h>
 #include <string>
 
 #include "effect.h"
@@ -35,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);
 
@@ -43,7 +44,15 @@ private:
        int input_width, input_height;
        int output_width, output_height;
        float top, left;
-       int pad_from_bottom;
+};
+
+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