1 /* === S Y N F I G ========================================================= */
2 /*! \file blineconvert.h
3 ** \brief Template Header
5 ** $Id: blineconvert.h,v 1.1.1.1 2005/01/07 03:34:37 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_BLINE_CONVERT_H
26 #define __SYNFIG_BLINE_CONVERT_H
28 /* === H E A D E R S ======================================================= */
30 #include <synfig/general.h>
31 #include <synfig/blinepoint.h>
35 /* === M A C R O S ========================================================= */
37 /* === T Y P E D E F S ===================================================== */
39 /* === C L A S S E S & S T R U C T S ======================================= */
49 synfig::Real tangentscale;
50 synfig::Real error; //negative error will indicate invalid;
52 cpindex(int ci, synfig::Real s=0, synfig::Real e=-1)
53 :curind(ci), tangentscale(s), error(e)
56 cpindex(const cpindex & o)
57 :curind(o.curind), tangentscale(o.tangentscale), error(o.error)
60 const cpindex & operator = (const cpindex & rhs)
63 tangentscale = rhs.tangentscale;
68 bool operator < (const cpindex &rhs) const
70 return curind < rhs.curind;
73 //point is obviously in[curind]
74 //tangent scale will get reset to the smallest (or something else depending on experimentation)
79 std::vector<synfig::Point> f; //the preprocessed input cache
80 std::vector<synfig::Real> f_w;
82 //temporary point storage for vector calc
83 std::vector<synfig::Point> ftemp;
85 std::vector<synfig::Vector> df; //the derivative cache
86 std::vector<synfig::Real> cvt; //the curvature cache
88 std::vector<int> brk; //the break point cache
90 std::vector<synfig::Real> di, //cumulative distance
91 d_i; //distance between adjacent segments
93 std::vector<synfig::Point> work; //the working point cache for the entire curve
94 std::vector<cpindex> curind;
102 //Converter properties
103 synfig::Real pixelwidth;
104 synfig::Real smoothness; //actual error will be smoothness*pixelwidth (for global set pixelwidth = 1)
108 static void EnforceMinWidth(std::list<synfig::BLinePoint> &bline, synfig::Real min_pressure);
109 void operator ()(std::list<synfig::BLinePoint> &out, const std::list<synfig::Point> &in,const std::list<synfig::Real> &in_w);
112 }; // END of namespace synfigapp
114 /* === E N D =============================================================== */