Detailed Description
- See also:
- Class AColor,
Structure BMM_Color_24,
Structure BMM_Color_32,
Structure BMM_Color_48,
Structure BMM_Color_64,
Structure
BMM_Color_fl, Structure RealPixel.
- Description:
- This class represents color as three floating point values: r,
g, and b. All methods of this class are implemented by the
system.
- Data Members:
- float r,g,b;
These values are in the range 0.0 to 1.0.
#include <color.h>
List of all members.
Constructor & Destructor Documentation
Color |
( |
float |
R, |
|
|
float |
G, |
|
|
float |
B |
|
) |
|
[inline] |
- Parameters:
- float R
Specifies the red component of the color.
float G
Specifies the green component of the color.
float B
Specifies the blue component of the color.
Color |
( |
double |
R, |
|
|
double |
G, |
|
|
double |
B |
|
) |
|
[inline] |
- Parameters:
- double R
Specifies the red component of the color.
double G
Specifies the green component of the color.
double B
Specifies the blue component of the color.
{ r = (float)R; g = (float)G; b = (float)B; }
Color |
( |
int |
R, |
|
|
int |
G, |
|
|
int |
B |
|
) |
|
[inline] |
- Parameters:
- int R
Specifies the red component of the color.
int G
Specifies the green component of the color.
int B
Specifies the blue component of the color.
{ r = (float)R; g = (float)G; b = (float)B; }
- Parameters:
- Color&
a
Specifies the initial color.
{ r = a.r; g = a.g; b = a.b; }
GEOMEXPORT Color |
( |
DWORD |
rgb |
) |
[explicit] |
- Parameters:
- DWORD rgb
Specifies the initial color via a Windows RGB value.
- Parameters:
- Point3
p
Specifies the color. r=x, g=y, b=z.
{ r = p.x; g = p.y; b = p.z; }
Color |
( |
float |
af[3] |
) |
[inline] |
- Parameters:
- float af[3]
Specifies the color. r=af[0], g=af[1], b=af[2].
{ r = af[0]; g = af[1]; b = af[2]; }
- Parameters:
- const BMM_Color_24&
c
The 24 bit color to initialize from.
{
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f;
}
- Parameters:
- const BMM_Color_32&
c
The 32 bit color to initialize from.
{
r = float(c.r)/255.0f; g = float(c.g)/255.0f; b = float(c.b)/255.0f;
}
- Parameters:
- const BMM_Color_48&
c
The 48 bit color to initialize from.
{
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f;
}
- Parameters:
- const BMM_Color_64&
c
The 64 bit color to initialize from.
{
r = float(c.r)/65535.0f; g = float(c.g)/65535.0f; b = float(c.b)/65535.0f;
}
- Parameters:
- const
BMM_Color_fl& c
The floating point color to initialize from. No conversion or
scaling is done.
{
r = c.r; g = c.g; b = c.b;
}
Member Function Documentation
GEOMEXPORT void ClampMax |
( |
|
) |
|
GEOMEXPORT void ClampMin |
( |
|
) |
|
GEOMEXPORT void ClampMinMax |
( |
|
) |
|
float& operator[] |
( |
int |
i |
) |
[inline] |
- Parameters:
- int i
The index of the component to return.
- Returns:
- 0=r, 1=g, 2=b.
const float& operator[] |
( |
int |
i |
) |
const [inline] |
- Parameters:
- int i
The index of the component to return.
- Returns:
- 0=r, 1=g, 2=b.
operator float * |
( |
|
) |
[inline] |
operator const float * |
( |
|
) |
const [inline] |
{ return RGB(FLto255(r),FLto255(g), FLto255(b)); };
{
BMM_Color_24 c;
c.r = (BYTE) int(r*255.0f); c.g = (BYTE)int(g*255.0f); c.b = (BYTE) int(b*255.0f);
return c;
}
{
BMM_Color_32 c;
c.r = (BYTE)int(r*255.0f); c.g = (BYTE)int(g*255.0f); c.b = (BYTE)int(b*255.0f);
return c;
}
{
BMM_Color_48 c;
c.r = (WORD)int(r*65535.0f); c.g = (WORD)int(g*65535.0f); c.b = (WORD)int(b*65535.0f);
return c;
}
{
BMM_Color_64 c;
c.r = (WORD)int(r*65535.0f); c.g = (WORD)int(g*65535.0f); c.b = (WORD)int(b*65535.0f);
return c;
}
Color
operator- |
( |
|
) |
const [inline] |
- Returns:
- The Color with the
components negated, i.e.
{ return(Color(-r,-g,-b)); }
Color
operator+ |
( |
|
) |
const [inline] |
- Returns:
- The Color
itself.
- Returns:
- A Color that is the
difference between two Colors.
{
r -= a.r; g -= a.g; b -= a.b;
return *this;
}
- Returns:
- A Color that is the
sum of two Colors.
{
r += a.r; g += a.g; b += a.b;
return *this;
}
Color
& operator*= |
( |
float |
f |
) |
[inline] |
- Returns:
- A Color multiplied by
a float.
{
r *= f; g *= f; b *= f;
return *this;
}
Color
& operator/= |
( |
float |
f |
) |
[inline] |
- Returns:
- A Color divided by a
float.
{
r /= f; g /= f; b /= f;
return *this;
}
- Returns:
- A Color
element-by-element multiplied by another Color.
{
r *= a.r; g *= a.g; b *= a.b;
return *this;
}
int operator== |
( |
const Color & |
p |
) |
const [inline] |
- Returns:
- Nonzero if the Colors are equal; otherwise 0.
{ return ((p.r==r)&&(p.g==g)&&(p.b==b)); }
int operator!= |
( |
const Color & |
p |
) |
const [inline] |
- Returns:
- Nonzero if the Colors are not equal; otherwise 0.
{ return ((p.r!=r)||(p.g!=g)||(p.b!=b)); }
Color
operator- |
( |
const Color & |
c |
) |
const [inline] |
- Returns:
- A Color that is the
difference between two Colors.
Color
operator+ |
( |
const Color & |
c |
) |
const [inline] |
- Returns:
- A Color that is the
difference between two Colors.
Color
operator/ |
( |
const Color & |
c |
) |
const [inline] |
- Returns:
- A Color divided by a
Color. r/r, g/g,
b/b.
Color
operator* |
( |
const Color & |
c |
) |
const [inline] |
- Returns:
- A Color multiplied by
a Color. r*r, g*g,
b*b.
Color
operator^ |
( |
const Color & |
c |
) |
const [inline] |
Member Data Documentation
These values are in the range 0.0 to 1.0.
These values are in the range 0.0 to 1.0.
These values are in the range 0.0 to 1.0.