csRGBpixel Struct Reference
[Graphics]
An RGB pixel.
More...
#include <csgfx/rgbpixel.h>
Public Member Functions | |
csRGBpixel (int r, int g, int b, int a=255) | |
Initialize the pixel with some R/G/B/A value. | |
csRGBpixel (const csRGBcolor &c) | |
Construct from a csRGBcolor object; sets alpha to 255. | |
csRGBpixel (const csRGBpixel &p) | |
Copy constructor. | |
csRGBpixel () | |
Constructor (initialize to zero, alpha to 255). | |
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. | |
operator csRGBcolor () const | |
Construct an csRGBcolor from this csRGBpixel. | |
bool | operator!= (const csRGBpixel &p) const |
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha). | |
bool | operator!= (const csRGBcolor &c) const |
Check if the csRGBpixel is not equal to an csRGBcolor. | |
void | operator+= (const csRGBcolor &c) |
Add a csRGBcolor (may overflow!). | |
bool | operator== (const csRGBpixel &p) const |
Compare with an csRGBpixel (including alpha value). | |
bool | operator== (const csRGBcolor &c) const |
Compare with an csRGBcolor. | |
void | SafeAdd (const csRGBpixel &c) |
Use this in the general case. | |
void | Set (const csRGBpixel &p) |
Assign another csRGBpixel. | |
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 | UnsafeAdd (const csRGBpixel &c) |
Use this only if you know there is no overflow. | |
Public Attributes | |
unsigned char | alpha |
unsigned char | blue |
unsigned char | green |
unsigned char | red |
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 152 of file rgbpixel.h.
Constructor & Destructor Documentation
csRGBpixel::csRGBpixel | ( | ) | [inline] |
csRGBpixel::csRGBpixel | ( | const csRGBpixel & | p | ) | [inline] |
csRGBpixel::csRGBpixel | ( | const csRGBcolor & | c | ) | [inline] |
csRGBpixel::csRGBpixel | ( | int | r, | |
int | g, | |||
int | b, | |||
int | a = 255 | |||
) | [inline] |
Member Function Documentation
bool csRGBpixel::eq | ( | const csRGBpixel & | p | ) | const [inline] |
Compare with another csRGBpixel, but don't take alpha into account.
Definition at line 189 of file rgbpixel.h.
References operator==().
int csRGBpixel::Intensity | ( | ) | const [inline] |
unsigned char csRGBpixel::Luminance | ( | ) | const [inline] |
csRGBpixel::operator csRGBcolor | ( | ) | const [inline] |
bool csRGBpixel::operator!= | ( | const csRGBpixel & | p | ) | const [inline] |
Check if this csRGBpixel is not equal to another csRGBpixel (including alpha).
Definition at line 183 of file rgbpixel.h.
References operator==().
bool csRGBpixel::operator!= | ( | const csRGBcolor & | c | ) | const [inline] |
Check if the csRGBpixel is not equal to an csRGBcolor.
Definition at line 177 of file rgbpixel.h.
References operator==().
void csRGBpixel::operator+= | ( | const csRGBcolor & | c | ) | [inline] |
Add a csRGBcolor (may overflow!).
Definition at line 211 of file rgbpixel.h.
References csRGBcolor::blue, blue, csRGBcolor::green, green, csRGBcolor::red, and red.
bool csRGBpixel::operator== | ( | const csRGBpixel & | p | ) | const [inline] |
bool csRGBpixel::operator== | ( | const csRGBcolor & | c | ) | const [inline] |
Compare with an csRGBcolor.
Definition at line 171 of file rgbpixel.h.
References blue, csRGBcolor::blue, green, csRGBcolor::green, red, and csRGBcolor::red.
Referenced by eq(), and operator!=().
void csRGBpixel::SafeAdd | ( | const csRGBpixel & | c | ) | [inline] |
Use this in the general case.
This version test for overflow. Note that alpha is ignored by this routine.
Definition at line 231 of file rgbpixel.h.
void csRGBpixel::Set | ( | const csRGBpixel & | p | ) | [inline] |
void csRGBpixel::Set | ( | const int | r, | |
const int | g, | |||
const int | b, | |||
const int | a = 255 | |||
) | [inline] |
void csRGBpixel::UnsafeAdd | ( | const csRGBpixel & | c | ) | [inline] |
Use this only if you know there is no overflow.
Also take care to set alpha to 0 in 'c'!
Definition at line 221 of file rgbpixel.h.
Member Data Documentation
unsigned char csRGBpixel::red |
The red, green, blue and alpha components.
Definition at line 155 of file rgbpixel.h.
Referenced by csShaderVariable::GetValue(), Intensity(), Luminance(), operator csRGBcolor(), operator+=(), 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.4.7