PICCANTE  0.4
The hottest HDR imaging library!
filter_absolute_difference.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_ABSOLUTE_DIFFERENCE_HPP
19 #define PIC_FILTERING_FILTER_ABSOLUTE_DIFFERENCE_HPP
20 
21 #include "../filtering/filter.hpp"
22 
23 namespace pic {
24 
29 {
30 protected:
31 
36  void f(FilterFData *data)
37  {
38  float *dataIn0 = (*data->src[0])(data->x, data->y);
39  float *dataIn1 = (*data->src[1])(data->x, data->y);
40 
41  for(int k = 0; k < data->dst->channels; k++) {
42  data->out[k] = fabsf(dataIn1[k] - dataIn0[k]);
43  }
44  }
45 
46 public:
47 
52  {
53 
54  }
55 
62  static Image *execute(Image *imgIn1, Image *imgIn2)
63  {
65  return filter.Process(Double(imgIn1, imgIn2), NULL);
66  }
67 };
68 
69 } // end namespace pic
70 
71 #endif /* PIC_FILTERING_FILTER_ABSOLUTE_DIFFERENCE_HPP */
72 
int y
Definition: filter.hpp:39
int channels
Definition: image.hpp:80
The Filter class.
Definition: filter.hpp:50
static Image * execute(Image *imgIn1, Image *imgIn2)
execute
Definition: filter_absolute_difference.hpp:62
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
Definition: filter.hpp:37
Image * dst
Definition: filter.hpp:42
float * out
Definition: filter.hpp:40
void f(FilterFData *data)
f
Definition: filter_absolute_difference.hpp:36
PIC_INLINE ImageVec Double(Image *img1, Image *img2)
Double creates an std::vector which contains img1 and img2; this is for filters input.
Definition: image_vec.hpp:49
int x
Definition: filter.hpp:39
FilterAbsoluteDifference()
FilterAbsoluteDifference.
Definition: filter_absolute_difference.hpp:51
The Image class stores an image as buffer of float.
Definition: image.hpp:60
The FilterAbsoluteDifference class.
Definition: filter_absolute_difference.hpp:28
ImageVec src
Definition: filter.hpp:43
Definition: bilateral_separation.hpp:25