]> git.sesse.net Git - movit/blob - resize_effect.h
It's now 2014 :-P (Happy new year!)
[movit] / resize_effect.h
1 #ifndef _MOVIT_RESIZE_EFFECT_H
2 #define _MOVIT_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 <string>
9
10 #include "effect.h"
11
12 class ResizeEffect : public Effect {
13 public:
14         ResizeEffect();
15         virtual std::string effect_type_id() const { return "ResizeEffect"; }
16         std::string output_fragment_shader();
17
18         // We want processing done pre-filtering and mipmapped,
19         // in case we need to scale down a lot.
20         virtual bool need_texture_bounce() const { return true; }
21         virtual bool needs_mipmaps() const { return true; }
22         virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
23
24         virtual bool changes_output_size() const { return true; }
25         virtual void get_output_size(unsigned *width, unsigned *height, unsigned *virtual_width, unsigned *virtual_height) const;
26
27 private:
28         int width, height;
29 };
30
31 #endif // !defined(_MOVIT_RESIZE_EFFECT_H)