73#ifndef VSPLINE_GENERAL_FILTER_H
123template <
unsigned int dimension ,
124 typename in_value_type ,
125 typename out_value_type ,
126 typename math_ele_type =
128 < in_value_type , out_value_type > ,
134 vigra::MultiArrayView
136 in_value_type > & input ,
137 vigra::MultiArrayView
139 out_value_type > & output ,
142 static_cast < int > ( dimension ) > bcv ,
143 std::vector < vspline::xlf_type > pv ,
149 if ( output.shape() != input.shape() )
151 (
"forward_backward_recursive_filter: input and output shape must match" ) ;
154 tolerance = std::numeric_limits < math_ele_type > :: epsilon() ;
156 int npoles = pv.size() ;
167 amplify < dimension , in_value_type , out_value_type , math_ele_type >
168 ( input , output , math_ele_type ( boost ) ) ;
175 for (
int i = 0 ; i < npoles ; i++ )
195 std::vector < vspline::iir_filter_specs > vspecs ;
200 for (
int axis = 0 ; axis < dimension ; axis++ )
204 ( bcv [ axis ] , npoles , poles , tolerance , 1 ) ) ;
210 vspecs [ 0 ] . boost = boost ;
213 < in_value_type , out_value_type , dimension , filter_type >
214 ( input , output , vspecs , njobs ) ;
220 assert ( axis >=0 && axis < dimension ) ;
223 < in_value_type , out_value_type , dimension , filter_type >
224 ( input , output , axis ,
226 bcv [ axis ] , npoles , poles , tolerance , boost ) ,
262template <
unsigned int dimension ,
263 typename in_value_type ,
264 typename out_value_type ,
265 typename math_ele_type =
267 < in_value_type , out_value_type > ,
273 vigra::MultiArrayView
275 in_value_type > & input ,
276 vigra::MultiArrayView
278 out_value_type > & output ,
281 static_cast < int > ( dimension ) > bcv ,
282 std::vector < vspline::xlf_type > kv ,
287 if ( output.shape() != input.shape() )
289 (
"convolution_filter: input and output shape must match" ) ;
291 size_t ksize = kv.size() ;
298 if ( (
void*) ( input.data() ) != (
void*) ( output.data() ) )
307 for (
int i = 0 ; i < ksize ; i++ )
320 std::vector < vspline::fir_filter_specs > vspecs ;
322 for (
int axis = 0 ; axis < dimension ; axis++ )
326 ( bcv [ axis ] , ksize , headroom , kernel ) ) ;
330 < in_value_type , out_value_type , dimension , filter_type >
331 ( input , output , vspecs , njobs ) ;
337 assert ( axis >=0 && axis < dimension ) ;
340 < in_value_type , out_value_type , dimension , filter_type >
341 ( input , output , axis ,
349#define VSPLINE_GENERAL_FILTER_H
void filter(const vigra::MultiArrayView< D, in_type > &input, vigra::MultiArrayView< D, out_type > &output, types ... args)
vspline::filter is the common entry point for filter operations in vspline. This routine does not yet...
void convolution_filter(const vigra::MultiArrayView< dimension, in_value_type > &input, vigra::MultiArrayView< dimension, out_value_type > &output, vigra::TinyVector< bc_code, static_cast< int >(dimension) > bcv, std::vector< vspline::xlf_type > kv, int headroom, int axis=-1, int njobs=default_njobs)
convolution_filter implements convolution of the input with a fixed-size convolution kernel....
typename vigra::NumericTraits< promote_ele_type< T1, T2 > > ::RealPromote common_math_ele_type
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...
void forward_backward_recursive_filter(const vigra::MultiArrayView< dimension, in_value_type > &input, vigra::MultiArrayView< dimension, out_value_type > &output, vigra::TinyVector< bc_code, static_cast< int >(dimension) > bcv, std::vector< vspline::xlf_type > pv, xlf_type tolerance=-1, xlf_type boost=xlf_type(1), int axis=-1, int njobs=default_njobs)
forward_backward_recursive_filter applies one or more pairs of simple recursive filters to the input....
bc_code
This enumeration is used for codes connected to boundary conditions. There are two aspects to boundar...
class to provide b-spline prefiltering, using 'iir_filter' above. The actual filter object has to int...
class convolve provides the combination of class fir_filter above with a vector-friendly buffer....
fir_filter_specs holds the parameters for a filter performing a convolution along a single axis....
structure to hold specifications for an iir_filter object. This set of parameters has to be passed th...
shape mismatch is the exception which is thrown if the shapes of an input array and an output array d...
with the definition of 'simd_traits', we can proceed to implement 'vector_traits': struct vector_trai...
includes all headers from vspline (most of them indirectly)