21 namespace ColorConversions
32 void Hsv2Rgb(
float h,
float s,
float v,
float &r,
float &g,
float &b)
40 int Hi = (int)(h / 60.0) % 6;
44 float f = (float)(h / 60.0 - (
float)Hi);
45 float p = (float)(v * (1.0 - s));
46 float q = (float)(v * (1.0 - s * f));
47 float t = (float)(v * (1.0 - s * (1.0 - f)));
95 void Rgb2Hsv(
float r,
float g,
float b,
float &h,
float &s,
float &v)
101 float mn = r, mx = r;
119 float delta = mx - mn;
146 h = 2 + (b - r) / delta;
151 h = 4 + (r - g) / delta;
DataCollection - Class to facilitate loading/accessing structured data.
void Rgb2Hsv(float r, float g, float b, float &h, float &s, float &v)
convert a RGB color to HSV color, rgb parameters from 0 to 1
void Hsv2Rgb(float h, float s, float v, float &r, float &g, float &b)
convert a HSV color to RGB color, H from 0 to 360, all other parameters 0 to 1