18 #ifndef PIC_FILTERING_FILTER_MED_VEC_HPP 19 #define PIC_FILTERING_FILTER_MED_VEC_HPP 21 #include "../filtering/filter.hpp" 22 #include "../util/array.hpp" 45 for(
int j = box->
y0; j < box->y1; j++) {
46 for(
int i = box->
x0; i < box->x1; i++) {
52 float *color = (*in)(i + l, j + k);
54 for(
int ch = 0; ch < in->
channels; ch++) {
55 values[c * in->
channels + ch] = color[ch];
64 float distBest = FLT_MAX;
82 float *out = (*dst) (i, j);
86 for(
int ch = 0; ch < in->
channels; ch++) {
87 out[ch] = values[index + ch];
113 int kernelSize = (
halfSize << 1) + 1;
114 this->areaKernel = kernelSize * kernelSize;
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
int checkHalfSize(int size)
checkHalfSize
Definition: filter_radial_basis_function.hpp:168
int channels
Definition: image.hpp:80
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 update(int size)
update
Definition: filter_med_vec.hpp:109
int midValue
Definition: filter_med_vec.hpp:32
static T distanceSq(T *data0, T *data1, int n)
distanceSq
Definition: array.hpp:195
int areaKernel
Definition: filter_med_vec.hpp:32
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_med_vec.hpp:40
int y0
Definition: bbox.hpp:32
static Image * execute(Image *imgIn, Image *imgOut, int size)
execute
Definition: filter_med_vec.hpp:126
The Image class stores an image as buffer of float.
Definition: image.hpp:60
FilterMedVec(int size)
FilterMedVec.
Definition: filter_med_vec.hpp:100
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 FilterMedVec class.
Definition: filter_med_vec.hpp:29
int halfSize
Definition: filter_med_vec.hpp:32