 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
79 double min, max, delta;
81 min = in.
r < in.
g ? in.
r : in.
g;
82 min = min < in.
b ? min : in.
b;
84 max = in.
r > in.
g ? in.
r : in.
g;
85 max = max > in.
b ? max : in.
b;
90 out.
s = (delta / max);
99 out.
h = ( in.
g - in.
b ) / delta;
102 out.
h = 2.0 + ( in.
b - in.
r ) / delta;
104 out.
h = 4.0 + ( in.
r - in.
g ) / delta;
122 double hh, p, q, t, ff;
133 if(hh >= 360.0) hh = 0.0;
137 p = in.
v * (1.0 - in.
s);
138 q = in.
v * (1.0 - (in.
s * ff));
139 t = in.
v * (1.0 - (in.
s * (1.0 - ff)));
185 static void heatcolor(
double heat,
double rgb_result[3] ) {
187 heat = std::min(1.0,std::max(0.0,heat));
188 hsv_color.
h = 230.0 * (1.0-heat);
192 rgb_result[0] = rgb_color.
r;
193 rgb_result[1] = rgb_color.
g;
194 rgb_result[2] = rgb_color.
b;
Class that converts color spaces.
Definition: color.h:25
double g
Green color (0.0-1.0).
Definition: color.h:41
static hsv rgb2hsv(rgb in)
Convert RGB to HSV.
Definition: color.h:77
double h
Angle in degrees (0.0-360.0).
Definition: color.h:57
double v
Brightness (0.0-1.0).
Definition: color.h:67
Structre that defines RGB color.
Definition: color.h:31
static rgb hsv2rgb(hsv in)
Convert HSV to RGB.
Definition: color.h:121
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
double s
Saturation (0.0-1.0).
Definition: color.h:62
double r
Red color (0.0-1.0).
Definition: color.h:36
static void heatcolor(double heat, double rgb_result[3])
Convert heat to RGB color.
Definition: color.h:185
double b
Blue color (0.0-1.0).
Definition: color.h:46
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
Structre that defines HSV color.
Definition: color.h:52