Allow motion blur layer to have static parameters
authorCarlos Lopez <genetita@gmail.com>
Sat, 21 Aug 2010 11:34:42 +0000 (13:34 +0200)
committerCarlos Lopez <genetita@gmail.com>
Sat, 21 Aug 2010 11:34:42 +0000 (13:34 +0200)
synfig-core/src/synfig/layer_motionblur.cpp
synfig-core/src/synfig/layer_motionblur.h

index 855112c..c0e27ea 100644 (file)
@@ -66,7 +66,12 @@ Layer_MotionBlur::Layer_MotionBlur():
        subsamples_factor       (1.0),
        subsampling_type        (SUBSAMPLING_HYPERBOLIC),
        subsample_start         (0.0),
-       subsample_end           (1.0)
+       subsample_end           (1.0),
+       aperture_static                         (false),
+       subsamples_factor_static        (false),
+       subsampling_type_static         (true),
+       subsample_start_static          (false),
+       subsample_end_static            (false)
 {
 }
 
@@ -264,3 +269,30 @@ Layer_MotionBlur::accelerated_render(Context context,Surface *surface,int qualit
 
        return true;
 }
+
+
+bool
+Layer_MotionBlur::set_param_static(const String &param, const bool x)
+{
+       SET_STATIC(aperture, x)
+       SET_STATIC(subsamples_factor, x)
+       SET_STATIC(subsampling_type, x)
+       SET_STATIC(subsample_start, x)
+       SET_STATIC(subsample_end, x)
+
+       return Layer_Composite::set_param_static(param, x);
+}
+
+
+bool
+Layer_MotionBlur::get_param_static(const String &param) const
+{
+
+       GET_STATIC(aperture)
+       GET_STATIC(subsamples_factor)
+       GET_STATIC(subsampling_type)
+       GET_STATIC(subsample_start)
+       GET_STATIC(subsample_end)
+
+       return Layer_Composite::get_param_static(param);
+}
index 9b4391c..43d946b 100644 (file)
@@ -56,10 +56,18 @@ private:
        Real subsample_end;
        mutable Time time_cur;
 
+       bool aperture_static;
+       bool subsamples_factor_static;
+       bool subsampling_type_static;
+       bool subsample_start_static;
+       bool subsample_end_static;
+
 public:
        Layer_MotionBlur();
        virtual bool set_param(const String & param, const synfig::ValueBase &value);
        virtual ValueBase get_param(const String & param)const;
+       virtual bool set_param_static(const String &param, const bool x);
+       virtual bool get_param_static(const String &param) const;
        virtual Color get_color(Context context, const Point &pos)const;
        virtual void set_time(Context context, Time time)const;
        virtual void set_time(Context context, Time time, const Point &point)const;