PICCANTE  0.4
The hottest HDR imaging library!
base.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_METRICS_BASE_HPP
19 #define PIC_METRICS_BASE_HPP
20 
21 #include "../util/math.hpp"
22 #include "../metrics/pu_encode.hpp"
23 
24 namespace pic {
25 
26 const double C_SINGULARITY = 1e-6;
27 const double C_LARGE_DIFFERENCES = 1e6;
28 const float C_LARGE_DIFFERENCESf = 1e6f;
29 
31 
38 float changeDomain(float x, METRICS_DOMAIN type = MD_LIN)
39 {
40  switch(type){
41  case MD_LIN: {
42  return x;
43  } break;
44 
45  case MD_LOG10: {
46  return log10f(x);
47  } break;
48 
49  case MD_PU: {
50  return PUEncode(x);
51  } break;
52  }
53 
54  return x;
55 }
56 
57 } // end namespace pic
58 
59 #endif /* PIC_METRICS_BASE_HPP */
60 
float changeDomain(float x, METRICS_DOMAIN type=MD_LIN)
changeDomain
Definition: base.hpp:38
Definition: base.hpp:30
Definition: base.hpp:30
float PUEncode(float L)
PUEncode encodes luminance values in a perceptually uniform space.
Definition: pu_encode.hpp:37
Definition: bilateral_separation.hpp:25
const double C_SINGULARITY
Definition: base.hpp:26
METRICS_DOMAIN
Definition: base.hpp:30
const float C_LARGE_DIFFERENCESf
Definition: base.hpp:28
const double C_LARGE_DIFFERENCES
Definition: base.hpp:27
Definition: base.hpp:30