csRGBpixel Struct Reference
[Graphics]
An RGB pixel.
More...
#include <csgfx/rgbpixel.h>
Public Member Functions | |
csRGBpixel () | |
Constructor (initialize to zero, alpha to 255). | |
csRGBpixel (const csRGBpixel &p) | |
Copy constructor. | |
csRGBpixel (const csRGBcolor &c) | |
Construct from a csRGBcolor object; sets alpha to 255. | |
csRGBpixel (int r, int g, int b, int a=255) | |
Initialize the pixel with some R/G/B/A value. | |
bool | operator== (const csRGBcolor &c) const |
Compare with an csRGBcolor. | |
bool | operator== (const csRGBpixel &p) const |
Compare with an csRGBpixel (including alpha value). | |
bool | operator!= (const csRGBcolor &c) const |
Check if the csRGBpixel is not equal to an csRGBcolor. | |
bool | operator!= (const csRGBpixel &p) const |
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha). | |
operator csRGBcolor () const | |
Construct an csRGBcolor from this csRGBpixel. | |
bool | eq (const csRGBpixel &p) const |
Compare with another csRGBpixel, but don't take alpha into account. | |
int | Intensity () const |
Get the pixel intensity. | |
unsigned char | Luminance () const |
Get the pixel luminance. | |
void | Set (const int r, const int g, const int b, const int a=255) |
Assign given red/green/blue/alpha values to this pixel. | |
void | Set (const csRGBpixel &p) |
Assign another csRGBpixel. | |
void | operator+= (const csRGBcolor &c) |
Add a csRGBcolor. | |
void | UnsafeAdd (const csRGBpixel &c) |
Use this only if you know there is no overflow. | |
void | SafeAdd (const csRGBpixel &c) |
Use this in the general case. | |
Public Attributes | |
unsigned char | red |
The red, green, blue and alpha components. | |
unsigned char | green |
The red, green, blue and alpha components. | |
unsigned char | blue |
The red, green, blue and alpha components. | |
unsigned char | alpha |
The red, green, blue and alpha components. |
Detailed Description
An RGB pixel.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 100 of file rgbpixel.h.
Constructor & Destructor Documentation
|
Constructor (initialize to zero, alpha to 255).
Definition at line 105 of file rgbpixel.h. |
|
Copy constructor.
Definition at line 107 of file rgbpixel.h. |
|
Construct from a csRGBcolor object; sets alpha to 255.
Definition at line 110 of file rgbpixel.h. |
|
Initialize the pixel with some R/G/B/A value.
Definition at line 113 of file rgbpixel.h. |
Member Function Documentation
|
Compare with another csRGBpixel, but don't take alpha into account.
Definition at line 137 of file rgbpixel.h. |
|
Get the pixel intensity.
Definition at line 140 of file rgbpixel.h. |
|
Get the pixel luminance.
Definition at line 143 of file rgbpixel.h. |
|
Construct an csRGBcolor from this csRGBpixel.
Definition at line 134 of file rgbpixel.h. |
|
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha).
Definition at line 131 of file rgbpixel.h. |
|
Check if the csRGBpixel is not equal to an csRGBcolor.
Definition at line 125 of file rgbpixel.h. |
|
Add a csRGBcolor.
Definition at line 159 of file rgbpixel.h. References csRGBcolor::blue, csRGBcolor::green, and csRGBcolor::red. |
|
Compare with an csRGBpixel (including alpha value).
Definition at line 122 of file rgbpixel.h. |
|
Compare with an csRGBcolor.
Definition at line 119 of file rgbpixel.h. References csRGBcolor::blue, csRGBcolor::green, and csRGBcolor::red. |
|
Use this in the general case. This version test for overflow. Note that alpha is ignored by this routine. Definition at line 179 of file rgbpixel.h. |
|
Assign another csRGBpixel.
Definition at line 156 of file rgbpixel.h. |
|
Assign given red/green/blue/alpha values to this pixel.
Definition at line 148 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 169 of file rgbpixel.h. |
Member Data Documentation
|
The red, green, blue and alpha components.
Definition at line 103 of file rgbpixel.h. Referenced by csShaderVariable::GetValue(), csPackRGBA::PackRGBpixelToRGBA(), Set(), csShaderVariable::SetValue(), and csPackRGBA::UnpackRGBAtoRGBpixel(). |
|
The red, green, blue and alpha components.
Definition at line 103 of file rgbpixel.h. Referenced by csImageMemory::GetKeyColor(), csShaderVariable::GetValue(), operator==(), csPackRGB::PackRGBpixelToRGB(), csPackRGBA::PackRGBpixelToRGBA(), SafeAdd(), Set(), csShaderVariable::SetValue(), csPackRGBA::UnpackRGBAtoRGBpixel(), csPackRGB::UnpackRGBtoRGBpixelBuffer(), and UnsafeAdd(). |
|
The red, green, blue and alpha components.
Definition at line 103 of file rgbpixel.h. Referenced by csImageMemory::GetKeyColor(), csShaderVariable::GetValue(), operator==(), csPackRGB::PackRGBpixelToRGB(), csPackRGBA::PackRGBpixelToRGBA(), SafeAdd(), Set(), csShaderVariable::SetValue(), csPackRGBA::UnpackRGBAtoRGBpixel(), csPackRGB::UnpackRGBtoRGBpixelBuffer(), and UnsafeAdd(). |
|
The red, green, blue and alpha components.
Definition at line 103 of file rgbpixel.h. Referenced by csImageMemory::GetKeyColor(), csShaderVariable::GetValue(), operator==(), csPackRGB::PackRGBpixelToRGB(), csPackRGBA::PackRGBpixelToRGBA(), SafeAdd(), Set(), csShaderVariable::SetValue(), csPackRGBA::UnpackRGBAtoRGBpixel(), csPackRGB::UnpackRGBtoRGBpixelBuffer(), and UnsafeAdd(). |
The documentation for this struct was generated from the following file:
- csgfx/rgbpixel.h
Generated for Crystal Space by doxygen 1.3.9.1