]> git.sesse.net Git - movit/blobdiff - padding_effect.h
Support pad/crop from bottom, not just from the top.
[movit] / padding_effect.h
index 797db7e990eedf867ba17f3377e1a518c6c1de4d..fdefbe0fe1a7b0fe329ed094bacaf3065b113697 100644 (file)
 // 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).
+//
+// 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.
 
 #include <GL/glew.h>
 #include <string>
 
 #include "effect.h"
 
+namespace movit {
+
 class PaddingEffect : public Effect {
 public:
        PaddingEffect();
@@ -33,10 +39,13 @@ public:
        virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
 
 private:
-       RGBATriplet border_color;
+       RGBATuple border_color;
        int input_width, input_height;
        int output_width, output_height;
        float top, left;
+       int pad_from_bottom;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_PADDING_EFFECT_H)