Rhino C++ API
8.10
|
#include <RhRdkColor.h>
Public Member Functions | |
CRhRdkColor () | |
CRhRdkColor (const CRhRdkColor &c) | |
CRhRdkColor (const float *d) | |
CRhRdkColor (const ON_4fColor &c) | |
CRhRdkColor (const ON_Color &c) | |
CRhRdkColor (float fRed, float fGreen, float fBlue, float fAlpha=1.0f) | |
CRhRdkColor (int iRed, int iGreen, int iBlue, int iAlpha=255) | |
void | Add (const CRhRdkColor &c) |
RDK_DEPRECATED bool | ApplyLinearWorkflowGamma (const class IRhRdkLinearWorkflow &lw, bool bForTexture) |
RDK_DEPRECATED bool | ApplyLinearWorkflowGamma (const CRhinoDoc *pDoc) |
bool | ApplyLinearWorkflowGamma (const ON_LinearWorkflow &lw, bool bForTexture) |
void | BlendTo (float t, const CRhRdkColor &col, bool bClampAlpha=false) |
void | Clamp (void) |
COLORREF | ColorRef (void) const |
COLORREF | ColorRefAlpha (void) const |
void * | EF (const wchar_t *wszFunc, void *pvData) |
float | FAlpha (void) const |
float | FBlue (void) const |
float | FGreen (void) const |
float * | FloatArray (void) |
const float * | FloatArray (void) const |
float | FRed (void) const |
void | GetHSL (float &h, float &s, float &l) const |
float | Hue (void) const |
UINT | IAlpha (void) const |
UINT | IBlue (void) const |
UINT | IGreen (void) const |
UINT | IRed (void) const |
bool | IsEqualWithinTolerance (const CRhRdkColor &col, double dTolerance) const |
float | Luminance (void) const |
void | MultiplyBy (float f, bool bAffectAlpha) |
ON_4fColor | On4fColor (void) const |
ON_Color | OnColor (void) const |
bool | operator!= (const CRhRdkColor &c) const |
const CRhRdkColor & | operator*= (const CRhRdkColor &c) |
const CRhRdkColor & | operator*= (float d) |
const CRhRdkColor & | operator+= (const CRhRdkColor &c) |
const CRhRdkColor & | operator+= (float d) |
const CRhRdkColor & | operator-= (const CRhRdkColor &c) |
const CRhRdkColor & | operator-= (float d) |
const CRhRdkColor & | operator/= (const CRhRdkColor &c) |
const CRhRdkColor & | operator/= (float d) |
CRhRdkColor & | operator= (const CRhRdkColor &c) |
CRhRdkColor & | operator= (const ON_4fColor &c) |
CRhRdkColor & | operator= (const ON_Color &c) |
bool | operator== (const CRhRdkColor &c) const |
float | Saturation (void) const |
void | Set (COLORREF c) |
void | Set (const float *d) |
void | Set (double dRed, double dGreen, double dBlue, double dAlpha=1.0) |
void | Set (float fRed, float fGreen, float fBlue, float fAlpha=1.0f) |
void | Set (int iRed, int iGreen, int iBlue, int iAlpha=255) |
void | SetAlpha (float fAlpha) |
void | SetAlpha (int iAlpha) |
void | SetHSL (float h, float s, float l) |
void | Subtract (const CRhRdkColor &c) |
Static Public Attributes | |
static CRhRdkColor | black |
static CRhRdkColor | white |
Friends | |
CRhRdkColor | operator* (const CRhRdkColor &c1, const CRhRdkColor &c2) |
CRhRdkColor | operator* (const CRhRdkColor &c1, float d) |
CRhRdkColor | operator* (float d, const CRhRdkColor &c1) |
CRhRdkColor | operator+ (const CRhRdkColor &c1, const CRhRdkColor &c2) |
CRhRdkColor | operator- (const CRhRdkColor &c1, const CRhRdkColor &c2) |
CRhRdkColor | operator/ (const CRhRdkColor &c1, const CRhRdkColor &c2) |
CRhRdkColor | operator/ (const CRhRdkColor &c1, float d) |
CRhRdkColor | operator/ (float d, const CRhRdkColor &c1) |
CRhRdkColor::CRhRdkColor | ( | ) |
Construct as solid black (0, 0, 0, 1).
CRhRdkColor::CRhRdkColor | ( | const float * | d | ) |
Construct from float array.
CRhRdkColor::CRhRdkColor | ( | float | fRed, |
float | fGreen, | ||
float | fBlue, | ||
float | fAlpha = 1.0f |
||
) |
Construct from floats (0.0f to MAX_FLOAT).
CRhRdkColor::CRhRdkColor | ( | int | iRed, |
int | iGreen, | ||
int | iBlue, | ||
int | iAlpha = 255 |
||
) |
Construct from integers (0 to 255).
|
explicit |
Construct from ON_4fColor.
CRhRdkColor::CRhRdkColor | ( | const CRhRdkColor & | c | ) |
Construct from another instance.
void CRhRdkColor::Add | ( | const CRhRdkColor & | c | ) |
Add another color to this color with no clamping of alpha.
RDK_DEPRECATED bool CRhRdkColor::ApplyLinearWorkflowGamma | ( | const class IRhRdkLinearWorkflow & | lw, |
bool | bForTexture | ||
) |
This method is deprecated in favor of the one below.
RDK_DEPRECATED bool CRhRdkColor::ApplyLinearWorkflowGamma | ( | const CRhinoDoc * | pDoc | ) |
This method is deprecated in favor of the other one which is faster.
bool CRhRdkColor::ApplyLinearWorkflowGamma | ( | const ON_LinearWorkflow & | lw, |
bool | bForTexture | ||
) |
Adjust the color for linear workflow gamma. If linear workflow is enabled, color is adjusted and the function returns true. Otherwise the function returns false.
void CRhRdkColor::BlendTo | ( | float | t, |
const CRhRdkColor & | col, | ||
bool | bClampAlpha = false |
||
) |
Blend this color to col using t from 0.0 to 1.0
void CRhRdkColor::Clamp | ( | void | ) |
Clamp each of the RGBA color components to be between 0.0 and 1.0.
COLORREF CRhRdkColor::ColorRef | ( | void | ) | const |
Get color as COLORREF (ignores alpha).
COLORREF CRhRdkColor::ColorRefAlpha | ( | void | ) | const |
Get color as COLORREF (with alpha in high byte).
void* CRhRdkColor::EF | ( | const wchar_t * | wszFunc, |
void * | pvData | ||
) |
Emergency function for future expansion.
float CRhRdkColor::FAlpha | ( | void | ) | const |
Get alpha value as float (0.0 to MAX_FLOAT).
float CRhRdkColor::FBlue | ( | void | ) | const |
Get blue value as float (0.0 to MAX_FLOAT).
float CRhRdkColor::FGreen | ( | void | ) | const |
Get green value as float (0.0 to MAX_FLOAT).
float* CRhRdkColor::FloatArray | ( | void | ) |
Direct read/write access to array of four floats.
const float* CRhRdkColor::FloatArray | ( | void | ) | const |
Direct read access to array of four floats.
float CRhRdkColor::FRed | ( | void | ) | const |
Get red value as float (0.0 to MAX_FLOAT).
void CRhRdkColor::GetHSL | ( | float & | h, |
float & | s, | ||
float & | l | ||
) | const |
Get the hue (0 to 360), saturation (0 to 1) and luminance (0 to 1).
float CRhRdkColor::Hue | ( | void | ) | const |
Get the hue (0 to 360).
UINT CRhRdkColor::IAlpha | ( | void | ) | const |
Get alpha value as integer (0 to 255). Clamped.
UINT CRhRdkColor::IBlue | ( | void | ) | const |
Get blue value as integer (0 to 255). Clamped.
UINT CRhRdkColor::IGreen | ( | void | ) | const |
Get green value as integer (0 to 255). Clamped.
UINT CRhRdkColor::IRed | ( | void | ) | const |
Get red value as integer (0 to 255).
bool CRhRdkColor::IsEqualWithinTolerance | ( | const CRhRdkColor & | col, |
double | dTolerance | ||
) | const |
float CRhRdkColor::Luminance | ( | void | ) | const |
Get the luminance (0 to 1).
void CRhRdkColor::MultiplyBy | ( | float | f, |
bool | bAffectAlpha | ||
) |
Multiply this color by a value with optional alpha.
ON_4fColor CRhRdkColor::On4fColor | ( | void | ) | const |
Get color as ON_4fColor.
bool CRhRdkColor::operator!= | ( | const CRhRdkColor & | c | ) | const |
Check if colors are not exactly equal.
const CRhRdkColor& CRhRdkColor::operator*= | ( | const CRhRdkColor & | c | ) |
Multiply this color by another color.
const CRhRdkColor& CRhRdkColor::operator*= | ( | float | d | ) |
Multiply this color by a value.
const CRhRdkColor& CRhRdkColor::operator+= | ( | const CRhRdkColor & | c | ) |
Add another color to this color.
const CRhRdkColor& CRhRdkColor::operator+= | ( | float | d | ) |
Add a value to this color.
const CRhRdkColor& CRhRdkColor::operator-= | ( | const CRhRdkColor & | c | ) |
Subtract another color from this color.
const CRhRdkColor& CRhRdkColor::operator-= | ( | float | d | ) |
Subtract a value from this color.
const CRhRdkColor& CRhRdkColor::operator/= | ( | const CRhRdkColor & | c | ) |
Divide this color by another color.
const CRhRdkColor& CRhRdkColor::operator/= | ( | float | d | ) |
Divide this color by a value.
CRhRdkColor& CRhRdkColor::operator= | ( | const CRhRdkColor & | c | ) |
Copy color from another instance.
CRhRdkColor& CRhRdkColor::operator= | ( | const ON_4fColor & | c | ) |
Copy color from an ON_4fColor instance.
CRhRdkColor& CRhRdkColor::operator= | ( | const ON_Color & | c | ) |
Copy color from an ON_Color instance.
bool CRhRdkColor::operator== | ( | const CRhRdkColor & | c | ) | const |
Check if colors are exactly equal.
float CRhRdkColor::Saturation | ( | void | ) | const |
Get the saturation (0 to 1).
void CRhRdkColor::Set | ( | COLORREF | c | ) |
Set color from lowest 24 bits of a COLORREF. Alpha is set to 1.0f.
void CRhRdkColor::Set | ( | const float * | d | ) |
Set color from float array.
void CRhRdkColor::Set | ( | double | dRed, |
double | dGreen, | ||
double | dBlue, | ||
double | dAlpha = 1.0 |
||
) |
Set color as doubles (0.0 to MAX_FLOAT).
void CRhRdkColor::Set | ( | float | fRed, |
float | fGreen, | ||
float | fBlue, | ||
float | fAlpha = 1.0f |
||
) |
Set color as floats (0.0 to MAX_FLOAT).
void CRhRdkColor::Set | ( | int | iRed, |
int | iGreen, | ||
int | iBlue, | ||
int | iAlpha = 255 |
||
) |
Set color as ints (0 to 255).
void CRhRdkColor::SetAlpha | ( | float | fAlpha | ) |
Set alpha channel only.
void CRhRdkColor::SetAlpha | ( | int | iAlpha | ) |
Set alpha channel only.
void CRhRdkColor::SetHSL | ( | float | h, |
float | s, | ||
float | l | ||
) |
Set the hue (0 to 360), saturation (0 to 1) and luminance (0 to 1).
void CRhRdkColor::Subtract | ( | const CRhRdkColor & | c | ) |
Subtract another color from this color with no clamping of alpha.
|
friend |
Multiply two colors.
|
friend |
Multiply a color by a value.
|
friend |
Multiply a value by a color.
|
friend |
Add two colors.
|
friend |
Subtract two colors.
|
friend |
Divide a color by a color.
|
friend |
Divide a color by a value.
|
friend |
Divide a value by a color.
|
static |
|
static |