X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_filter%2Fhalftone3.cpp;h=3c8443288b6d853cfc23e911b6b0bacf00d9a43f;hb=5f7270118adc2dfb2ee86d869e2de55d91b557e5;hp=d5b40a6e8fd69404582e4ede4d68cb0dc8a642ca;hpb=e8a065f2385c219c511b57dac52786120bfa097d;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 d5b40a6..3c84432 100644 --- a/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp +++ b/synfig-core/trunk/src/modules/mod_filter/halftone3.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file halftone3.cpp -** \brief blehh +** \brief Implementation of the "Halftone 3" layer ** -** $Id: halftone3.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -53,10 +54,10 @@ using namespace etl; SYNFIG_LAYER_INIT(Halftone3); SYNFIG_LAYER_SET_NAME(Halftone3,"halftone3"); -SYNFIG_LAYER_SET_LOCAL_NAME(Halftone3,_("Halftone3")); -SYNFIG_LAYER_SET_CATEGORY(Halftone3,_("Filters")); +SYNFIG_LAYER_SET_LOCAL_NAME(Halftone3,N_("Halftone 3")); +SYNFIG_LAYER_SET_CATEGORY(Halftone3,N_("Filters")); SYNFIG_LAYER_SET_VERSION(Halftone3,"0.0"); -SYNFIG_LAYER_SET_CVS_ID(Halftone3,"$Id: halftone3.cpp,v 1.1.1.1 2005/01/04 01:23:10 darco Exp $"); +SYNFIG_LAYER_SET_CVS_ID(Halftone3,"$Id$"); /* === P R O C E D U R E S ================================================= */ @@ -92,7 +93,7 @@ Halftone3::Halftone3() color[1]=Color::green(); color[2]=Color::blue(); } - + set_blend_method(Color::BLEND_STRAIGHT); for(int i=0;i<3;i++) @@ -110,10 +111,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++) @@ -154,38 +155,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); } @@ -249,9 +250,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); @@ -260,8 +261,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 @@ -275,7 +276,7 @@ Halftone3::get_param(const String & param)const EXPORT(color[2]); EXPORT(subtractive); - + EXPORT(tone[0].angle); EXPORT(tone[0].offset); @@ -287,8 +288,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 @@ -311,11 +312,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")) ); @@ -329,7 +330,7 @@ Halftone3::get_param_vocab()const .set_origin(strprintf("tone[%d].offset",i)) ); } - + return ret; } @@ -354,7 +355,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()); @@ -364,7 +365,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;