46using namespace vigra ;
49int main (
int argc ,
char * argv[] )
53 vigra::MultiArray < 2 , float > a ( 10 , 20 ) ;
77 eval_type ev ( bspl ) ;
87 ev.eval ( coordinate , result ) ;
89 auto r = ev ( coordinate ) ;
91 assert ( r == result ) ;
95 vigra::MultiArray < 1 , coordinate_type > coordinate_array ( 3 ) ;
99 coordinate_array[0] = coordinate_array[1] = coordinate_array[2] = coordinate ;
103 vigra::MultiArray < 1 , float > target_array ( 3 ) ;
109 auto ic = coordinate_array.begin() ;
110 for (
auto k : target_array )
111 assert ( k == ev ( *(ic++) ) ) ;
120 vigra::MultiArray < 2 , float > target_array_2d ( 3 , 4 ) ;
127 for (
int x = 0 ; x < 3 ; x ++ )
129 for ( y = 0 ; y < 4 ; y++ )
132 assert ( target_array_2d [ c ] == ev ( c ) ) ;
136 vigra::MultiArray < 2 , float > b ( 10 , 20 ) ;
139 auto ia = a.begin() ;
141 assert ( vigra::closeAtTolerance ( *(ia++) , r , .00001 ) ) ;
143 vigra::MultiArray < 2 , float > c ( 10 , 20 ) ;
146 auto ib = b.begin() ;
147 for (
auto & ic : c )
148 assert ( vigra::closeAtTolerance ( *(ib++) , ic , .00001 ) ) ;
vigra::TinyVector< float, 2 > coordinate_type
vspline::bspline< pixel_type, 2 > spline_type
void transform(const unary_functor_type &functor, const vigra::MultiArrayView< dimension, typename unary_functor_type::in_type > &input, vigra::MultiArrayView< dimension, typename unary_functor_type::out_type > &output, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0)
implementation of two-array transform using wielding::coupled_wield.
void restore(const vspline::bspline< value_type, dimension > &bspl, vigra::MultiArrayView< dimension, value_type > &target)
restore restores the original data from the b-spline coefficients. This is done efficiently using a s...
void remap(const vigra::MultiArrayView< cf_dimension, original_type > &input, const vigra::MultiArrayView< trg_dimension, coordinate_type > &coordinates, vigra::MultiArrayView< trg_dimension, result_type > &output, bcv_type< bcv_dimension > bcv=bcv_type< bcv_dimension >(MIRROR), int degree=3, int njobs=vspline::default_njobs, vspline::atomic< bool > *p_cancel=0)
Implementation of 'classic' remap, which directly takes an array of values and remaps it,...
int main(int argc, char *argv[])
class bspline now builds on class bspline_base, adding coefficient storage, while bspline_base provid...
void prefilter(vspline::xlf_type boost=vspline::xlf_type(1), int njobs=vspline::default_njobs)
prefilter converts the knot point data in the 'core' area into b-spline coefficients....
includes all headers from vspline (most of them indirectly)