layer_composite.h

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

Generated on Wed Aug 15 05:00:23 2007 for synfig by  doxygen 1.5.3