2 #ifndef vil_sample_grid_bicub_hxx_ 3 #define vil_sample_grid_bicub_hxx_ 24 && y0+3 <= image.
nj();
32 template <
class imType,
class vecType>
35 double x0,
double y0,
double dx1,
double dy1,
36 double dx2,
double dy2,
int n1,
int n2)
42 y0+(n1-1)*dy1+(n2-1)*dy2,image);
44 const unsigned ni = image.
ni();
45 const unsigned nj = image.
nj();
46 const unsigned np = image.
nplanes();
47 const std::ptrdiff_t istep = image.
istep();
48 const std::ptrdiff_t jstep = image.
jstep();
49 const std::ptrdiff_t pstep = image.
planestep();
58 for (
int i=0;i<n1;++i,x1+=dx1,y1+=dy1)
61 for (
int j=0;j<n2;++j,x+=dx2,y+=dy2,++
v)
67 for (
int i=0;i<n1;++i,x1+=dx1,y1+=dy1)
70 for (
int j=0;j<n2;++j,x+=dx2,y+=dy2)
72 for (
unsigned p=0;p<np;++p,++
v)
83 for (
int i=0;i<n1;++i,x1+=dx1,y1+=dy1)
86 for (
int j=0;j<n2;++j,x+=dx2,y+=dy2,++
v)
92 for (
int i=0;i<n1;++i,x1+=dx1,y1+=dy1)
95 for (
int j=0;j<n2;++j,x+=dx2,y+=dy2)
97 for (
unsigned p=0;p<np;++p,++
v)
105 #define VIL_SAMPLE_GRID_BICUB_INSTANTIATE( imType, vecType ) \ 106 template void vil_sample_grid_bicub(vecType* v, \ 107 const vil_image_view<imType >& image, \ 108 double x0, double y0, double dx1, double dy1, \ 109 double dx2, double dy2, int n1, int n2) 111 #endif // vil_sample_grid_bicub_hxx_ An abstract base class of smart pointers to actual image data in memory.
Concrete view of image data of type T held in memory.
void vil_sample_grid_bicub(vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
Sample grid from image, using bicubic interpolation.
Bicubic interpolation functions for 2D images.
bool vil_grid_bicub_corner_in_image(double x0, double y0, const vil_image_view_base &image)
This function should not be the same in bicub and bilin.
std::ptrdiff_t jstep() const
Add this to your pixel pointer to get next j pixel.
unsigned ni() const
Width.
unsigned nj() const
Height.
std::ptrdiff_t planestep() const
Add this to your pixel pointer to get pixel on next plane.
double vil_bicub_interp(const vil_image_view< T > &view, double x, double y, unsigned p=0)
Compute bicubic interpolation at (x,y), with minimal bound checks.
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
double vil_bicub_interp_safe(const vil_image_view< T > &view, double x, double y, unsigned p=0)
Compute bicubic interpolation at (x,y), with bound checks.
unsigned nplanes() const
Number of planes.
Bicubic grid sampling function for 2D images.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.