18 #ifndef PIC_FILTERING_FILTER_SAMPLER_2D_HPP 19 #define PIC_FILTERING_FILTER_SAMPLER_2D_HPP 21 #include "../filtering/filter.hpp" 22 #include "../image_samplers/image_sampler_bilinear.hpp" 23 #include "../image_samplers/image_sampler_bsplines.hpp" 24 #include "../image_samplers/image_sampler_gaussian.hpp" 25 #include "../image_samplers/image_sampler_nearest.hpp" 104 if(imgIn.size() == 1) {
113 width = imgIn[1]->width;
114 height = imgIn[1]->height;
117 channels = imgIn[0]->channels;
118 frames = imgIn[0]->frames;
230 float height1f = float(box->
height - 1);
231 float width1f = float(box->
width - 1);
233 for(
int j = box->
y0; j < box->y1; j++) {
234 float y = float(j) / height1f;
236 for(
int i = box->
x0; i < box->x1; i++) {
238 float x = float(i) / width1f;
240 float *tmp_dst = (*dst)(i, j);
The FilterSampler2D class.
Definition: filter_sampler_2d.hpp:32
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_sampler_2d.hpp:227
ImageSamplerNearest isb_default
Definition: filter_sampler_2d.hpp:35
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
ImageSampler * isb
Definition: filter_sampler_2d.hpp:36
The ImageSampler class.
Definition: image_sampler.hpp:29
The Filter class.
Definition: filter.hpp:50
static Image * execute(Image *imgIn, Image *imgOut, float scaleX, float scaleY, ImageSampler *isb=NULL)
execute
Definition: filter_sampler_2d.hpp:165
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void update(int width, int height, ImageSampler *isb)
update
Definition: filter_sampler_2d.hpp:127
FilterSampler2D()
FilterSample2D.
Definition: filter_sampler_2d.hpp:54
float scale
Definition: filter_radial_basis_function.hpp:53
bool swh
Definition: filter_sampler_2d.hpp:39
int y0
Definition: bbox.hpp:32
int width
Definition: filter_sampler_2d.hpp:38
int height
Definition: filter_sampler_2d.hpp:38
#define PIC_INLINE
Definition: base.hpp:33
static Image * execute(Image *imgIn, Image *imgOut, float scale, ImageSampler *isb=NULL)
execute
Definition: filter_sampler_2d.hpp:149
The Image class stores an image as buffer of float.
Definition: image.hpp:60
float scaleY
Definition: filter_sampler_2d.hpp:37
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25
virtual void SampleImage(Image *img, float x, float y, float *vOut)
SampleImage samples an image in uniform coordiantes.
Definition: image_sampler.hpp:57
int width
Definition: bbox.hpp:33
static Image * execute(Image *imgIn, Image *imgOut, int width, int height, ImageSampler *isb=NULL)
execute
Definition: filter_sampler_2d.hpp:181
int height
Definition: bbox.hpp:33
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_sampler_2d.hpp:94
The ImageSamplerNearest class.
Definition: image_sampler_nearest.hpp:28
float scaleX
Definition: filter_sampler_2d.hpp:37