1 /* === S Y N F I G ========================================================= */
2 /*! \file booleancurve.cpp
3 ** \brief Boolean Curve Implementation File
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 /* === H E A D E R S ======================================================= */
32 #include "booleancurve.h"
34 #include <synfig/string.h>
35 #include <synfig/time.h>
36 #include <synfig/context.h>
37 #include <synfig/paramdesc.h>
38 #include <synfig/renddesc.h>
39 #include <synfig/surface.h>
40 #include <synfig/value.h>
41 #include <synfig/valuenode.h>
45 /* === U S I N G =========================================================== */
49 using namespace synfig;
51 /* === M A C R O S ========================================================= */
53 /* === G L O B A L S ======================================================= */
55 /* === P R O C E D U R E S ================================================= */
57 /* === M E T H O D S ======================================================= */
59 /* === E N T R Y P O I N T ================================================= */
61 BooleanCurve::BooleanCurve()
65 BooleanCurve::~BooleanCurve()
69 bool BooleanCurve::set_param(const String & param, const synfig::ValueBase &value)
71 if(param=="regions" && value.same_type_as(regions))
73 vector<BLinePoint> bv;
74 int size = value.get_list().size();
76 const vector<ValueBase> &vlist = value.get_list();
79 for(int i = 0; i < size; ++i)
81 regions.push_back(vector<BLinePoint>(vlist[i].get_list().begin(),vlist[i].get_list().end()));
86 return Layer_Shape::set_param(param,value);
89 ValueBase BooleanCurve::get_param(const String & param)const
96 return Layer_Shape::get_param(param);
99 Layer::Vocab BooleanCurve::get_param_vocab()const
101 Layer::Vocab ret(Layer_Shape::get_param_vocab());
103 ret.push_back(ParamDesc("regions")
104 .set_local_name(_("Region Set"))
105 .set_description(_("Set of regions to combine"))
111 Color BooleanCurve::get_color(Context /*context*/, const Point &/*pos*/)const
113 Color c(Color::alpha());
118 bool BooleanCurve::accelerated_render(Context /*context*/,Surface */*surface*/,int /*quality*/, const RendDesc &/*renddesc*/, ProgressCallback */*cb*/)const