nr-filter-units.h revision 74492c140ec4f83d0e713407c63a05c370e70e4a
#ifndef __NR_FILTER_UNITS_H__
#define __NR_FILTER_UNITS_H__
/*
* 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 "sp-filter-units.h"
#include "libnr/nr-matrix.h"
#include "libnr/nr-rect-l.h"
/* Notes:
* - "filter units" is a coordinate system where the filter region is contained
* between (0,0) and (1,1). Do not confuse this with the filterUnits property
* - "primitive units" is the coordinate system in which all lengths and distances
* in the filter definition should be interpreted. They are affected by the value
* of the primitiveUnits attribute
* - "pb" is the coordinate system in which filter rendering happens.
* It might be aligned with user or screen coordinates depending on
* the filter primitives used in the filter.
* - "display" are world coordinates of the canvas - pixel grid coordinates
* of the drawing area translated so that (0,0) corresponds to the document origin
*/
FilterUnits();
/**
* Sets the current transformation matrix, i.e. transformation matrix
* from object's user coordinates to screen coordinates
*/
/**
* Sets the resolution, the filter should be rendered with.
*/
/**
* Sets the item bounding box in user coordinates
*/
/**
* Sets the filter effects area in user coordinates
*/
/**
* Sets, if x and y axis in pixblock coordinates should be paraller
* to x and y of user coordinates.
*/
void set_paraller(bool const paraller);
/**
* Sets, if filter resolution is automatic.
* NOTE: even if resolution is automatic, it must be set with
* set_resolution. This only tells, if the set value is automatic.
*/
void set_automatic_resolution(bool const automatic);
/**
* Gets the user coordinates to pixblock coordinates transformation matrix.
*/
/**
* Gets the filterUnits to pixblock coordinates transformation matrix.
*/
/**
* Gets the primitiveUnits to pixblock coordinates transformation matrix.
*/
/**
* Gets the display coordinates to pixblock coordinates transformation
* matrix.
*/
/**
* Gets the pixblock coordinates to display coordinates transformation
* matrix
*/
/**
* Gets the user coordinates to filterUnits transformation matrix.
*/
/**
* Gets the user coordinates to primitiveUnits transformation matrix.
*/
/**
* Returns the filter area in pixblock coordinates.
* NOTE: use only in filters, that define TRAIT_PARALLER in
* get_input_traits. The filter effects area may not be representable
* by simple rectangle otherwise. */
double resolution_x, resolution_y;
bool paraller_axis;
bool automatic_resolution;
};
} /* namespace Filters */
} /* namespace Inkscape */
#endif /* __NR_FILTER_UNITS_H__ */
/*
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:encoding=utf-8:textwidth=99 :