1 /* === S Y N F I G ========================================================= */
2 /*! \file layer_shape.h
3 ** \brief Template Header
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
53 WINDING_NON_ZERO=0, //!< less than -1 --> 1; -1 --> 1; 0 --> 0; 1 --> 1; greater than 1 --> 1
54 WINDING_EVEN_ODD=1, //!< add or subtract multiples of 2 to get into range -1:1, then as above
56 WINDING_END=2 //!< \internal
63 Intersector *edge_table;
74 WindingStyle winding_style;
76 std::vector< char > bytestream;
78 //for use in creating the bytestream
84 Layer_Shape(const Real &a = 1.0, const Color::BlendMethod m = Color::BLEND_COMPOSITE);
90 //! Clears out any data
91 /*! Also clears out the Intersector
96 void move_to(Real x, Real y);
97 void line_to(Real x, Real y);
98 void conic_to(Real x1, Real y1, Real x, Real y);
99 void conic_to_smooth(Real x, Real y); //x1,y1 derived from current tangent
100 void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
101 void curve_to_smooth(Real x2, Real y2, Real x, Real y); //x1,y1 derived from current tangent
105 virtual bool set_param(const String & param, const synfig::ValueBase &value);
106 virtual ValueBase get_param(const String & param)const;
108 virtual Vocab get_param_vocab()const;
110 virtual Color get_color(Context context, const Point &pos)const;
111 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
112 virtual synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
113 virtual Rect get_bounding_rect()const;
117 bool render_polyspan(Surface *surface,PolySpan &polyspan,
118 Color::BlendMethod method,Color::value_type amount)const;
119 bool render_polyspan(etl::surface<float> *surface,PolySpan &polyspan)const;
120 virtual bool render_shape(Surface *surface,bool useblend,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
121 virtual bool render_shape(etl::surface<float> *surface,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
122 }; // END of Layer_Shape
124 }; // END of namespace synfig
125 /* === E N D =============================================================== */