2 #ifndef vil_sample_profile_bilin_hxx_ 3 #define vil_sample_profile_bilin_hxx_ 30 && y1+2 <= image.
nj();
38 template <
class imType,
class vecType>
41 double x0,
double y0,
double dx,
double dy,
46 const unsigned ni = image.
ni();
47 const unsigned nj = image.
nj();
48 const unsigned np = image.
nplanes();
49 const std::ptrdiff_t istep = image.
istep();
50 const std::ptrdiff_t jstep = image.
jstep();
51 const std::ptrdiff_t pstep = image.
planestep();
60 for (
int k=0;k<n;++k,x+=dx,y+=dy)
65 for (
int k=0;k<n;++k,x+=dx,y+=dy)
67 for (
unsigned int p=0;p<np;++p,++
v)
77 for (
int k=0;k<n;++k,x+=dx,y+=dy)
82 for (
int k=0;k<n;++k,x+=dx,y+=dy)
84 for (
unsigned int p=0;p<np;++p,++
v)
96 template <
class imType,
class vecType>
99 double x0,
double y0,
double dx,
double dy,
104 const unsigned ni = image.
ni();
105 const unsigned nj = image.
nj();
106 const unsigned np = image.
nplanes();
107 const std::ptrdiff_t istep = image.
istep();
108 const std::ptrdiff_t jstep = image.
jstep();
109 const std::ptrdiff_t pstep = image.
planestep();
118 for (
int k=0;k<n;++k,x+=dx,y+=dy)
123 for (
int k=0;k<n;++k,x+=dx,y+=dy)
125 for (
unsigned int p=0;p<np;++p,++
v)
135 for (
int k=0;k<n;++k,x+=dx,y+=dy)
140 for (
int k=0;k<n;++k,x+=dx,y+=dy)
142 for (
unsigned int p=0;p<np;++p,++
v)
149 #define VIL_SAMPLE_PROFILE_BILIN_INSTANTIATE( imType, vecType ) \ 150 template void vil_sample_profile_bilin(vecType* v, \ 151 const vil_image_view<imType >& image, \ 152 double x0, double y0, \ 153 double dx, double dy, \ 155 template void vil_sample_profile_bilin_edgena(vecType* v, \ 156 const vil_image_view<imType >& image, \ 157 double x0, double y0, \ 158 double dx, double dy, \ 160 #endif // vil_sample_profile_bilin_hxx_ An abstract base class of smart pointers to actual image data in memory.
double vil_bilin_interp(const vil_image_view< T > &view, double x, double y, unsigned p=0)
Compute bilinear interpolation at (x,y), with minimal bound checks.
Concrete view of image data of type T held in memory.
bool vil_profile_bilin_in_image(double x0, double y0, double x1, double y1, const vil_image_view_base &image)
This function should not be the same in bicub and bilin.
double vil_bilin_interp_safe(const vil_image_view< T > &view, double x, double y, unsigned p=0)
Compute bilinear interpolation at (x,y), with bound checks.
double vil_bilin_interp_safe_edgena(const vil_image_view< T > &view, double x, double y, unsigned p=0)
Compute bilinear interpolation at (x,y), with bound checks.
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.
Bilinear profile sampling functions for 2D images.
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
unsigned nplanes() const
Number of planes.
void vil_sample_profile_bilin_edgena(vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
Sample along profile, using bilinear interpolation.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.
void vil_sample_profile_bilin(vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
Sample along profile, using bilinear interpolation.
Bilinear interpolation functions for 2D images.