Defines an RGBA color (with alpha channel).
More...
#include <ModelData_Color.hxx>
|
typedef float | value_type |
|
typedef float | ValueType |
|
|
| ModelData_Color (float r, float g, float b, float a=1.f) |
| Constructor.
|
|
| ModelData_Color (int r, int g, int b, int a=255) |
| Constructor.
|
|
| ModelData_Color (int argb) |
| Constructor.
|
|
float | R () const |
|
float & | R () |
|
float | G () const |
|
float & | G () |
|
float | B () const |
|
float & | B () |
|
float | A () const |
| Returns alpha-channel.
|
|
float & | A () |
| Returns alpha-channel.
|
|
const value_type & | Value (size_t theIndex) const |
|
const value_type & | operator[] (size_t theIndex) const |
|
value_type & | operator[] (size_t theIndex) |
|
void | SetValue (const value_type &theVal) |
|
void | SetValue (int theIndex, const value_type &theVal) |
|
void | Set (float r, float g, float b, float a=1.f) |
| Sets individual color components.
|
|
void | Set (int r, int g, int b, int a=255) |
| Sets individual color components.
|
|
bool | IsValid () const |
|
|
static float | Precision () |
|
Defines an RGBA color (with alpha channel).
Components must be within a [0, 1] range.
- Examples
- MTKConverter/Program.cs, MTKConverter/main.cxx, exploring/polyrepresentation/Program.cs, exploring/polyrepresentation/main.cxx, modeling/assembly/Program.cs, modeling/assembly/main.cxx, modeling/metadata/Program.cs, modeling/metadata/main.cxx, modeling/poly/Program.cs, modeling/poly/main.cxx, visualization/offscreen/Program.cs, visualization/offscreen/main.cxx, visualization/qtquick_qml/measurements/main.cxx, visualization/qtquick_qml/pmiviewer/main.cxx, visualization/wpf/customizedviewer/App.xaml.cs, and visualization/wpf/pmiviewer/App.xaml.cs.
◆ ModelData_Color() [1/3]
cadex::ModelData_Color::ModelData_Color |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1.f |
|
) |
| |
|
inline |
Constructor.
Creates a color with explicit values. Each value must be within [0, 1] range.
◆ ModelData_Color() [2/3]
cadex::ModelData_Color::ModelData_Color |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a = 255 |
|
) |
| |
|
inline |
Constructor.
Creates a color with explicit values. Each value must be within [0, 255] range.
◆ ModelData_Color() [3/3]
cadex::ModelData_Color::ModelData_Color |
( |
int |
argb | ) |
|
|
inlineexplicit |
Constructor.
Creates a color with explicit argb value
◆ operator[]() [1/2]
value_type & cadex::ModelData_Color::operator[] |
( |
size_t |
theIndex | ) |
|
|
inline |
theIndex must be in the [0, n) range.
◆ operator[]() [2/2]
const value_type & cadex::ModelData_Color::operator[] |
( |
size_t |
theIndex | ) |
const |
|
inline |
theIndex must be in the [0, n) range.
◆ SetValue()
void cadex::ModelData_Color::SetValue |
( |
int |
theIndex, |
|
|
const value_type & |
theVal |
|
) |
| |
theIndex must be in the [0, n) range.
◆ Value()
const value_type & cadex::ModelData_Color::Value |
( |
size_t |
theIndex | ) |
const |
|
inline |
theIndex must be in the [0, n) range.