]> git.sesse.net Git - movit/blobdiff - effect_chain.h
Allow an effect to have multiple inputs (although the graph still supports only one...
[movit] / effect_chain.h
index a22e96ad98629bc5e4980836b2eb563bd266a8e0..f521e9c40c083667d58e1aa795a615dc841c4700 100644 (file)
@@ -41,7 +41,18 @@ public:
        Effect *add_effect(EffectId effect) {
                return add_effect(effect, get_last_added_effect());
        }
        Effect *add_effect(EffectId effect) {
                return add_effect(effect, get_last_added_effect());
        }
-       Effect *add_effect(EffectId effect, Effect *input);
+       Effect *add_effect(EffectId effect, Effect *input) {
+               std::vector<Effect *> inputs;
+               inputs.push_back(input);
+               return add_effect(effect, inputs);
+       }
+       Effect *add_effect(EffectId effect, Effect *input1, Effect *input2) {
+               std::vector<Effect *> inputs;
+               inputs.push_back(input1);
+               inputs.push_back(input2);
+               return add_effect(effect, inputs);
+       }
+       Effect *add_effect(EffectId effect, const std::vector<Effect *> &inputs);
 
        // Similar to add_effect, but:
        //
 
        // Similar to add_effect, but:
        //
@@ -51,7 +62,7 @@ public:
        //
        // We should really separate out these two “sides” of Effect in the
        // type system soon.
        //
        // We should really separate out these two “sides” of Effect in the
        // type system soon.
-       void add_effect_raw(Effect *effect, Effect *input);
+       void add_effect_raw(Effect *effect, const std::vector<Effect *> &inputs);
 
        void add_output(const ImageFormat &format);
        void finalize();
 
        void add_output(const ImageFormat &format);
        void finalize();
@@ -95,8 +106,8 @@ private:
        bool finalized;
 
        // Used during the building of the effect chain.
        bool finalized;
 
        // Used during the building of the effect chain.
-       ColorSpace current_color_space;
-       GammaCurve current_gamma_curve; 
+       std::map<Effect *, ColorSpace> output_color_space;
+       std::map<Effect *, GammaCurve> output_gamma_curve;      
 };
 
 
 };