![]() |
Public API Reference |
#include <rgbpixel.h>
Public Methods | |
csRGBpixel () | |
Constructor (initialize to zero, alpha to 255). More... | |
csRGBpixel (const csRGBpixel &p) | |
Copy constructor. More... | |
csRGBpixel (const csRGBcolor &c) | |
Yet another copy constructor. More... | |
csRGBpixel (int r, int g, int b) | |
Initialize the pixel with some R/G/B value. More... | |
bool | operator== (const csRGBcolor &c) const |
Compare with an csRGBcolor. More... | |
bool | operator== (const csRGBpixel &p) const |
Compare with an csRGBpixel (including alpha value). More... | |
bool | operator!= (const csRGBcolor &c) const |
Check if the csRGBpixel is not equal to an csRGBcolor. More... | |
bool | operator!= (const csRGBpixel &p) const |
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha). More... | |
operator csRGBcolor () const | |
Construct an csRGBcolor from this csRGBpixel. More... | |
bool | eq (const csRGBpixel &p) const |
Compare with another csRGBpixel, but don't take alpha into account. More... | |
int | Intensity () |
Get the pixel intensity. More... | |
unsigned char | Luminance () |
Get the pixel luminance. More... | |
void | Set (const int r, const int g, const int b) |
Assign given red/green/blue values to this pixel. More... | |
void | Set (const int r, const int g, const int b, const int a) |
Assign given red/green/blue/alpha values to this pixel. More... | |
void | Set (const csRGBpixel &p) |
Assign another csRGBpixel. More... | |
void | operator+= (const csRGBcolor &c) |
Add a csRGBcolor. More... | |
void | UnsafeAdd (const csRGBpixel &c) |
Use this only if you know there is no overflow. More... | |
void | SafeAdd (const csRGBpixel &c) |
Use this in the general case. More... | |
Public Attributes | |
unsigned char | red |
The red, green, blue and alpha components. More... | |
unsigned char | green |
The red, green, blue and alpha components. More... | |
unsigned char | blue |
The red, green, blue and alpha components. More... | |
unsigned char | alpha |
The red, green, blue and alpha components. More... |
In addition to R,G,B color components this structure also contains the Alpha channel component, which is used in images (that potentially have an alpha channel).
Definition at line 101 of file rgbpixel.h.
|
Constructor (initialize to zero, alpha to 255).
Definition at line 106 of file rgbpixel.h. References uint32. |
|
Copy constructor.
Definition at line 109 of file rgbpixel.h. References uint32. |
|
Yet another copy constructor.
Definition at line 113 of file rgbpixel.h. |
|
Initialize the pixel with some R/G/B value.
Definition at line 116 of file rgbpixel.h. |
|
Compare with another csRGBpixel, but don't take alpha into account.
Definition at line 138 of file rgbpixel.h. References uint32. |
|
Get the pixel intensity.
Definition at line 141 of file rgbpixel.h. |
|
Get the pixel luminance.
Definition at line 144 of file rgbpixel.h. |
|
Construct an csRGBcolor from this csRGBpixel.
Definition at line 135 of file rgbpixel.h. |
|
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha).
Definition at line 132 of file rgbpixel.h. References operator==. |
|
Check if the csRGBpixel is not equal to an csRGBcolor.
Definition at line 126 of file rgbpixel.h. References operator==. |
|
Add a csRGBcolor.
Definition at line 157 of file rgbpixel.h. References csRGBcolor::blue, blue, csRGBcolor::green, green, csRGBcolor::red, and red. |
|
Compare with an csRGBpixel (including alpha value).
Definition at line 122 of file rgbpixel.h. References uint32. |
|
Compare with an csRGBcolor.
Definition at line 119 of file rgbpixel.h. References blue, csRGBcolor::blue, green, csRGBcolor::green, red, and csRGBcolor::red. Referenced by operator!=. |
|
Use this in the general case. This version test for overflow. Note that alpha is ignored by this routine. Definition at line 173 of file rgbpixel.h. |
|
Assign another csRGBpixel.
Definition at line 153 of file rgbpixel.h. References uint32. |
|
Assign given red/green/blue/alpha values to this pixel.
Definition at line 150 of file rgbpixel.h. |
|
Assign given red/green/blue values to this pixel.
Definition at line 147 of file rgbpixel.h. |
|
Use this only if you know there is no overflow. Also take care to set alpha to 0 in 'c'! Definition at line 167 of file rgbpixel.h. References uint32. |
|
The red, green, blue and alpha components.
Definition at line 104 of file rgbpixel.h. Referenced by csEffectVector4::csEffectVector4, csPackRGBpixelToRGBA, csRGBpixel, csUnpackRGBAtoRGBpixel, and Set. |
|
The red, green, blue and alpha components.
Definition at line 104 of file rgbpixel.h. Referenced by csEffectVector4::csEffectVector4, csPackRGBpixelToRGB, csPackRGBpixelToRGBA, csRGBpixel, csUnpackRGBAtoRGBpixel, Intensity, Luminance, operator csRGBcolor, operator+=, operator==, SafeAdd, and Set. |
|
The red, green, blue and alpha components.
Definition at line 104 of file rgbpixel.h. Referenced by csEffectVector4::csEffectVector4, csPackRGBpixelToRGB, csPackRGBpixelToRGBA, csRGBpixel, csUnpackRGBAtoRGBpixel, Intensity, Luminance, operator csRGBcolor, operator+=, operator==, SafeAdd, and Set. |
|
The red, green, blue and alpha components.
Definition at line 104 of file rgbpixel.h. Referenced by csEffectVector4::csEffectVector4, csPackRGBpixelToRGB, csPackRGBpixelToRGBA, csRGBpixel, csUnpackRGBAtoRGBpixel, Intensity, Luminance, operator csRGBcolor, operator+=, operator==, SafeAdd, and Set. |