18 #ifndef PIC_FILTERING_FILTER_DEFORM_GRID_HPP 19 #define PIC_FILTERING_FILTER_DEFORM_GRID_HPP 21 #include "../util/vec.hpp" 23 #include "../util/std_util.hpp" 25 #include "../filtering/filter.hpp" 26 #include "../image_samplers/image_sampler_bicubic.hpp" 27 #include "../image_samplers/image_sampler_bilinear.hpp" 28 #include "../image_samplers/image_sampler_nearest.hpp" 51 for(
int j = box->
y0; j < box->y1; j++) {
54 for(
int i = box->
x0; i < box->x1; i++) {
55 float *tmp_dst = (*dst)(i, j);
57 float x = float(i) / dst->
width1f;
104 Image *ret =
new Image(1, sampleX, sampleY, 3);
106 float tmp_x = 1.0f / float(sampleX - 1);
107 float tmp_y = 1.0f / float(sampleY - 1);
109 for(
int y = 0; y < sampleY; y++) {
110 float y_f = float(y) * tmp_y;
112 for(
int x = 0; x < sampleX; x++) {
113 float *ret_val = (*ret)(x, y);
115 ret_val[0]= float(x) * tmp_x;
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
T * delete_s(T *data)
delete_s
Definition: std_util.hpp:123
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
The ImageSamplerBicubic class.
Definition: image_sampler_bicubic.hpp:28
The Filter class.
Definition: filter.hpp:50
int y0
Definition: bbox.hpp:32
float height1f
Definition: image.hpp:84
void SampleImage(Image *img, float x, float y, float *vOut)
SampleImage samples an image in uniform coordiantes.
Definition: image_sampler_bicubic.hpp:43
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
The ImageSamplerNearest class.
Definition: image_sampler_nearest.hpp:28
float width1f
Definition: image.hpp:84