PICCANTE  0.4
The hottest HDR imaging library!
point_samplers.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_UTIL_POINT_SAMPLERS_HPP
19 #define PIC_UTIL_POINT_SAMPLERS_HPP
20 
21 namespace pic {
22 
27 inline float randU()
28 {
29  return float(rand() % RAND_MAX) / float(RAND_MAX);
30 }
31 
32 const float POISSON_RHO = 0.75f;
33 
40 inline float PoissonRadius(int nSamples)
41 {
42  return (2.0f * POISSON_RHO) / sqrtf(2.0f * sqrtf(3.0f) * float(nSamples));
43 }
44 
45 /*Sampler type:
46  -ST_POISSON: poisson sampling
47  -ST_POISSON_M: multiple poisson sampling
48  -ST_MONTECARLO: classic montecarlo
49  -ST_MONTECARLO_S: stratifield montecarlo*/
50 
52 
53 } // end namespace pic
54 
55 #endif /* PIC_UTIL_POINT_SAMPLERS_HPP */
56 
Definition: point_samplers.hpp:51
Definition: point_samplers.hpp:51
Definition: point_samplers.hpp:51
Definition: point_samplers.hpp:51
float randU()
randU computes a random number in [0, 1[ using the classic rand().
Definition: point_samplers.hpp:27
SAMPLER_TYPE
Definition: point_samplers.hpp:51
Definition: point_samplers.hpp:51
Definition: bilateral_separation.hpp:25
float PoissonRadius(int nSamples)
PoissonRadius estimates the radius of a Poisson-disk like distribution using nSmaples.
Definition: point_samplers.hpp:40
const float POISSON_RHO
Definition: point_samplers.hpp:32