00001 /* === S Y N F I G ========================================================= */ 00022 /* ========================================================================= */ 00023 00024 /* === S T A R T =========================================================== */ 00025 00026 #ifndef __SYNFIG_LAYER_COMPOSITE_H 00027 #define __SYNFIG_LAYER_COMPOSITE_H 00028 00029 /* === H E A D E R S ======================================================= */ 00030 00031 #include "layer.h" 00032 #include "color.h" 00033 00034 /* === M A C R O S ========================================================= */ 00035 00036 /* === T Y P E D E F S ===================================================== */ 00037 00038 /* === C L A S S E S & S T R U C T S ======================================= */ 00039 00040 namespace synfig { 00041 00042 class Layer_NoDeform {}; 00043 00044 00048 class Layer_Composite : public Layer 00049 { 00050 private: 00051 00052 float amount_; 00053 00054 Color::BlendMethod blend_method_; 00055 00056 protected: 00057 00058 Layer_Composite( 00059 float amount=1.0, 00060 Color::BlendMethod blend_method=Color::BLEND_COMPOSITE 00061 ): 00062 amount_ (amount), 00063 blend_method_ (blend_method), 00064 converted_blend_ (false), 00065 transparent_color_ (false) 00066 { } 00067 00068 bool converted_blend_; 00069 bool transparent_color_; 00070 00071 public: 00072 00073 float get_amount()const { return amount_; } 00074 00075 Layer_Composite& set_amount(float x) { amount_=x; return *this; } 00076 00077 Color::BlendMethod get_blend_method()const { return blend_method_; } 00078 00079 Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; } 00080 00081 virtual bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; } 00082 00083 bool is_disabled()const { return amount_==0.0f; } 00084 00085 virtual Vocab get_param_vocab()const; 00086 00087 virtual bool set_param(const String ¶m, const ValueBase &value); 00088 00089 virtual ValueBase get_param(const String ¶m)const; 00090 00091 virtual Rect get_full_bounding_rect(Context context)const; 00092 00093 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const; 00094 }; // END of class Layer_Composite 00095 00096 }; // END of namespace synfig 00097 00098 /* === E N D =============================================================== */ 00099 00100 #endif