X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_filter%2Fhalftone3.cpp;h=87d44af0d6e9ccd2f17ec6a29caa0878223db632;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=2905c9d0ddcde7795c19368959c04e7f2ec62d5c;hpb=16b3beced25134bef064705568ecb893a6be4e79;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp b/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp index 2905c9d..87d44af 100644 --- a/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp +++ b/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file halftone3.cpp ** \brief blehh ** -** $Id: halftone3.cpp,v 1.1.1.1 2005/01/04 01:23:10 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 */ /* ========================================================================= */ @@ -31,31 +32,31 @@ #include "halftone3.h" #include "halftone.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #endif /* === M A C R O S ========================================================= */ -using namespace sinfg; +using namespace synfig; using namespace std; using namespace etl; /* === G L O B A L S ======================================================= */ -SINFG_LAYER_INIT(Halftone3); -SINFG_LAYER_SET_NAME(Halftone3,"halftone3"); -SINFG_LAYER_SET_LOCAL_NAME(Halftone3,_("Halftone3")); -SINFG_LAYER_SET_CATEGORY(Halftone3,_("Filters")); -SINFG_LAYER_SET_VERSION(Halftone3,"0.0"); -SINFG_LAYER_SET_CVS_ID(Halftone3,"$Id: halftone3.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $"); +SYNFIG_LAYER_INIT(Halftone3); +SYNFIG_LAYER_SET_NAME(Halftone3,"halftone3"); +SYNFIG_LAYER_SET_LOCAL_NAME(Halftone3,_("Halftone 3")); +SYNFIG_LAYER_SET_CATEGORY(Halftone3,_("Filters")); +SYNFIG_LAYER_SET_VERSION(Halftone3,"0.0"); +SYNFIG_LAYER_SET_CVS_ID(Halftone3,"$Id$"); /* === P R O C E D U R E S ================================================= */ @@ -66,14 +67,14 @@ SINFG_LAYER_SET_CVS_ID(Halftone3,"$Id: halftone3.cpp,v 1.1.1.1 2005/01/04 01:23: Halftone3::Halftone3() { - size=(sinfg::Vector(0.25,0.25)); + size=(synfig::Vector(0.25,0.25)); type=TYPE_SYMMETRIC; for(int i=0;i<3;i++) { tone[i].size=size; tone[i].type=type; - tone[i].offset=(sinfg::Point(0,0)); + tone[i].offset=(synfig::Point(0,0)); tone[i].angle=Angle::deg(30.0)*(float)i; } @@ -91,7 +92,7 @@ Halftone3::Halftone3() color[1]=Color::green(); color[2]=Color::blue(); } - + set_blend_method(Color::BLEND_STRAIGHT); for(int i=0;i<3;i++) @@ -109,10 +110,10 @@ Halftone3::sync() tone[i].size=size; tone[i].type=type; } - + #define matrix inverse_matrix //float matrix[3][3]; - + if(subtractive) { for(int i=0;i<3;i++) @@ -153,38 +154,38 @@ Halftone3::sync() } #undef matrix - - + + #if 0 // Insert guass-jordan elimination code here int k=0,i=0,j=0,z_size=3; #define A inverse_matrix - - for (k=0;k(this); } @@ -248,9 +249,9 @@ Halftone3::set_param(const String & param, const ValueBase &value) IMPORT_PLUS(color[0],sync()); IMPORT_PLUS(color[1],sync()); IMPORT_PLUS(color[2],sync()); - + IMPORT_PLUS(subtractive,sync()); - + IMPORT(tone[0].angle); IMPORT(tone[0].offset); @@ -259,8 +260,8 @@ Halftone3::set_param(const String & param, const ValueBase &value) IMPORT(tone[2].angle); IMPORT(tone[2].offset); - - return Layer_Composite::set_param(param,value); + + return Layer_Composite::set_param(param,value); } ValueBase @@ -274,7 +275,7 @@ Halftone3::get_param(const String & param)const EXPORT(color[2]); EXPORT(subtractive); - + EXPORT(tone[0].angle); EXPORT(tone[0].offset); @@ -286,8 +287,8 @@ Halftone3::get_param(const String & param)const EXPORT_NAME(); EXPORT_VERSION(); - - return Layer_Composite::get_param(param); + + return Layer_Composite::get_param(param); } Layer::Vocab @@ -310,11 +311,11 @@ Halftone3::get_param_vocab()const ret.push_back(ParamDesc("subtractive") .set_local_name(_("Subtractive Flag")) ); - + for(int i=0;i<3;i++) { String chan_name(strprintf("Chan%d",i)); - + ret.push_back(ParamDesc(strprintf("color[%d]",i)) .set_local_name(chan_name+_(" Color")) ); @@ -328,7 +329,7 @@ Halftone3::get_param_vocab()const .set_origin(strprintf("tone[%d].offset",i)) ); } - + return ret; } @@ -353,7 +354,7 @@ Halftone3::accelerated_render(Context context,Surface *surface,int quality, cons return false; if(get_amount()==0) return true; - + const Real pw(renddesc.get_pw()),ph(renddesc.get_ph()); const Point tl(renddesc.get_tl()); const int w(surface->get_w()); @@ -363,7 +364,7 @@ Halftone3::accelerated_render(Context context,Surface *surface,int quality, cons Surface::pen pen(surface->begin()); Point pos; int x,y; - + if(is_solid_color()) { for(y=0,pos[1]=tl[1];yamount_complete(10000,10000)) return false;