]> git.sesse.net Git - movit/blob - resize_effect.h
3cb40e3344d7703180e90e8d2352a73df876e87a
[movit] / resize_effect.h
1 #ifndef _RESIZE_EFFECT_H
2 #define _RESIZE_EFFECT_H 1
3
4 // An effect that simply resizes the picture to a given output size
5 // (set by the two integer parameters "width" and "height").
6 // Mostly useful as part of other algorithms.
7
8 #include "effect.h"
9
10 class ResizeEffect : public Effect {
11 public:
12         ResizeEffect();
13         virtual std::string effect_type_id() const { return "ResizeEffect"; }
14         std::string output_fragment_shader();
15
16         // We want processing done pre-filtering and mipmapped,
17         // in case we need to scale down a lot.
18         virtual bool need_texture_bounce() const { return true; }
19         virtual bool needs_mipmaps() const { return true; }
20         virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
21
22         virtual bool changes_output_size() const { return true; }
23         virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const;
24
25 private:
26         int width, height;
27 };
28
29 #endif // !defined(_RESIZE_EFFECT_H)