nr-filter-units.cpp revision a73bc90a4fadf46d159cbb7a3480a93375f14d5d
/*
* Utilities for handling coordinate system transformations in filters
*
* Author:
* Niko Kiirala <niko@kiirala.com>
*
* Copyright (C) 2007 Niko Kiirala
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h>
#include "display/nr-filter-units.h"
#include "libnr/nr-rect-l.h"
#include "sp-filter-units.h"
using Geom::X;
using Geom::Y;
namespace Inkscape {
namespace Filters {
FilterUnits::FilterUnits() :
paraller_axis(false), automatic_resolution(true)
{}
paraller_axis(false), automatic_resolution(true)
{}
}
}
}
filter_area = area;
}
}
}
g_assert(resolution_x > 0);
g_assert(resolution_y > 0);
if (paraller_axis || !automatic_resolution) {
u2pb[1] = 0;
u2pb[2] = 0;
}
return u2pb;
}
/* TODO: make sure that user coordinate system (0,0) is in correct
* place in pixblock coordinates */
return u2pb;
} else if (units == SP_FILTER_UNITS_USERSPACEONUSE) {
return get_matrix_user2pb();
} else {
g_warning("Error in Inkscape::Filters::FilterUnits::get_matrix_units2pb: unrecognized unit type (%d)", units);
}
}
return get_matrix_units2pb(filterUnits);
}
return get_matrix_units2pb(primitiveUnits);
}
d2pb *= get_matrix_user2pb();
return d2pb;
}
return pb2d;
}
/* No need to worry about rotations: bounding box coordinates
* always have base vectors paraller with userspace coordinates */
//return Geom::Translate(min) * Geom::Scale(scale_x,scale_y); ?
0, scale_y,
} else if (units == SP_FILTER_UNITS_USERSPACEONUSE) {
} else {
g_warning("Error in Inkscape::Filters::FilterUnits::get_matrix_user2units: unrecognized unit type (%d)", units);
}
}
return get_matrix_user2units(filterUnits);
}
return get_matrix_user2units(primitiveUnits);
}
return ir;
}
return *this;
}
} /* namespace Filters */
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :