PICCANTE  0.4
The hottest HDR imaging library!
get_all_exposures.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_GL_TONE_MAPPING_GET_ALL_EXPOSURES_HPP
19 #define PIC_GL_TONE_MAPPING_GET_ALL_EXPOSURES_HPP
20 
21 #include "../../base.hpp"
22 
23 #include "../../tone_mapping/get_all_exposures.hpp"
24 
25 #include "../../gl/filtering/filter_simple_tmo.hpp"
26 
27 namespace pic {
28 
35 {
36  ImageGLVec ret;
37 
38  if(imgIn == NULL) {
39  return ret;
40  }
41 
42  std::vector<float> fstops = getAllExposures((Image*) imgIn);
43 
44  FilterGLSimpleTMO flt(gamma, 0.0f);
45 
46  ImageGLVec input = SingleGL(imgIn);
47 
48  for(unsigned int i = 0; i < fstops.size(); i++) {
49  flt.update(gamma, fstops[i]);
50  ImageGL *expo = flt.Process(input, NULL);
51 
52  expo->exposure = powf(2.0f, fstops[i]);
53  expo->clamp(0.0f, 1.0f);
54 
55  ret.push_back(expo);
56  }
57 
58  return ret;
59 }
60 
61 } // end namespace pic
62 
63 #endif /* PIC_GL_TONE_MAPPING_GET_ALL_EXPOSURES_HPP */
64 
PIC_INLINE ImageGLVec getAllExposuresImagesGL(ImageGL *imgIn, float gamma=2.2f)
getAllExposuresImagesGL converts an HDR image into a stack of LDR images
Definition: get_all_exposures.hpp:34
void clamp(float a, float b)
clamp
PIC_INLINE ImageGLVec SingleGL(ImageGL *img)
SingleGL creates a single for filters input.
Definition: image_vec.hpp:39
The ImageGL class.
Definition: image.hpp:42
float exposure
Definition: filter_radial_basis_function.hpp:79
The FilterGLSimpleTMO class.
Definition: filter_simple_tmo.hpp:30
virtual ImageGL * Process(ImageGLVec imgIn, ImageGL *imgOut)
Process.
Definition: display.hpp:258
void update(float gamma, float fstop)
update
Definition: filter_simple_tmo.hpp:82
PIC_INLINE std::vector< float > getAllExposures(Image *imgIn)
getAllExposures computes all required exposure values for reconstructing the input image using histog...
Definition: get_all_exposures.hpp:107
#define PIC_INLINE
Definition: base.hpp:33
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
std::vector< ImageGL * > ImageGLVec
ImageGLVec an std::vector of pic::ImageGL.
Definition: image_vec.hpp:32