127#ifndef VSPLINE_EVAL_H
128#define VSPLINE_EVAL_H
142 template<
typename T, T... Ints>
146 static constexpr std::size_t
size() {
return sizeof...(Ints); }
149 template<std::size_t... Ints>
152 template<
typename T, std::size_t N, T... Is>
155 template<
typename T, T... Is>
158 template<std::
size_t N>
161 template<
typename... T>
180template <
typename _delta_et ,
181 typename _target_et = _delta_et ,
196 typedef std::function
207 typedef std::function
230 template <
class grokkee_type >
233 { grokkee ( p_trg , delta ) ; } ) ,
235 { grokkee ( p_trg , delta ) ; } )
243 e_eval ( p_trg , delta ) ;
248 v_eval ( p_trg , delta ) ;
255template <
typename _grokkee_t ,
256 typename _delta_et = float ,
257 typename _target_et = _delta_et ,
260bf_grok_type < _delta_et , _target_et , _vsize >
304template <
typename bf_type ,
int ndim >
306:
public std::array < bf_type , ndim >
316 template < std::size_t ... indices ,
typename ... targs >
321 { ( indices ,
bf_type ( _degree , args ... ) ) ... } ,
327 template <
typename ... targs >
333 using base_type::base_type ;
341template <
typename bf_type >
366template <
int ndim ,
typename math_type >
368:
public std::array < vspline::basis_functor < math_type > , ndim >
372 template < std::size_t ... indices >
374 const vigra::TinyVector < int , ndim > & _dspec ,
376 : std::array < vspline::basis_functor < math_type > , ndim >
378 ( _degree , _dspec [ indices ] ) ... }
384 const vigra::TinyVector < int , ndim > & _dspec )
485template <
typename _ic_ele_type ,
486 typename _rc_ele_type ,
487 typename _ofs_ele_type ,
489 typename _cf_ele_type ,
490 typename _math_ele_type ,
491 typename _trg_ele_type ,
493 unsigned int _dimension ,
494 unsigned int _channels ,
503 static_assert ( std::is_floating_point < _math_ele_type > :: value ,
504 "class evaluator requires a floating point math_ele_type" ) ;
528 typedef vigra::TinyVector < ic_ele_type , dimension >
ic_type ;
529 typedef vigra::TinyVector < rc_ele_type , dimension >
rc_type ;
532 typedef vigra::TinyVector < cf_ele_type , channels >
cf_type ;
533 typedef vigra::TinyVector < math_ele_type , channels >
math_type ;
534 typedef vigra::TinyVector < trg_ele_type , channels >
trg_type ;
536 typedef vigra::TinyVector < std::ptrdiff_t , dimension >
shape_type ;
542 typedef typename vigra::MultiArrayView < 1 , const cf_ele_type * > :: const_iterator
543 cf_pointer_iterator ;
549 const bool even_spline_degree ;
564 vigra::MultiArray < 1 , std::ptrdiff_t > cf_offsets ;
565 vigra::MultiArray < 1 , const cf_ele_type * > cf_pointers ;
591 template <
class IT ,
class RT >
592 void split (
const RT& input , IT& select , RT& tune )
const
594 if ( even_spline_degree )
638 : cf_ebase ( _cf_ebase ) ,
639 cf_estride ( _cf_estride ) ,
642 even_spline_degree ( ! ( _spline_degree & 1 ) ) ,
675 vigra::MultiCoordinateIterator<dimension> mci ( window_shape ) ;
702 cf_pointers = vigra::MultiArray < 1 , const cf_ele_type * > (
window_size ) ;
703 cf_offsets = vigra::MultiArray < 1 , std::ptrdiff_t > (
window_size ) ;
705 auto ofs_target = cf_offsets.begin() ;
706 auto target = cf_pointers.begin() ;
723 std::ptrdiff_t offset = sum ( ( *mci -
spline_degree / 2 ) * cf_estride ) ;
724 *ofs_target = offset ;
725 *target = cf_ebase + offset ;
752 template <
typename nd_rc_type ,
typename weight_type >
754 const nd_rc_type & c )
const
756 auto ci = c.cbegin() ;
757 for (
int axis = 0 ; axis <
dimension ; ++ci , ++axis )
761 template <
typename weight_type >
764 for (
int axis = 0 ; axis <
dimension ; ++axis )
770 template <
typename rc_type ,
typename weight_type >
775 wgt[axis] ( p_weight , c ) ;
778 template <
typename weight_type >
780 const int & axis )
const
782 wgt[axis] ( p_weight ) ;
813 template <
typename T ,
int N >
814 static inline void load ( vigra::TinyVector < T , N > & target ,
818 for (
int i = 0 ; i < N ; i++ )
819 target[i] = T ( mem [ index + i ] ) ;
834 template <
typename target_t ,
typename index_t >
835 static void load ( target_t & target ,
837 const index_t & indexes ,
841 static const size_t sz = index_t::size() ;
842 for (
int e = 0 ; e < target_t::static_size ; e++ )
845 target[e].gather ( mem + e , indexes ) ;
849 template <
typename target_t ,
typename index_t >
850 static void load ( target_t & target ,
852 const index_t & indexes ,
856 static const size_t sz = index_t::size() ;
858 for (
int e = 0 ; e < target_t::static_size ; e++ )
862 help.gather ( mem + e , indexes ) ;
870 template <
typename target_t ,
typename index_t >
871 static void inline load
872 ( target_t & target ,
874 const index_t & indexes )
876 typedef typename target_t::value_type::value_type target_ele_type ;
878 load ( target , mem , indexes ,
879 std::integral_constant
881 std::is_same < cf_ele_type , target_ele_type > :: value
898 template <
int level ,
class math1_type ,
class offset_type >
902 void operator() (
const offset_type & locus ,
903 cf_pointer_iterator & cfp_iter ,
904 const vigra::MultiArrayView < 2 , math1_type > & weight ,
905 vigra::TinyVector < math1_type , channels > & sum
908 const math1_type w ( weight ( 0 ,
level ) ) ;
913 _eval <
level - 1 , math1_type , offset_type >()
914 ( locus , cfp_iter , weight , sum ) ;
916 for (
int d = 0 ; d <
channels ; d++ )
921 vigra::TinyVector < math1_type , channels > subsum ;
927 for (
int i = 1 ; i < weight.shape ( 0 ) ; i++ )
929 const math1_type w ( weight ( i ,
level ) ) ;
931 _eval <
level - 1 , math1_type , offset_type >()
932 ( locus , cfp_iter , weight , subsum ) ;
937 for (
int d = 0 ; d <
channels ; d++ )
938 sum[d] = fma ( subsum[d] , w , sum[d] ) ;
940 for (
int d = 0 ; d <
channels ; d++ )
973 template <
class math1_type ,
class offset_type >
974 struct _eval < 0 , math1_type , offset_type >
977 void operator() (
const offset_type & locus ,
978 cf_pointer_iterator & cfp_iter ,
979 const vigra::MultiArrayView < 2 , math1_type > & weight ,
980 vigra::TinyVector < math1_type , channels > & sum
983 typedef vigra::TinyVector < math1_type , channels >
math_type ;
985 const math1_type w ( weight ( 0 , 0 ) ) ;
991 load ( sum , *cfp_iter , locus ) ;
993 for (
int d = 0 ; d <
channels ; d++ )
1001 for (
int i = 1 ; i < weight.shape ( 0 ) ; i++ )
1003 const math1_type w ( weight ( i , 0 ) ) ;
1006 load ( help , *cfp_iter , locus ) ;
1012 for (
int d = 0 ; d <
channels ; d++ )
1013 sum[d] = fma ( help[d] , w , sum[d] ) ;
1015 for (
int d = 0 ; d <
channels ; d++ )
1031 template <
int level ,
class math1_type ,
class offset_type >
1035 void operator() (
const offset_type& locus ,
1036 cf_pointer_iterator & cfp_iter ,
1037 const vigra::TinyVector < math1_type , dimension > & tune ,
1038 vigra::TinyVector < math1_type , channels > & sum
1041 const math1_type wl ( math1_type(1) - tune [
level ] ) ;
1042 const math1_type wr ( tune [
level ] ) ;
1044 _eval_linear <
level - 1 , math1_type , offset_type >()
1045 ( locus , cfp_iter , tune , sum ) ;
1047 for (
int d = 0 ; d <
channels ; d++ )
1050 vigra::TinyVector < math1_type , channels > subsum ;
1052 _eval_linear <
level - 1 , math1_type , offset_type >()
1053 ( locus , cfp_iter , tune , subsum ) ;
1058 for (
int d = 0 ; d <
channels ; d++ )
1059 sum[d] = fma ( subsum[d] , wr , sum[d] ) ;
1061 for (
int d = 0 ; d <
channels ; d++ )
1072 template <
class math1_type ,
class offset_type >
1073 struct _eval_linear < 0 , math1_type , offset_type >
1076 void operator() (
const offset_type & locus ,
1077 cf_pointer_iterator & cfp_iter ,
1078 const vigra::TinyVector < math1_type , dimension > & tune ,
1079 vigra::TinyVector < math1_type , channels > & sum
1082 const math1_type wl ( math1_type(1) - tune [ 0 ] ) ;
1083 const math1_type wr ( tune [ 0 ] ) ;
1085 load ( sum , *cfp_iter , locus ) ;
1088 for (
int d = 0 ; d <
channels ; d++ )
1091 vigra::TinyVector < math1_type , channels > help ;
1093 load ( help , *cfp_iter , locus ) ;
1099 for (
int d = 0 ; d <
channels ; d++ )
1100 sum[d] = fma ( help[d] , wr , sum[d] ) ;
1102 for (
int d = 0 ; d <
channels ; d++ )
1125 template <
class result_type ,
class math1_type ,
class offset_type >
1127 void eval (
const offset_type& select ,
1128 const vigra::MultiArrayView < 2 , math1_type > & weight ,
1129 result_type & result
1135 cf_pointer_iterator cfp_iter = cf_pointers.begin() ;
1140 typedef vigra::TinyVector < math1_type , channels >
math_type ;
1143 _eval < level , math1_type , offset_type >()
1144 ( select , cfp_iter , weight , _result ) ;
1176 template <
class result_type ,
class math1_type ,
class offset_type >
1178 void eval (
const offset_type& select ,
1179 const vigra::TinyVector < math1_type , dimension > & tune ,
1180 result_type & result ,
1181 std::integral_constant < int , 0 >
1184 load ( result , cf_ebase , select ) ;
1193 template <
class result_type ,
class math1_type ,
class offset_type >
1195 void eval (
const offset_type & select ,
1196 const vigra::TinyVector < math1_type , dimension > & tune ,
1197 result_type & result ,
1198 std::integral_constant < int , 1 > )
const
1200 cf_pointer_iterator cfp_iter = cf_pointers.begin() ;
1201 typedef vigra::TinyVector < math1_type , channels >
math_type ;
1205 _eval_linear < level , math1_type , offset_type >()
1206 ( select , cfp_iter , tune , _result ) ;
1218 template <
class result_type ,
1221 int arbitrary_spline_degree >
1223 void eval (
const offset_type& select ,
1224 const vigra::TinyVector < math1_type , dimension > & tune ,
1225 result_type & result ,
1226 std::integral_constant < int , arbitrary_spline_degree > )
const
1243 vigra::MultiArray < 2 , math1_type , allocator_t > weight
1251 eval ( select , weight , result ) ;
1292 template <
template <
typename ,
int >
class bunch ,
1293 template <
typename ,
size_t >
class vector ,
1306 typedef vector < ic_ele_type , vsize > ic_ele_v ;
1307 typedef vector < rc_ele_type , vsize > rc_ele_v ;
1308 typedef vector < math_ele_type , vsize > math_ele_v ;
1309 typedef vector < ofs_ele_type , vsize > ofs_ele_v ;
1310 typedef vector < trg_ele_type , vsize > trg_ele_v ;
1314 bunch < ic_ele_v , dimension > select ;
1315 bunch < rc_ele_v , dimension > _tune ;
1317 split ( coordinate , select , _tune ) ;
1321 bunch < math_ele_v , dimension > tune ;
1326 ofs_ele_v origin = select[0] *
ic_ele_type ( cf_estride [ 0 ] ) ;
1328 origin += select[d] *
ic_ele_type ( cf_estride [ d ] ) ;
1332 eval ( origin , tune , result ,
1333 std::integral_constant < int , specialize > () ) ;
1343 template <
template <
typename ,
int >
class bunch ,
1344 template <
typename ,
size_t >
class vector ,
1354 typedef vector < math_ele_type , vsize > math_ele_v ;
1359 vigra::MultiArray < 2 , math_ele_v , allocator_t > weight
1364 typedef vector < ofs_ele_type , vsize > ofs_ele_v ;
1366 ofs_ele_v origin = select[0] *
ic_ele_type ( cf_estride [ 0 ] ) ;
1368 origin += select[d] *
ic_ele_type ( cf_estride [ d ] ) ;
1370 eval ( origin , weight , result ) ;
1380 template <
template <
typename ,
int >
class bunch ,
1381 template <
typename ,
size_t >
class vector ,
1391 typedef vector < ofs_ele_type , vsize > ofs_ele_v ;
1395 ofs_ele_v origin = select[0] *
ic_ele_type ( cf_estride [ 0 ] ) ;
1397 origin += select[d] *
ic_ele_type ( cf_estride [ d ] ) ;
1401 load ( result , cf_ebase , origin ) ;
1408 template <
template <
typename ,
int >
class bunch ,
1409 template <
typename ,
size_t >
class vector ,
1421 ieval < bunch , vector , vsize > ( select , result ,
1422 std::integral_constant < bool , just_load > () ) ;
1427 template <
template <
typename ,
int >
class bunch ,
1428 template <
typename ,
size_t >
class vector ,
1440 static const bool take_discrete_coordinates
1441 = std::is_integral < rc_ele_type > :: value ;
1443 eval < bunch , vector , vsize > ( select , result ,
1444 std::integral_constant < bool , take_discrete_coordinates > () ) ;
1464typename vigra::NumericTraits
1465 <
typename vigra::PromoteTraits
1466 <
typename vigra::ExpandElementResult < coordinate_type > :: type ,
1467 typename vigra::ExpandElementResult < value_type > :: type
1695template <
typename _coordinate_type ,
1696 typename _trg_type ,
1698 int _specialize = -1 ,
1699 typename _math_ele_type
1701 typename _cf_type = _trg_type ,
1704 vigra::ExpandElementResult
1705 < _coordinate_type > :: size
1710 public unary_functor < _coordinate_type , _trg_type , _vsize > ,
1712 < evaluator < _coordinate_type , _trg_type , _vsize ,
1713 _specialize , _math_ele_type , _cf_type , _mbf_type > ,
1790 template <
template <
typename ,
int >
class bunch ,
1791 template <
typename ,
size_t >
class vector ,
1796 void feed (
const in_type & _coordinate ,
1799 typedef bunch < vector < rc_ele_type , VSZ > ,
dimension > rc_t ;
1801 typedef bunch < vector < trg_ele_type , VSZ > ,
channels > trg_t ;
1803 auto const & coordinate
1804 =
reinterpret_cast < rc_t
const &
>
1808 =
reinterpret_cast < trg_t &
>
1811 inner.template eval < bunch , vector , VSZ >
1812 ( coordinate , result ) ;
1825 feed < vigra::TinyVector , vspline::scalar , 1 >
1826 ( _coordinate , _result ) ;
1835 template <
typename = std::enable_if < ( vsize > 1 ) > >
1840 feed < vigra::TinyVector , vspline::simdized_type , vsize >
1841 ( _coordinate , _result ) ;
1844 typedef vigra::TinyVector < std::ptrdiff_t , dimension >
shape_type ;
1864 :
inner ( cf_ebase ,
1867 mbf_type ( spline_degree , derivative )
1879 :
inner ( cf_ebase ,
1907 bspl.spline_degree + shift ,
1918 (
"insufficient frame size. the requested shift can not be performed." ) ;
1930 bspl.spline_degree + shift ,
1941 (
"insufficient frame size. the requested shift can not be performed." ) ;
1952template <
typename _coordinate_type ,
1953 typename _trg_type ,
1954 typename _mbf_type ,
1956 typename _math_ele_type
1957 = default_math_type < _coordinate_type , _trg_type > ,
1958 typename _cf_type = _trg_type
2003 typename math_ele_type ,
2004 typename result_type
2012 vigra::TinyVector<int,spline_type::dimension> dspec
2013 = vigra::TinyVector<int,spline_type::dimension> ( 0 ) ,
2023 < crd_t , result_type , _vsize , 0 ,
2024 math_ele_type , value_type >
2025 ( bspl , dspec , shift )
2030 < crd_t , result_type , _vsize , 1 ,
2031 math_ele_type , value_type >
2032 ( bspl , dspec , shift )
2037 < crd_t , result_type , _vsize , -1 ,
2038 math_ele_type , value_type >
2039 ( bspl , dspec , shift )
2073template <
int level ,
2077 typename math_ele_type ,
2078 typename result_type ,
2079 class ... gate_types >
2086 gate_types ... gates ,
2087 vigra::TinyVector<int,spline_type::dimension> dspec
2088 = vigra::TinyVector<int,spline_type::dimension> ( 0 ) ,
2104 auto bc = bspl.
bcv [ level ] ;
2106 if ( bspl.
core.shape ( level ) == 1 )
2109 lower = upper =
rc_type ( 0 ) ;
2116 auto gt = vspline::periodic < rc_type , _vsize >
2119 math_ele_type , result_type ,
2120 decltype ( gt ) , gate_types ... >()
2121 ( bspl , gt , gates ... , dspec , shift ) ;
2127 auto gt = vspline::mirror < rc_type , _vsize >
2130 math_ele_type , result_type ,
2131 decltype ( gt ) , gate_types ... >()
2132 ( bspl , gt , gates ... , dspec , shift ) ;
2137 auto gt = vspline::clamp < rc_type , _vsize >
2138 ( lower , upper , lower , upper ) ;
2140 math_ele_type , result_type ,
2141 decltype ( gt ) , gate_types ... >()
2142 ( bspl , gt , gates ... , dspec , shift ) ;
2158 typename math_ele_type ,
2159 typename result_type ,
2160 class ... gate_types >
2162 math_ele_type , result_type , gate_types ... >
2168 gate_types ... gates ,
2169 vigra::TinyVector<int,spline_type::dimension> dspec
2170 = vigra::TinyVector<int,spline_type::dimension> ( 0 ) ,
2180 < crd_t , _vsize , gate_types... > ( gates ... )
2182 < crd_t , result_type , _vsize , 0 ,
2183 math_ele_type , value_type >
2184 ( bspl , dspec , shift )
2189 < crd_t , _vsize , gate_types... > ( gates ... )
2191 < crd_t , result_type , _vsize , 1 ,
2192 math_ele_type , value_type >
2193 ( bspl , dspec , shift )
2198 < crd_t , _vsize , gate_types... > ( gates ... )
2200 < crd_t , result_type , _vsize , -1 ,
2201 math_ele_type , value_type >
2202 ( bspl , dspec , shift )
2281 vigra::NumericTraits
2285 typename math_ele_type
2293 vigra::TinyVector<int,spline_type::dimension> dspec
2294 = vigra::TinyVector<int,spline_type::dimension> ( 0 ) ,
2299 typedef typename vigra::ExpandElementResult < value_type > :: type ele_type ;
2300 enum {
vsize = _vsize } ;
2302 math_ele_type , result_type >()
2303 ( bspl , dspec , shift ) ;
2378 vigra::NumericTraits
2382 typename math_ele_type
2391 vigra::TinyVector<int,spline_type::dimension> dspec
2392 = vigra::TinyVector<int,spline_type::dimension> ( 0 ) ,
2397 typedef typename vigra::ExpandElementResult < value_type > :: type ele_type ;
2398 enum {
vsize = _vsize } ;
2404 result_type >() ( bspl , dspec , shift ) ;
Code to calculate the value of the B-spline basis function and it's derivatives.
vspline::basis_functor< long double > bf_type
basis_sample.cc - access to the b-spline basis functions
vigra::TinyVector< float, 2 > coordinate_type
vspline::bspline< pixel_type, 2 > spline_type
class evaluator encodes evaluation of a spline-like object. This is a generalization of b-spline eval...
evaluator(const cf_ele_type *const cf_ebase, const shape_type &cf_estride, int spline_degree, const mbf_type &mbf)
This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions.
ET< coordinate_type > rc_ele_type
void eval(const typename base_type::in_v &_coordinate, typename base_type::out_v &_result) const
vectorized evaluation function. This is enabled only if vsize > 1 to guard against cases where vsize ...
_math_ele_type math_ele_type
detail::inner_evaluator< ic_ele_type, rc_ele_type, ofs_ele_type, cf_ele_type, math_ele_type, trg_ele_type, dimension, channels, specialize, mbf_type > inner_type
evaluator(const cf_ele_type *const cf_ebase, const shape_type &cf_estride, int spline_degree, derivative_spec_type derivative=derivative_spec_type(0))
class evaluator's constructors are used to initialize 'inner'. This first constructor overload will r...
_coordinate_type coordinate_type
ET< trg_type > trg_ele_type
evaluator(const vspline::bspline< cf_type, dimension > &bspl, derivative_spec_type derivative=derivative_spec_type(0), int shift=0)
constructor taking a vspline::bspline object, and, optionally, a specification for derivatives of the...
vigra::TinyVector< std::ptrdiff_t, dimension > shape_type
unary_functor< coordinate_type, trg_type, vsize > base_type
vigra::TinyVector< int, dimension > derivative_spec_type
evaluator(const vspline::bspline< cf_type, dimension > &bspl, const mbf_type &mbf, int shift=0)
This c'tor overload takes a const reference to a multi_bf_type object providing the basis functions.
ET< cf_type > cf_ele_type
void eval(const typename base_type::in_type &_coordinate, typename base_type::out_type &_result) const
unvectorized evaluation function. this is delegated to 'feed' above, which reinterprets the arguments...
code to handle out-of-bounds coordinates.
make_integer_sequence< std::size_t, N > make_index_sequence
void odd_split(rc_t v, ic_t &iv, rc_t &fv)
coordinates are split into an integral part and a remainder. this is used for weight generation,...
void assign(T &t, const U &u)
typename vigra::ExpandElementResult< T > ::type ET
using definition for the 'elementary type' of a type via vigra's ExpandElementResult mechanism....
vspline::grok_type< typename grokkee_type::in_type, typename grokkee_type::out_type, grokkee_type::vsize > grok(const grokkee_type &grokkee)
grok() is the corresponding factory function, wrapping grokkee in a vspline::grok_type.
vspline::grok_type< bspl_coordinate_type< spline_type, rc_type >, result_type, _vsize > make_evaluator(const spline_type &bspl, vigra::TinyVector< int, spline_type::dimension > dspec=vigra::TinyVector< int, spline_type::dimension >(0), int shift=0)
make_evaluator is a factory function, producing a functor which provides access to an evaluator objec...
typename vigra::NumericTraits< typename vigra::PromoteTraits< typename vigra::ExpandElementResult< coordinate_type > ::type, typename vigra::ExpandElementResult< value_type > ::type > ::Promote > ::RealPromote default_math_type
vspline::canonical_type< rc_type, spline_type::dimension > bspl_coordinate_type
using declaration for a coordinate suitable for bspline, given elementary type rc_type....
bf_grok_type< _delta_et, _target_et, _vsize > bf_grok(const _grokkee_t &grokkee)
vspline::map_functor< nd_rc_type, _vsize, gate_types... > mapper(gate_types ... args)
factory function to create a mapper type functor given a set of gate_type objects....
typename vector_traits< T, N > ::type simdized_type
this alias is used as a shorthand to pick the vectorized type for a given type T and a size N from 'v...
vspline::grok_type< bspl_coordinate_type< spline_type, rc_type >, result_type, _vsize > make_safe_evaluator(const spline_type &bspl, vigra::TinyVector< int, spline_type::dimension > dspec=vigra::TinyVector< int, spline_type::dimension >(0), int shift=0)
make_safe_evaluator is a factory function, producing a functor which provides safe access to an evalu...
void even_split(rc_t v, ic_t &iv, rc_t &fv)
for even splines, the integral part is obtained by rounding. when the result of rounding is subtracte...
typename spline_type::value_type bspl_value_type
using declaration for a bspline's value type
void bunch(const vigra::TinyVector< ele_type, chn > *const &src, vigra::TinyVector< vspline::vc_simd_type< ele_type, vsz >, chn > &trg, const ic_type &stride)
bunch picks up data from interleaved, strided memory and stores them in a data type representing a pa...
grokkee_type is a vspline::unary_functor returning twice it's input
static constexpr std::size_t size()
vspline creates vigra::MultiArrays of vectorized types. As long as the vectorized types are Vc::SimdA...
basis_functor is an object producing the b-spline basis function value for given arguments,...
If there are several differently-typed basis functors to be combined in a multi_bf_type object,...
vspline::simdized_type< delta_et, vsize > delta_vt
static const std::size_t degree
bf_grok_type(const e_eval_t &_e_eval, const v_eval_t &_v_eval)
void operator()(target_et *p_trg, const delta_et &delta) const
std::function< void(target_et *, const delta_et &) > e_eval_t
bf_grok_type(const grokkee_type &grokkee)
std::function< void(target_vt *, const delta_vt &) > v_eval_t
vspline::simdized_type< target_et, vsize > target_vt
tag class used to identify all vspline::evaluator instantiations
class bspline now builds on class bspline_base, adding coefficient storage, while bspline_base provid...
ExpandElementResult< value_type >::type ele_type
elementary type of value_type, like float or double
static xlf_type lower_limit(const bc_code &bc)
lower_limit returns the lower bound of the spline's defined range. This is usually 0....
static xlf_type upper_limit(const std::size_t &extent, const bc_code &bc)
upper_limit returns the upper bound of the spline's defined range. This is normally M - 1 if the shap...
bool shiftable(int d) const
'shift' will change the interpretation of the data in a bspline object. d is taken as a difference to...
mixin 'callable' is used with CRTP: it serves as additional base to unary functors which are meant to...
helper object to create a type-erased vspline::evaluator for a given bspline object....
vspline::grok_type< bspl_coordinate_type< spline_type, rc_type >, result_type, _vsize > operator()(const spline_type &bspl, vigra::TinyVector< int, spline_type::dimension > dspec=vigra::TinyVector< int, spline_type::dimension >(0), int shift=0)
helper object to create a vspline::mapper object with gate types matching a bspline's boundary condit...
vspline::grok_type< bspl_coordinate_type< spline_type, rc_type >, result_type, _vsize > operator()(const spline_type &bspl, gate_types ... gates, vigra::TinyVector< int, spline_type::dimension > dspec=vigra::TinyVector< int, spline_type::dimension >(0), int shift=0)
'inner_evaluator' implements evaluation of a uniform b-spline, or some other spline-like construct re...
vigra::TinyVector< std::ptrdiff_t, dimension > shape_type
const int & get_order() const
vigra::TinyVector< trg_ele_type, channels > trg_type
void obtain_weights(weight_type *p_weight, const int &axis, const rc_type &c) const
obtain weight for a single axis
vigra::TinyVector< ic_ele_type, dimension > ic_type
const int window_size
size of the window of coefficients contributing to a single evaluation. This equals 'spline_order' to...
const int & get_degree() const
void eval(const offset_type &select, const vigra::MultiArrayView< 2, math1_type > &weight, result_type &result) const
the 'innermost' eval routine is called with offset(s) and weights. This routine is public because it ...
void eval(const bunch< vector< ic_ele_type, vsize >, dimension > &select, bunch< vector< trg_ele_type, vsize >, channels > &result, std::true_type) const
this overload is taken for discrete coordinates, and dispatches again, depending on the evaluator's '...
vigra::TinyVector< cf_ele_type, channels > cf_type
inner_evaluator(const cf_ele_type *const _cf_ebase, const shape_type &_cf_estride, int _spline_degree, const mbf_type &_wgt)
inner_evaluator only has a single constructor, which takes these arguments:
_math_ele_type math_ele_type
void split(const RT &input, IT &select, RT &tune) const
split function. This function is used to split incoming real coordinates into an integral and a remai...
void obtain_weights(weight_type *p_weight, const int &axis) const
void eval(const bunch< vector< rc_ele_type, vsize >, dimension > &select, bunch< vector< trg_ele_type, vsize >, channels > &result) const
initial dispatch on whether incoming coordinates are discrete or real
_trg_ele_type trg_ele_type
void ieval(const bunch< vector< ic_ele_type, vsize >, dimension > &select, bunch< vector< trg_ele_type, vsize >, channels > &result, std::false_type) const
first ieval overload taking discrete coordinates, implying a 'delta' of zero. this overload is for 'u...
void eval(const bunch< vector< rc_ele_type, vsize >, dimension > &coordinate, bunch< vector< trg_ele_type, vsize >, channels > &result, std::false_type) const
while class evaluator accepts the argument signature of a vspline::unary_functor, class inner_evaluat...
const shape_type & get_estride() const
void obtain_weights(vigra::MultiArrayView< 2, weight_type > &weight) const
void obtain_weights(vigra::MultiArrayView< 2, weight_type > &weight, const nd_rc_type &c) const
obtain_weights calculates the weights to be applied to a section of the coefficients from the fractio...
_ofs_ele_type ofs_ele_type
void ieval(const bunch< vector< ic_ele_type, vsize >, dimension > &select, bunch< vector< trg_ele_type, vsize >, channels > &result, std::true_type) const
second ieval overload taking discrete coordinates, implying a 'delta' of zero. this overload is for e...
vigra::TinyVector< rc_ele_type, dimension > rc_type
vigra::TinyVector< math_ele_type, channels > math_type
vigra::TinyVector< int, dimension > derivative_spec_type
class grok_type is a helper class wrapping a vspline::unary_functor so that it's type becomes opaque ...
homogeneous_mbf_type can be used for cases where all basis functors are the same. The evaluation code...
const bf_type & operator[](std::size_t i) const
homogeneous_mbf_type(const bf_type &_bf)
multi_bf_type(int _degree, const vigra::TinyVector< int, ndim > &_dspec)
When several basis functors have to be passed to an evaluator, it's okay to pass a container type lik...
std::array< bf_type, ndim > base_type
multi_bf_type(int _degree, targs ... args)
exception which is thrown if an opertion is requested which vspline does not support
class unary_functor provides a functor object which offers a system of types for concrete unary funct...
vector_traits< IN, vsize >::type in_v
vectorized in_type and out_type. vspline::vector_traits supplies these types so that multidimensional...
vector_traits< OUT, vsize >::type out_v
with the definition of 'simd_traits', we can proceed to implement 'vector_traits': struct vector_trai...
interface definition for unary functors