53 #include <ACG/Utils/HaltonColors.hh> 76 inverse_bases[0] = 1.0f / bases[0];
77 inverse_bases[1] = 1.0f / bases[1];
78 inverse_bases[2] = 1.0f / bases[2];
81 float HaltonColors::halton(
int index)
83 int base = bases[index];
84 float inverse_base = inverse_bases[index];
86 float half = inverse_base;
87 int I = current[index];
92 I = (int)(inverse_base * (I - digit));
98 float HaltonColors::random_interval(
int index,
float min,
float max)
100 return halton(index) * (max - min) + min;
103 ACG::Vec4f HaltonColors::HSL2RGB(
double h,
double sl,
double l)
112 v = (l <= 0.5) ? (l * (1.0 + sl)) : (l + sl - l * sl);
118 double fract, vsf, mid1, mid2;
125 vsf = v * sv * fract;
163 return Vec4f((
float)r, (
float)g, (
float)b, 1.0f);
167 float h = random_interval(0, 0.0f , 0.9f );
168 float s = random_interval(1, 0.40f, 0.80f);
169 float l = random_interval(2, 0.30f, 0.60f);
170 return HSL2RGB(h, s, l);
Namespace providing different geometric functions concerning angles.
virtual ACG::Vec4f generateNextColor()
Generate the next color.
VectorT< float, 4 > Vec4f
HaltonColors(int skip=250)
Default constructor.
ACG::Vec4f get_next_color()
Generate the next color (legacy method)