From d85f91ce10ec76dda4bf7acdd1fba00a6dc5b1ee Mon Sep 17 00:00:00 2001 From: johanengelen Date: Fri, 5 Dec 2008 21:17:52 +0000 Subject: [PATCH] more 2geomification --- src/dialogs/clonetiler.cpp | 4 ++-- src/display/nr-filter-displacement-map.cpp | 8 ++++---- src/display/nr-filter-gaussian.cpp | 15 +++++++-------- src/display/nr-filter-gaussian.h | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index c7dec8944..950452c87 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -1497,7 +1497,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) // it's hard to figure out exact width/height of the tile without having an object // that we can take bbox of; however here we only need a lower bound so that blur // margins are not too small, and the perimeter should work - SPFilter *constructed = new_filter_gaussian_blur(sp_desktop_document(desktop), radius, NR::expansion(t), NR::expansionX(t), NR::expansionY(t), perimeter, perimeter); + SPFilter *constructed = new_filter_gaussian_blur(sp_desktop_document(desktop), radius, t.descrim(), t.expansionX(), t.expansionY(), perimeter, perimeter); sp_style_set_property_url (clone_object, "filter", SP_OBJECT(constructed), false); } @@ -1512,7 +1512,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) Inkscape::GC::release(clone); } - cur[NR::Y] = 0; + cur[Geom::Y] = 0; } if (dotrace) { diff --git a/src/display/nr-filter-displacement-map.cpp b/src/display/nr-filter-displacement-map.cpp index 886ee118e..f4c29989f 100644 --- a/src/display/nr-filter-displacement-map.cpp +++ b/src/display/nr-filter-displacement-map.cpp @@ -76,10 +76,10 @@ int FilterDisplacementMap::render(FilterSlot &slot, FilterUnits const &units) { int in_w = map->area.x1 - map->area.x0; int in_h = map->area.y1 - map->area.y0; double coordx, coordy; - - Matrix trans = units.get_matrix_primitiveunits2pb(); - double scalex = scale*NR::expansionX(trans); - double scaley = scale*NR::expansionY(trans); + + Geom::Matrix trans = units.get_matrix_primitiveunits2pb(); + double scalex = scale * trans.expansionX(); + double scaley = scale * trans.expansionY(); for (x=0; x < out_w; x++){ for (y=0; y < out_h; y++){ diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp index e5cc35deb..5a425e53a 100644 --- a/src/display/nr-filter-gaussian.cpp +++ b/src/display/nr-filter-gaussian.cpp @@ -33,8 +33,7 @@ #include "display/nr-filter-units.h" #include "libnr/nr-blit.h" #include "libnr/nr-pixblock.h" -#include "libnr/nr-matrix.h" -#include "libnr/nr-matrix-fns.h" +#include <2geom/matrix.h> #include "util/fixed_point.h" #include "preferences.h" @@ -546,7 +545,7 @@ int FilterGaussian::render(FilterSlot &slot, FilterUnits const &units) return 1; } - Matrix trans = units.get_matrix_primitiveunits2pb(); + Geom::Matrix trans = units.get_matrix_primitiveunits2pb(); /* If to either direction, the standard deviation is zero or * input image is not defined, @@ -570,8 +569,8 @@ int FilterGaussian::render(FilterSlot &slot, FilterUnits const &units) // Some common constants Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int const width_org = in->area.x1-in->area.x0, height_org = in->area.y1-in->area.y0; - double const deviation_x_org = _deviation_x * NR::expansionX(trans); - double const deviation_y_org = _deviation_y * NR::expansionY(trans); + double const deviation_x_org = _deviation_x * trans.expansionX(); + double const deviation_y_org = _deviation_y * trans.expansionY(); int const PC = NR_PIXBLOCK_BPP(in); #if HAVE_OPENMP int const NTHREADS = std::max(1,std::min(8,prefs->getInt("/options/threading/numthreads",omp_get_num_procs()))); @@ -818,10 +817,10 @@ int FilterGaussian::render(FilterSlot &slot, FilterUnits const &units) return 0; } -void FilterGaussian::area_enlarge(NRRectL &area, Matrix const &trans) +void FilterGaussian::area_enlarge(NRRectL &area, Geom::Matrix const &trans) { - int area_x = _effect_area_scr(_deviation_x * NR::expansionX(trans)); - int area_y = _effect_area_scr(_deviation_y * NR::expansionY(trans)); + int area_x = _effect_area_scr(_deviation_x * trans.expansionX()); + int area_y = _effect_area_scr(_deviation_y * trans.expansionY()); // maximum is used because rotations can mix up these directions // TODO: calculate a more tight-fitting rendering area int area_max = std::max(area_x, area_y); diff --git a/src/display/nr-filter-gaussian.h b/src/display/nr-filter-gaussian.h index 3ff3e3d22..1242a0961 100644 --- a/src/display/nr-filter-gaussian.h +++ b/src/display/nr-filter-gaussian.h @@ -18,7 +18,7 @@ #include "display/nr-filter-slot.h" #include "display/nr-filter-units.h" #include "libnr/nr-pixblock.h" -#include "libnr/nr-matrix.h" +#include <2geom/forward.h> #include "libnr/nr-rect-l.h" enum { @@ -38,7 +38,7 @@ public: virtual ~FilterGaussian(); virtual int render(FilterSlot &slot, FilterUnits const &units); - virtual void area_enlarge(NRRectL &area, Matrix const &m); + virtual void area_enlarge(NRRectL &area, Geom::Matrix const &m); virtual FilterTraits get_input_traits(); /** -- 2.30.2