#include <djv_common.h>
Public Member Functions | |
| Color (u32 inColor=InvalidColor) | |
| Color (u8 inRed, u8 inGreen, u8 inBlue, u8 inReserved=0) | |
| Color (const Color &inColor) | |
| Color & | operator= (const Color &inColor) |
| Color & | operator= (u32 inColor) |
| u8 | getRed () const |
| u8 | getGreen () const |
| u8 | getBlue () const |
| u8 | getReserved () const |
| bool | isValid () const |
| bool | operator< (const Color &r) const |
| bool | operator== (const Color &r) const |
| bool | operator!= (const Color &r) const |
| size_t | getDist2 (const Color &r) const |
Static Public Member Functions | |
| static Color | fromRGB (const u8 *inSrc) |
| static Color | fromBGR (const u8 *inSrc) |
| static Color | fromYCbCr (const u8 *inSrc) |
| static Color | fromGray (const u8 *inSrc) |
Public Attributes | |
| u32 | color |
Static Public Attributes | |
| static const u32 | InvalidColor = 0xffffffff |
Definition at line 70 of file djv_common.h.
| Celartem::DjVu::Color::Color | ( | u32 | inColor = InvalidColor |
) | [inline] |
Initialize with a color.
| inColor | Color in 0xRRGGBB format. The default is InvalidColor. |
Definition at line 89 of file djv_common.h.
Referenced by fromBGR(), fromGray(), and fromRGB().
Initialize with a color.
| inRed | ||
| inGreen | ||
| inBlue | ||
| inReserved | Every component of a color. |
Definition at line 101 of file djv_common.h.
| Celartem::DjVu::Color::Color | ( | const Color & | inColor | ) | [inline] |
Copy a Color instance.
| inColor | A Color instance. |
Definition at line 111 of file djv_common.h.
Copy a Color instance.
| inColor | A Color instance. |
Definition at line 120 of file djv_common.h.
| u8 Celartem::DjVu::Color::getRed | ( | ) | const [inline] |
Get the red value.
Definition at line 147 of file djv_common.h.
Referenced by getDist2().
| u8 Celartem::DjVu::Color::getGreen | ( | ) | const [inline] |
Get the green value.
Definition at line 154 of file djv_common.h.
Referenced by getDist2().
| u8 Celartem::DjVu::Color::getBlue | ( | ) | const [inline] |
Get the blue value.
Definition at line 161 of file djv_common.h.
Referenced by getDist2().
| u8 Celartem::DjVu::Color::getReserved | ( | ) | const [inline] |
Get the reserved value (the highest 8-bits).
Definition at line 168 of file djv_common.h.
| bool Celartem::DjVu::Color::isValid | ( | ) | const [inline] |
Determines whether the color is valid or not.
The definition of the valid colors is that the highest 8bit are all 0. In other words, color is smaller than 0x1000000.
true if the color is valid; otherwise false. Definition at line 179 of file djv_common.h.
Create a new Color instance from R-G-B data.
| inSrc | 8-bit R-G-B data. |
Definition at line 188 of file djv_common.h.
Create a new Color instance from B-G-R data.
| inSrc | 8-bit B-G-R data. |
Definition at line 200 of file djv_common.h.
Create a new Color instance from gray data.
| inSrc | 8-bit gray data. |
Definition at line 221 of file djv_common.h.
| bool Celartem::DjVu::Color::operator< | ( | const Color & | r | ) | const [inline] |
Compare this instance with another.
| r | Another Color instance to compare with. |
true if the color member of this Color instance is less than the one of r. Definition at line 234 of file djv_common.h.
| bool Celartem::DjVu::Color::operator== | ( | const Color & | r | ) | const [inline] |
Compare this instance with another (check equality).
| r | Another Color instance to compare with. |
true if the color member of this Color instance is equal to the one of r. Definition at line 247 of file djv_common.h.
| bool Celartem::DjVu::Color::operator!= | ( | const Color & | r | ) | const [inline] |
Compare this instance with another (check inequality).
| r | Another Color instance to compare with. |
true if the color member of this Color instance is not equal to the one of r. Definition at line 260 of file djv_common.h.
| size_t Celartem::DjVu::Color::getDist2 | ( | const Color & | r | ) | const [inline] |
Get square of the distance between this and another.
| r | Another Color instance to calculate the distance with. |
Definition at line 272 of file djv_common.h.
const u32 Celartem::DjVu::Color::InvalidColor = 0xffffffff [static] |
This represents a color is not initialized or unspecified.
isValid return false for InvalidColor.
Definition at line 77 of file djv_common.h.
Color in 0xRRGGBB format.
Definition at line 82 of file djv_common.h.
Referenced by getBlue(), getGreen(), getRed(), getReserved(), isValid(), operator!=(), operator<(), operator=(), and operator==().