1 /* === S I N F G =========================================================== */
2 /*! \file boolean_curve.cpp
3 ** \brief Boolean Curve Implementation File
5 ** $Id: booleancurve.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "booleancurve.h"
33 #include <sinfg/string.h>
34 #include <sinfg/time.h>
35 #include <sinfg/context.h>
36 #include <sinfg/paramdesc.h>
37 #include <sinfg/renddesc.h>
38 #include <sinfg/surface.h>
39 #include <sinfg/value.h>
40 #include <sinfg/valuenode.h>
44 /* === U S I N G =========================================================== */
48 using namespace sinfg;
50 /* === M A C R O S ========================================================= */
52 /* === G L O B A L S ======================================================= */
54 /* === P R O C E D U R E S ================================================= */
56 /* === M E T H O D S ======================================================= */
58 /* === E N T R Y P O I N T ================================================= */
60 BooleanCurve::BooleanCurve()
64 BooleanCurve::~BooleanCurve()
68 bool BooleanCurve::set_param(const String & param, const sinfg::ValueBase &value)
70 if(param=="regions" && value.same_as(regions))
72 vector<BLinePoint> bv;
73 int size = value.get_list().size();
75 const vector<ValueBase> &vlist = value.get_list();
78 for(int i = 0; i < size; ++i)
80 regions.push_back(vector<BLinePoint>(vlist[i].get_list().begin(),vlist[i].get_list().end()));
85 return Layer_Shape::set_param(param,value);
88 ValueBase BooleanCurve::get_param(const String & param)const
95 return Layer_Shape::get_param(param);
98 Layer::Vocab BooleanCurve::get_param_vocab()const
100 Layer::Vocab ret(Layer_Shape::get_param_vocab());
102 ret.push_back(ParamDesc("regions")
103 .set_local_name(_("Region Set"))
104 .set_description(_("Set of regions to combine"))
110 Color BooleanCurve::get_color(Context context, const Point &pos)const
112 Color c(Color::alpha());
117 bool BooleanCurve::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const