]> git.sesse.net Git - movit/blobdiff - resample_effect.h
There's no need to #undef PREFIX, since we do the token pasting ourselves.
[movit] / resample_effect.h
index 1aa459cbaaa3926c1aeabe2cd8f4647d77fd5f29..ceae920aa71c98a0799a8423f173bc9e13c25876 100644 (file)
@@ -18,7 +18,6 @@
 #include <epoxy/gl.h>
 #include <assert.h>
 #include <stddef.h>
-#include <memory>
 #include <string>
 
 #include "effect.h"
@@ -41,14 +40,15 @@ struct ScalingWeights {
        unsigned dst_samples, num_loops;
 
        // Exactly one of these is set.
-       std::unique_ptr<Tap<fp16_int_t>[]> bilinear_weights_fp16;
-       std::unique_ptr<Tap<float>[]> bilinear_weights_fp32;
+       Tap<fp16_int_t> *bilinear_weights_fp16;
+       Tap<float> *bilinear_weights_fp32;
 };
 ScalingWeights calculate_scaling_weights(unsigned src_size, unsigned dst_size, float zoom, float offset);
 
 class ResampleEffect : public Effect {
 public:
        ResampleEffect();
+       ~ResampleEffect();
 
        virtual std::string effect_type_id() const { return "ResampleEffect"; }
 
@@ -73,12 +73,16 @@ private:
        void update_size();
        void update_offset_and_zoom();
        
+       // Both of these are owned by us if owns_effects is true (before finalize()),
+       // and otherwise owned by the EffectChain.
+       bool owns_effects;
        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;
+       float unused;
 };
 
 class SingleResamplePassEffect : public Effect {
@@ -128,6 +132,7 @@ private:
 
        int input_width, input_height, output_width, output_height;
        float offset, zoom;
+       float unused;
        int last_input_width, last_input_height, last_output_width, last_output_height;
        float last_offset, last_zoom;
        int src_bilinear_samples, num_loops;