class domain is a coordinate transformation functor. It provides a handy way to translate an arbitrary range of incoming coordinates to an arbitrary range of outgoing coordinates. This is done with a linear translation function. if the source range is [s0,s1] and the target range is [t0,t1], the translation function s->t is:
More...
|
typedef vspline::unary_functor< coordinate_type, coordinate_type, _vsize > | base_type |
|
typedef base_type::in_ele_type | rc_type |
|
typedef base_type::in_nd_ele_type | nd_rc_type |
|
typedef vigra::TinyVector< rc_type, dim_in > | limit_type |
|
enum | |
|
enum | |
|
enum | |
|
typedef coordinate_type | in_type |
|
typedef coordinate_type | out_type |
|
typedef vspline::vector_traits< coordinate_type >::ele_type | in_ele_type |
|
typedef vspline::vector_traits< coordinate_type >::ele_type | out_ele_type |
|
typedef vigra::TinyVector< in_ele_type, dim_in > | in_nd_ele_type |
|
typedef vigra::TinyVector< out_ele_type, dim_out > | out_nd_ele_type |
|
typedef vector_traits< coordinate_type, vsize >::ele_v | in_ele_v |
| a simdized type of the elementary type of result_type, which is used for coefficients and results. this is fixed via the traits class vector_traits (in vector.h). Note how we derive this type using vsize from the template argument, not what vspline::vector_traits deems appropriate for ele_type - though both numbers will be the same in most cases. More...
|
|
typedef vector_traits< coordinate_type, vsize >::ele_v | out_ele_v |
|
typedef vector_traits< coordinate_type, vsize >::nd_ele_v | in_nd_ele_v |
|
typedef vector_traits< coordinate_type, vsize >::nd_ele_v | out_nd_ele_v |
|
typedef vector_traits< coordinate_type, vsize >::type | in_v |
| vectorized in_type and out_type. vspline::vector_traits supplies these types so that multidimensional/multichannel data come as vigra::TinyVectors, while 'singular' data won't be made into TinyVectors of one element. More...
|
|
typedef vector_traits< coordinate_type, vsize >::type | out_v |
|
typedef vector_traits< int, vsize >::ele_v | ic_v |
| vsize wide vector of ints, used for gather/scatter indexes More...
|
|
typedef vector_traits< coordinate_type, vsize >::type | cl_in_v |
|
typedef vector_traits< coordinate_type, vsize >::type | cl_out_v |
|
|
| domain_type (const coordinate_type &_in_low, const coordinate_type &_in_high, const coordinate_type &_out_low, const coordinate_type &_out_high) |
| constructor taking the lower and upper fix points for incoming and outgoing values. If coordinate_type is fundamental, assigning to the limit_type members produces the desired TinyVectors of one fundamental. More...
|
|
template<class bspl_type > |
| domain_type (const bspl_type &bspl, const coordinate_type &_out_low, const coordinate_type &_out_high) |
| constructor taking the fix points for outgoing values from a bspline object, and the incoming lower and upper fix points explicitly More...
|
|
template<class bspl_type > |
| domain_type (const coordinate_type &_in_low, const coordinate_type &_in_high, const bspl_type &bspl) |
|
template<class bspl_type_1 , class bspl_type_2 > |
| domain_type (const bspl_type_1 &bspl_in, const bspl_type_2 &bspl_out) |
|
void | eval (const in_type &in, out_type &out) const |
| eval for unvectorized data. we dispatch on in_type, the incoming coordinate, being a 'naked' fundamental or a TinyVector More...
|
|
void | eval (const in_type &in, out_type &out, std::true_type) const |
| eval dispatch for fundamental, 1D coordinates More...
|
|
void | eval (const in_type &in, out_type &out, std::false_type) const |
| eval dispatch for TinyVectors of fundamentals More...
|
|
template<class crd_type > |
void | eval (const crd_type &in, crd_type &out) const |
| eval for vectorized data. if in_type is a 'naked' fundamental, crd_type is a 'naked' ele_v, otherwise it's a TinyVector of ele_v. So we dispatch: More...
|
|
template<typename = std::enable_if < ( vsize > 1 ) >> |
void | eval (const in_v &in, out_v &out, std::true_type) const |
| eval dispatch for vectorized coordinates, 1D case More...
|
|
template<typename = std::enable_if < ( vsize > 1 ) >> |
void | eval (const in_v &in, out_v &out, std::false_type) const |
| eval dispatch for vectorized coordinates, nD case. This iterates over the dimensions and performs the 1D operation for each component. More...
|
|
coordinate_type | operator() (const coordinate_type &in) const |
|
coordinate_type | operator() (const coordinate_type &in) |
|
cl_out_v | operator() (const cl_in_v &in) const |
|
cl_out_v | operator() (const cl_in_v &in) |
|
template<typename
coordinate_type, size_t _vsize = vspline::vector_traits<coordinate_type>::vsize>
struct vspline::domain_type< coordinate_type, _vsize >
class domain is a coordinate transformation functor. It provides a handy way to translate an arbitrary range of incoming coordinates to an arbitrary range of outgoing coordinates. This is done with a linear translation function. if the source range is [s0,s1] and the target range is [t0,t1], the translation function s->t is:
t = ( s - s0 ) * ( t1 - t0 ) / ( s1 - s0 ) + t0
In words: the target coordinate's distance from the target range's lower bound is proportional to the source coordinate's distance from the source range's lower bound. Note that this is not a gate function: the domain will accept any incoming value and perform the shift/scale operation on it; incoming values outside [ in_low , in_high ] will produce outgoing values outside [ out_low , out_high ].
The first constructor takes s0, s1, t0 and t1. With this functor, arbitrary mappings of the form given above can be achieved. The second constructor takes a vspline::bspline object to obtain t0 and t1. These are taken as the spline's 'true' range, depending on it's boundary conditions: for periodic splines, this is [0...M], for REFLECT Bcs it's [-0.5,M-0,5], and for 'normal' splines it's [0,M-1]. s0 and s1, the start and end of the domain's coordinate range, can be passed in and default to 0 and 1, which constitutes 'normalized' spline coordinates, where 0 is mapped to the lower end of the 'true' range and 1 to the upper.
class domain is especially useful for situations where several b-splines cover the same data in different resolution, like in image pyramids. If these different splines are all evaluated with a domain chained to the evaluator which uses a common domain range, they can all be accessed with identical coordinates, even if the spline shapes don't match isotropically. Note, though, that domain objects created with b-splines with REFLECT or PERIODIC boundary conditions won't match unless the splines have the same size because the spline's bounds won't coincide for differently sized splines. You may want to create the domain object from coordinate values in this case.
The evaluation routine in class domain_type makes sure that incoming values in [ in_low , in_high ] will never produce outgoing values outside [ out_low , out_high ]. If this guarantee is not needed, the 'raw' evaluation routine _eval can be used instead. with _eval, output may overshoot out_high slightly.
I should mention libeinspline here, which has this facility as a fixed feature in it's spline types. I decided to keep it separate and create class domain instead for those cases where the functionality is needed.
Definition at line 138 of file domain.h.