1 /* === S Y N F I G ========================================================= */
2 /*! \file layer_shape.h
3 ** \brief Template Header
5 ** $Id: layer_shape.h,v 1.2 2005/01/24 03:08:18 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_LAYER_SHAPE_H
26 #define __SYNFIG_LAYER_SHAPE_H
28 /* === H E A D E R S ======================================================= */
30 #include "layer_composite.h"
37 /* === M A C R O S ========================================================= */
39 /* === T Y P E D E F S ===================================================== */
41 /* === C L A S S E S & S T R U C T S ======================================= */
45 /*! \class Layer_Shape
47 class Layer_Shape : public Layer_Composite, public Layer_NoDeform
49 SYNFIG_LAYER_MODULE_EXT
55 Intersector *edge_table;
67 std::vector< char > bytestream;
69 //for use in creating the bytestream
75 Layer_Shape(const Real &a = 1.0, const Color::BlendMethod m = Color::BLEND_COMPOSITE);
81 //! Clears out any data
82 /*! Also clears out the Intersector
87 void move_to(Real x, Real y);
88 void line_to(Real x, Real y);
89 void conic_to(Real x1, Real y1, Real x, Real y);
90 void conic_to_smooth(Real x, Real y); //x1,y1 derived from current tangent
91 void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
92 void curve_to_smooth(Real x2, Real y2, Real x, Real y); //x1,y1 derived from current tangent
96 virtual bool set_param(const String & param, const synfig::ValueBase &value);
97 virtual ValueBase get_param(const String & param)const;
99 virtual Vocab get_param_vocab()const;
101 virtual Color get_color(Context context, const Point &pos)const;
102 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
103 virtual synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
104 virtual Rect get_bounding_rect()const;
108 bool render_polyspan(Surface *surface,PolySpan &polyspan,
109 Color::BlendMethod method,Color::value_type amount)const;
110 bool render_polyspan(etl::surface<float> *surface,PolySpan &polyspan)const;
111 virtual bool render_shape(Surface *surface,bool useblend,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
112 virtual bool render_shape(etl::surface<float> *surface,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
113 }; // END of Layer_Shape
115 }; // END of namespace synfig
116 /* === E N D =============================================================== */