1 #ifndef _MOVIT_SLICE_EFFECT_H
2 #define _MOVIT_SLICE_EFFECT_H 1
4 // SliceEffect takes an image, cuts it into (potentially overlapping) slices,
5 // and puts those slices back together again consecutively. It is primarily
6 // useful in an overlap-discard setting, where it can do both the overlap and
7 // discard roles, where one does convolutions by means of many small FFTs, but
8 // could also work as a (relatively boring) video effect on its own.
10 // Note that vertical slices happen from the top, consistent with the rest of
20 class SliceEffect : public Effect {
23 virtual std::string effect_type_id() const { return "SliceEffect"; }
24 std::string output_fragment_shader();
25 virtual bool needs_texture_bounce() const { return true; }
26 virtual bool changes_output_size() const { return true; }
27 virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height);
28 virtual void get_output_size(unsigned *width, unsigned *height,
29 unsigned *virtual_width, unsigned *virtual_height) const;
31 void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
32 virtual void inform_added(EffectChain *chain) { this->chain = chain; }
34 enum Direction { HORIZONTAL = 0, VERTICAL = 1 };
38 int input_width, input_height;
39 int input_slice_size, output_slice_size;
46 #endif // !defined(_MOVIT_SLICE_EFFECT_H)