layer_composite.h

Go to the documentation of this file.
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     { }
00065 
00066 public:
00067 
00068     float get_amount()const { return amount_; }
00069 
00070     Layer_Composite& set_amount(float x) { amount_=x; return *this; }
00071 
00072     Color::BlendMethod get_blend_method()const { return blend_method_; }
00073 
00074     Layer_Composite& set_blend_method(Color::BlendMethod x) { blend_method_=x; return *this; }
00075 
00076     virtual bool is_solid_color()const { return amount_==1.0f && blend_method_==Color::BLEND_STRAIGHT; }
00077 
00078     bool is_disabled()const { return amount_==0.0f; }
00079 
00080     virtual Vocab get_param_vocab()const;
00081 
00082     virtual bool set_param(const String &param, const ValueBase &value);
00083 
00084     virtual ValueBase get_param(const String &param)const;
00085 
00086     virtual Rect get_full_bounding_rect(Context context)const;
00087 
00088     virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
00089 }; // END of class Layer_Composite
00090 
00091 }; // END of namespace synfig
00092 
00093 /* === E N D =============================================================== */
00094 
00095 #endif

Generated on Wed Dec 12 03:11:41 2007 for synfig by  doxygen 1.5.4