X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=resample_effect.h;h=73dfc210e9732388e193ed2dcd0eb6cdb31d50a8;hb=bf5dbd5c67579899840a969d6a3ff81ff61cd0c7;hp=24e637260ea97489d54080bef521572bc68d8b05;hpb=8c7e53028a3ef4805d2608643041a5d7e6bd1b6e;p=movit diff --git a/resample_effect.h b/resample_effect.h index 24e6372..73dfc21 100644 --- a/resample_effect.h +++ b/resample_effect.h @@ -53,9 +53,14 @@ public: private: void update_size(); + void update_offset_and_zoom(); SingleResamplePassEffect *hpass, *vpass; int input_width, input_height, output_width, output_height; + + float offset_x, offset_y; + float zoom_x, zoom_y; + float zoom_center_x, zoom_center_y; }; class SingleResamplePassEffect : public Effect { @@ -73,12 +78,14 @@ public: virtual bool needs_srgb_primaries() const { return false; } virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } + virtual void inform_added(EffectChain *chain) { this->chain = chain; } virtual void inform_input_size(unsigned input_num, unsigned width, unsigned height) { if (parent != NULL) { parent->inform_input_size(input_num, width, height); } } 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_width = *width = this->output_width; @@ -93,12 +100,17 @@ private: void update_texture(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); ResampleEffect *parent; + EffectChain *chain; Direction direction; GLuint texnum; int input_width, input_height, output_width, output_height; + float offset, zoom; int last_input_width, last_input_height, last_output_width, last_output_height; + float last_offset, last_zoom; int src_bilinear_samples, num_loops; float slice_height; + int last_texture_width, last_texture_height; + GLuint last_texture_internal_format; }; } // namespace movit