1 #ifndef DASH__TOOLS__COLORSPACE 2 #define DASH__TOOLS__COLORSPACE 20 static hsv rgb2hsv(
rgb in);
21 static rgb hsv2rgb(
hsv in);
26 double min,
max, delta;
28 min = in.r < in.g ? in.r : in.g;
29 min = min < in.b ? min : in.b;
31 max = in.r > in.g ? in.r : in.g;
32 max = max > in.b ? max : in.b;
36 if (delta < 0.00001) {
42 out.s = (delta / max);
52 out.h = ( in.g - in.b ) / delta;
53 }
else if ( in.g >= max ) {
54 out.h = 2.0 + ( in.b - in.r ) / delta;
56 out.h = 4.0 + ( in.r - in.g ) / delta;
71 double hh, p, q, t, ff;
88 p = in.v * (1.0 - in.s);
89 q = in.v * (1.0 - (in.s * ff));
90 t = in.v * (1.0 - (in.s * (1.0 - ff)));
133 #endif // DASH__TOOLS__COLORSPACE This class is a simple memory pool which holds allocates elements of size ValueType.
Reduce operands to their maximum value.