Classes | Macros | Functions
vil_correlate_1d.h File Reference

1D Convolution with cunning boundary options More...

#include <algorithm>
#include <cstring>
#include <iostream>
#include <cassert>
#include <vil/vil_image_view.h>
#include <vil/vil_image_resource.h>
#include <vil/vil_property.h>
#include <vil/algo/vil_convolve_1d.h>

Go to the source code of this file.

Classes

class  vil_correlate_1d_resource< kernelT, accumT, destT >
 A resource adaptor that behaves like a correlated version of its input. More...
 

Macros

#define macro(F, T)
 

Functions

template<class srcT , class destT , class kernelT , class accumT >
void vil_correlate_1d (const srcT *src0, unsigned nx, std::ptrdiff_t s_step, destT *dest0, std::ptrdiff_t d_step, const kernelT *kernel, std::ptrdiff_t k_lo, std::ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 Correlate kernel[x] (x in [k_lo,k_hi]) with srcT. More...
 
template<class srcT , class destT , class kernelT , class accumT >
void vil_correlate_1d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, std::ptrdiff_t k_lo, std::ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 correlate kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction. More...
 
template<class destT , class kernelT , class accumT >
vil_image_resource_sptr vil_correlate_1d (const vil_image_resource_sptr &src_im, const destT, const kernelT *kernel, std::ptrdiff_t k_lo, std::ptrdiff_t k_hi, const accumT, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 Create an image_resource object which correlate kernel[x] x in [k_lo,k_hi] with srcT. More...
 

Detailed Description

1D Convolution with cunning boundary options

Author
Tim Cootes (based on work by fsm)

Definition in file vil_correlate_1d.h.

Macro Definition Documentation

◆ macro

#define macro (   F,
 
)
Value:
case F : \
vil_correlate_1d(static_cast<vil_image_view<T >&>(*vs),dest, \
kernel_, klo_, khi_, accumT(), start_option_, end_option_); \
return new vil_image_view<destT>(vil_crop(dest, lboundary, ni, 0, nj));
Concrete view of image data of type T held in memory.
Definition: vil_fwd.h:13
vil_image_view< T > vil_crop(const vil_image_view< T > &im, unsigned i0, unsigned n_i, unsigned j0, unsigned n_j)
Create a view which is a cropped version of src.
Definition: vil_crop.h:21

Function Documentation

◆ vil_correlate_1d() [1/3]

template<class srcT , class destT , class kernelT , class accumT >
void vil_correlate_1d ( const srcT *  src0,
unsigned  nx,
std::ptrdiff_t  s_step,
destT *  dest0,
std::ptrdiff_t  d_step,
const kernelT *  kernel,
std::ptrdiff_t  k_lo,
std::ptrdiff_t  k_hi,
accumT  ac,
vil_convolve_boundary_option  start_option,
vil_convolve_boundary_option  end_option 
)
inline

Correlate kernel[x] (x in [k_lo,k_hi]) with srcT.

Assumes dest and src same size (nx)

Definition at line 24 of file vil_correlate_1d.h.

◆ vil_correlate_1d() [2/3]

template<class srcT , class destT , class kernelT , class accumT >
void vil_correlate_1d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const kernelT *  kernel,
std::ptrdiff_t  k_lo,
std::ptrdiff_t  k_hi,
accumT  ac,
vil_convolve_boundary_option  start_option,
vil_convolve_boundary_option  end_option 
)
inline

correlate kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.

On exit dest_im(i,j) = sum src(i+x,j)*kernel(x) (x=k_lo..k_hi)

Note
This function does not reverse the kernel. If you want the kernel reversed, use vil_convolve_1d instead.
Parameters
kernelshould point to tap 0.
dest_imwill be resized to size of src_im.

Definition at line 62 of file vil_correlate_1d.h.

◆ vil_correlate_1d() [3/3]

template<class destT , class kernelT , class accumT >
vil_image_resource_sptr vil_correlate_1d ( const vil_image_resource_sptr src_im,
const destT  dt,
const kernelT *  kernel,
std::ptrdiff_t  k_lo,
std::ptrdiff_t  k_hi,
const accumT  ac,
vil_convolve_boundary_option  start_option,
vil_convolve_boundary_option  end_option 
)

Create an image_resource object which correlate kernel[x] x in [k_lo,k_hi] with srcT.

Note
This function does not reverse the kernel. If you want the kernel reversed, use vil_convolve_1d instead.
Parameters
kernelshould point to tap 0.

Definition at line 218 of file vil_correlate_1d.h.