-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
/*! \file clamp.cpp
-** \brief Template Header
+** \brief Implementation of the "Clamp" layer
**
-** $Id: clamp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $
+** $Id$
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
** \endlegal
*/
/* ========================================================================= */
#endif
#include "clamp.h"
-#include <sinfg/string.h>
-#include <sinfg/time.h>
-#include <sinfg/context.h>
-#include <sinfg/paramdesc.h>
-#include <sinfg/renddesc.h>
-#include <sinfg/surface.h>
-#include <sinfg/value.h>
-#include <sinfg/valuenode.h>
+#include <synfig/string.h>
+#include <synfig/time.h>
+#include <synfig/context.h>
+#include <synfig/paramdesc.h>
+#include <synfig/renddesc.h>
+#include <synfig/surface.h>
+#include <synfig/value.h>
+#include <synfig/valuenode.h>
#endif
using namespace etl;
using namespace std;
-using namespace sinfg;
+using namespace synfig;
/* === G L O B A L S ======================================================= */
-SINFG_LAYER_INIT(Layer_Clamp);
-SINFG_LAYER_SET_NAME(Layer_Clamp,"clamp");
-SINFG_LAYER_SET_LOCAL_NAME(Layer_Clamp,_("Clamp"));
-SINFG_LAYER_SET_CATEGORY(Layer_Clamp,_("Filters"));
-SINFG_LAYER_SET_VERSION(Layer_Clamp,"0.2");
-SINFG_LAYER_SET_CVS_ID(Layer_Clamp,"$Id: clamp.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $");
+SYNFIG_LAYER_INIT(Layer_Clamp);
+SYNFIG_LAYER_SET_NAME(Layer_Clamp,"clamp");
+SYNFIG_LAYER_SET_LOCAL_NAME(Layer_Clamp,N_("Clamp"));
+SYNFIG_LAYER_SET_CATEGORY(Layer_Clamp,N_("Filters"));
+SYNFIG_LAYER_SET_VERSION(Layer_Clamp,"0.2");
+SYNFIG_LAYER_SET_CVS_ID(Layer_Clamp,"$Id$");
/* === P R O C E D U R E S ================================================= */
Layer_Clamp::clamp_color(const Color &in)const
{
Color ret(in);
-
+
if(ret.get_a()==0)
return Color::alpha();
{
if(ret.get_a()<floor)
ret=-ret;
-
+
if(ret.get_r()<floor)
{
ret.set_g(ret.get_g()-ret.get_r());
}
return ret;
}
-
+
bool
Layer_Clamp::set_param(const String & param, const ValueBase &value)
{
IMPORT(clamp_ceiling);
IMPORT(ceiling);
IMPORT(floor);
-
- return false;
+
+ return false;
}
ValueBase
EXPORT_NAME();
EXPORT_VERSION();
-
- return ValueBase();
+
+ return ValueBase();
}
Layer::Vocab
Layer_Clamp::get_param_vocab()const
{
Layer::Vocab ret;
-
+
ret.push_back(ParamDesc("invert_negative")
.set_local_name(_("Invert Negative"))
);
ret.push_back(ParamDesc("floor")
.set_local_name(_("Floor"))
);
-
+
return ret;
}
{
return clamp_color(context.get_color(pos));
}
-
+
bool
Layer_Clamp::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
{