18 #ifndef PIC_FILTERING_FILTER_MOSAIC_HPP 19 #define PIC_FILTERING_FILTER_MOSAIC_HPP 21 #include "../filtering/filter.hpp" 40 if(src[0]->channels != 3){
44 int width = dst->
width;
45 float *data = src[0]->data;
47 for(
int j = box->
y0; j < box->y1; j++) {
51 for(
int i = box->
x0; i < box->x1; i++) {
58 if(mody == 0 && modx == 0) {
59 dst->
data[c1] = data[c3];
62 if(mody == 0 && modx == 1) {
63 dst->
data[c1] = data[c3 + 1];
66 if(mody == 1 && modx == 0) {
67 dst->
data[c1] = data[c3 + 1];
70 if(mody == 1 && modx == 1) {
71 dst->
data[c1] = data[c3 + 2];
96 width = imgIn[0]->width;
97 height = imgIn[0]->height;
99 frames = imgIn[0]->frames;
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
float * data
data is the main buffer where pixel values are stored.
Definition: image.hpp:91
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
The Filter class.
Definition: filter.hpp:50
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_mosaic.hpp:38
static Image * execute(Image *imgIn, Image *imgOut)
execute
Definition: filter_mosaic.hpp:108
int y0
Definition: bbox.hpp:32
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_mosaic.hpp:94
The Image class stores an image as buffer of float.
Definition: image.hpp:60
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
The FilterMosaic class.
Definition: filter_mosaic.hpp:28
FilterMosaic()
FilterMosaic.
Definition: filter_mosaic.hpp:81
int width
Definition: image.hpp:80