78 color[0] = fabs( cos( bucket ) );
79 color[1] = fabs( sin( bucket * 30 ) );
80 color[2] = fabs( sin( bucket * 2 ) );
107 d[1] = d[2] = 0.0; d[0] = t/(1.0/3.0);
108 }
else if (t <= 2.0/3.0) {
109 d[0] = 1.0; d[2] = 0.0; d[1] = (t-(1.0/3.0))/(1.0/3.0);
111 d[0] = 1.0; d[1] = 1.0; d[2] = (t-(2.0/3.0))/(1.0/3.0);
119 d[0] = d[1] = 0.0; d[2] = 0.5 + 0.5*(t/0.125);
120 }
else if (t < 0.375) {
121 d[0] = 0.0; d[2] = 1.0; d[1] = (t-0.125)/0.25;
122 }
else if (t < 0.625) {
123 d[1] = 1.0; d[0] = (t-0.375)/0.25;; d[2] = 1.0 - d[0];
124 }
else if (t < 0.875) {
125 d[0] = 1.0; d[2] = 0.0; d[1] = 1.0 - (t-0.625)/0.25;
127 d[1] = d[2] = 0.0; d[2] = 1.0 - 0.5*(t/0.125);
133 float p1, p2, p3, i, f;
140 i = (float)floor((
double)xh);
143 p2 = v * (1 - (s * f));
144 p3 = v * (1 - (s * (1 - f)));
void getColor(float *color, size_t bucket, GradientType gradient=GREY)
Returns three float values for the color of the given bucket.
void calcColorHot(float *color, size_t bucket)
Returns a color from a hot gradient.
void convertHSVToRGB(float hue, float s, float v, float &r, float &g, float &b)
Converts the given color in HSV space into RGB space.
void calcColorSHSV(float *color, size_t bucket)
Returns a color from a SHSV gradient.
GradientType
Identifies a color gradient.
void calcColorGrey(float *color, size_t bucket)
Returns a color from a gray gradient.
void calcColorJet(float *color, size_t bucket)
Returns a color from a Jet gradient.
void calcColorHSV(float *color, size_t bucket)
Returns a color from a HSV gradient.
size_t m_numBuckets
Number of colors in the color gradient.
void calcColorSimpsons(float *color, size_t bucket)
Returns a color from a Simpsons gradient.