1 #ifndef CVD_IMAGE_INTERPOLATE_H
2 #define CVD_IMAGE_INTERPOLATE_H
59 #ifdef DOXYGEN_INCLUDE_ONLY_FOR_DOCS
103 return (
int)ceil(d - .5);
105 return (
int)floor(d + .5);
110 return ImageRef(round(v[0]), round(v[1]));
127 return (*im)[to_ir(pos)];
181 for(
unsigned int i=0; i < Pixel::Component<T>::count; i++)
183 float a, b=0, c=0, d=0;
227 return ( pow(p(x+2), 3) - 4 * pow(p(x+1),3) + 6 * pow(p(x), 3) - 4* pow(p(x-1),3))/6;
239 return pos[0] >= 1 && pos[1] >=1 && pos[0] < im->
size().x-2 && pos[1] < im->
size().y - 2;
244 int x = (int)floor(pos[0]);
245 int y = (int)floor(pos[1]);
246 float dx = pos[0] - x;
247 float dy = pos[1] - y;
251 for(
unsigned int i=0; i < Pixel::Component<T>::count; i++)
255 for(
int m = -1; m < 3; m++)
256 for(
int n = -1; n < 3; n++)
const BasicImage< T > * im
static const P & get(const P &pixel, size_t)
Pixel::traits< T >::float_type FT
ImageRef to_ir(const TooN::Vector< 2 > &v)
bool in_image(const TooN::Vector< 2 > &pos)
const BasicImage< C > * im
TooN::Vector< 2 > vec(const ImageRef &ir)
image_interpolate(const BasicImage< T > &i)
image_interpolate(const BasicImage< C > &i)
Pixel::traits< C >::float_type FT
FT operator[](const TooN::Vector< 2 > &pos)
TooN::Vector< 2 > ceil(const TooN::Vector< 2 > &v)
image_interpolate(const BasicImage< T > &i)
FT operator[](const TooN::Vector< 2 > &pos)
bool in_image(const TooN::Vector< 2 > &pos)
ImageRef size() const
What is the size of this image?
FT operator[](const TooN::Vector< 2 > &pos)
ImageRef ir(const TooN::Vector< 2 > &v)
Pixel::traits< T >::float_type FT
Vector< 1 > makeVector(double x1)
TooN::Vector< 2 > floor(const TooN::Vector< 2 > &v)
bool in_image(const TooN::Vector< 2 > &pos)
const BasicImage< T > * im
bool in_image(const ImageRef &ir) const