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
9 ** Copyright (c) 2007 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_LAYER_SHAPE_H
27 #define __SYNFIG_LAYER_SHAPE_H
29 /* === H E A D E R S ======================================================= */
31 #include "layer_composite.h"
38 /* === M A C R O S ========================================================= */
40 /* === T Y P E D E F S ===================================================== */
42 /* === C L A S S E S & S T R U C T S ======================================= */
46 /*! \class Layer_Shape
48 class Layer_Shape : public Layer_Composite, public Layer_NoDeform
50 SYNFIG_LAYER_MODULE_EXT
54 WINDING_NON_ZERO=0, //!< less than -1 --> 1; -1 --> 1; 0 --> 0; 1 --> 1; greater than 1 --> 1
55 WINDING_EVEN_ODD=1, //!< add or subtract multiples of 2 to get into range -1:1, then as above
57 WINDING_END=2 //!< \internal
64 Intersector *edge_table;
75 WindingStyle winding_style;
77 std::vector< char > bytestream;
79 //for use in creating the bytestream
85 Layer_Shape(const Real &a = 1.0, const Color::BlendMethod m = Color::BLEND_COMPOSITE);
91 //! Clears out any data
92 /*! Also clears out the Intersector
97 void move_to(Real x, Real y);
98 void line_to(Real x, Real y);
99 void conic_to(Real x1, Real y1, Real x, Real y);
100 void conic_to_smooth(Real x, Real y); //x1,y1 derived from current tangent
101 void curve_to(Real x1, Real y1, Real x2, Real y2, Real x, Real y);
102 void curve_to_smooth(Real x2, Real y2, Real x, Real y); //x1,y1 derived from current tangent
106 virtual bool set_param(const String & param, const synfig::ValueBase &value);
107 virtual ValueBase get_param(const String & param)const;
109 virtual Vocab get_param_vocab()const;
111 virtual Color get_color(Context context, const Point &pos)const;
112 virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
113 virtual synfig::Layer::Handle hit_check(synfig::Context context, const synfig::Point &point)const;
114 virtual Rect get_bounding_rect()const;
118 bool render_polyspan(Surface *surface,PolySpan &polyspan,
119 Color::BlendMethod method,Color::value_type amount)const;
120 bool render_polyspan(etl::surface<float> *surface,PolySpan &polyspan)const;
121 virtual bool render_shape(Surface *surface,bool useblend,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
122 virtual bool render_shape(etl::surface<float> *surface,int quality,const RendDesc &renddesc, ProgressCallback *cb)const;
123 }; // END of Layer_Shape
125 }; // END of namespace synfig
126 /* === E N D =============================================================== */