PICCANTE  0.4
The hottest HDR imaging library!
filter_radial_basis_function.hpp
Go to the documentation of this file.
1 /*
2 
3 PICCANTE
4 The hottest HDR imaging library!
5 http://vcg.isti.cnr.it/piccante
6 
7 Copyright (C) 2014
8 Visual Computing Laboratory - ISTI CNR
9 http://vcg.isti.cnr.it
10 First author: Francesco Banterle
11 
12 This Source Code Form is subject to the terms of the Mozilla Public
13 License, v. 2.0. If a copy of the MPL was not distributed with this
14 file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 
16 */
17 
18 #ifndef PIC_FILTERING_FILTER_RADIAL_BASIS_FUNCTION
19 #define PIC_FILTERING_FILTER_RADIAL_BASIS_FUNCTION
20 
21 namespace pic {
22 
23 #include "../algorithms/radial_basis_function.hpp"
24 
25 #include "../filtering/filter.hpp"
26 
31 {
32 protected:
33 
35 
42  void ProcessBBox(Image *dst, ImageVec src, BBox *box)
43  {
44  if(rbf == NULL) {
45  return;
46  }
47 
48  int channels = src[0]->channels;
49 
50  if(rbf->nDim != channels) {
51  return;
52  }
53 
54  for(int j = box->y0; j < box->y1; j++) {
55 
56  for(int i = box->x0; i < box->x1; i++) {
57 
58  float *dataIn = (*src[0]) (i, j);
59  float *dataOut = (*dst) (i, j);
60 
61  dataOut[0] = rbf->eval(dataIn);
62  }
63  }
64  }
65 
66 public:
67 
72  {
73  rbf = NULL;
74  }
75 
84  void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
85  {
86  width = imgIn[0]->width;
87  height = imgIn[0]->height;
88  channels = 1;
89  frames = imgIn[0]->frames;
90  }
91 
97  {
98  if(rbf != NULL) {
99  this->rbf = rbf;
100  }
101  }
102 };
104 } // end namespace pic
105 
106 #endif /* PIC_FILTERING_FILTER_RADIAL_BASIS_FUNCTION */
107 
void update(RadialBasisFunction *rbf)
update
Definition: filter_radial_basis_function.hpp:96
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_radial_basis_function.hpp:84
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
RadialBasisFunction * rbf
Definition: filter_radial_basis_function.hpp:34
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: filter_radial_basis_function.hpp:29
float eval(float *value)
eval
Definition: radial_basis_function.hpp:77
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_radial_basis_function.hpp:50
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_radial_basis_function.hpp:42
FilterRadialBasisFunction()
FilterRadialBasisFunction.
Definition: filter_radial_basis_function.hpp:71
int y0
Definition: bbox.hpp:32
int nDim
Definition: radial_basis_function.hpp:34
The Image class stores an image as buffer of float.
Definition: image.hpp:60
The RadialBasisFunction class.
Definition: filter_radial_basis_function.hpp:30
Definition: bilateral_separation.hpp:25
The FilterRadialBasisFunction class.
Definition: filter_radial_basis_function.hpp:30