#include <mi32/color.h>
Public Types | |
| enum | FLAGS { STATUS_ValueSet = 0x0001, STATUS_Reserved = 0x0004, STATUS_Invisible = 0x0008, STATUS_ICMCorrected = 0x0020, STATUS_NonRGB = 0x0080, MASK_Compare = 0xFFE9, MASK_CompareNoTransp = 0x00E5, MASK_Transparency = 0xFF00, LEGACY_Invalid = 0xFFFF } |
| enum | NAME { BLACK = 0x00000000, RED = 0x000000FF, GREEN = 0x0000FF00, BLUE = 0x00FF0000, CYAN = 0x00FFFF00, MAGENTA = 0x00FF00FF, YELLOW = 0x0000FFFF, GRAY25 = 0x003F3F3F, GRAY50 = 0x007F7F7F, GRAY75 = 0x00BFBFBF, GRAY = GRAY50, ORANGE = 0x0000A5FF, BROWN = 0x00A52A2A, PURPLE = 0x00A020F0, DARKRED = 0x00000080, DARKGREEN = 0x00008000, DARKBLUE = 0x00800000, DARKCYAN = 0x00808000, DARKMAGENTA = 0x00A000A0, DARKYELLOW = 0x00008080, FORESTGREEN = 0x00228B22, WHITE = 0x00FFFFFF } |
Public Member Functions | |
| void | Blend (const COLOR &other, UINT8 alpha=128) |
| void | Clear () |
| COLOR (NAME name) | |
| COLOR (UINT32 ColorRef) | |
| COLOR (UINT16 red, UINT16 green, UINT16 blue) | |
| COLOR () | |
| UINT16 | GetBlue (UINT16 range) const |
| UINT16 | GetBlue () const |
| UINT8 | GetBlueByte () const |
| ERRVALUE | GetByColorSpace (COLORSPACE colorspace, void *values) const |
| COLORMODEL | GetColorModel () const |
| UINT32 | GetColorRef () const |
| UINT16 | GetGreen (UINT16 range) const |
| UINT16 | GetGreen () const |
| UINT8 | GetGreenByte () const |
| UINT8 | GetOpacity () const |
| UINT16 | GetRed (UINT16 range) const |
| UINT16 | GetRed () const |
| UINT8 | GetRedByte () const |
| void | GetRGB (UINT16 &red, UINT16 &green, UINT16 &blue) const |
| UINT8 | GetTransparency () const |
| bool | HasTransparency () const |
| bool | HasValue () const |
| bool | IsEqualNoTransp (const COLOR &rhs) const |
| bool | IsEqualTo (const COLOR &rhs) const |
| bool | IsICMCorrected () const |
| bool | IsInvisible () const |
| bool | IsReserved () const |
| COLOR & | operator= (COLOR::NAME name) |
| void | SerialGetString (char *string) const |
| void | SerialSetString (const char *string) |
| ERRVALUE | SetByColorSpace (COLORSPACE colorspace, const void *values) |
| bool | SetByName (const char *string) |
| void | SetCMY (int cyan, int magenta, int yellow, int range) |
| void | SetCMYK (int cyan, int magenta, int yellow, int black, int range) |
| void | SetColorRef (UINT32 ColorRef) |
| void | SetIsICMCorrected (bool bCorrected) |
| void | SetOpacity (UINT8 opacity) |
| void | SetReserved (bool reserved=true) |
| void | SetRGB (int red, int green, int blue, int range) |
| void | SetRGB (const COLOR &color) |
| void | SetRGB (UINT16 red, UINT16 green, UINT16 blue) |
| void | SetTransparency (UINT8 transparency) |
| void | Validate () |
This structure is stored in files and will never change in size.
Definition at line 207 of file color.h.
| enum COLOR::FLAGS |
| enum COLOR::NAME |
| COLOR::COLOR | ( | UINT32 | ColorRef | ) | [inline, explicit] |
| COLOR::COLOR | ( | NAME | name | ) | [inline] |
| UINT16 COLOR::GetBlue | ( | ) | const [inline] |
| UINT8 COLOR::GetBlueByte | ( | ) | const [inline] |
| ERRVALUE COLOR::GetByColorSpace | ( | COLORSPACE | colorspace, | |
| void * | values | |||
| ) | const |
Get values in specified COLORSPACE.
For colorspaces containing an "alpha" component, "alpha" is considered to be "opacity". Binary, grayscale and indexed colorspaces are not supported and an error will be returned for such.
| colorspace | Color space |
| values | Buffer to hold returned values, size depends on colorspace |
| COLORMODEL COLOR::GetColorModel | ( | ) | const [inline] |
| UINT32 COLOR::GetColorRef | ( | ) | const [inline] |
| UINT16 COLOR::GetGreen | ( | ) | const [inline] |
| UINT8 COLOR::GetGreenByte | ( | ) | const [inline] |
| UINT8 COLOR::GetOpacity | ( | ) | const [inline] |
| UINT16 COLOR::GetRed | ( | ) | const [inline] |
| UINT8 COLOR::GetRedByte | ( | ) | const [inline] |
| UINT8 COLOR::GetTransparency | ( | ) | const [inline] |
| bool COLOR::HasTransparency | ( | ) | const [inline] |
| bool COLOR::HasValue | ( | ) | const [inline] |
| bool COLOR::IsEqualNoTransp | ( | const COLOR & | rhs | ) | const [inline] |
| bool COLOR::IsEqualTo | ( | const COLOR & | rhs | ) | const [inline] |
| bool COLOR::IsICMCorrected | ( | ) | const [inline] |
| bool COLOR::IsInvisible | ( | ) | const [inline] |
| bool COLOR::IsReserved | ( | ) | const [inline] |
| COLOR& COLOR::operator= | ( | COLOR::NAME | name | ) | [inline] |
| void COLOR::SerialGetString | ( | char * | string | ) | const |
Get as string for serializer writing.
| string | String to contain values, should be at least 32 bytes |
| void COLOR::SerialSetString | ( | const char * | string | ) |
Set from string for serializer reading.
| string | String to set from |
| ERRVALUE COLOR::SetByColorSpace | ( | COLORSPACE | colorspace, | |
| const void * | values | |||
| ) |
Set values using specified COLORSPACE.
For colorspaces containing an "alpha" component, "alpha" is considered to be "opacity". Binary, grayscale and indexed colorspaces are not supported and an error will be returned for such.
| colorspace | Color space |
| values | Buffer holding values to set, size depends on colorspace |
| bool COLOR::SetByName | ( | const char * | string | ) |
Set color by name string.
| string | Color name, case-insensitive |
| void COLOR::SetCMY | ( | int | cyan, | |
| int | magenta, | |||
| int | yellow, | |||
| int | range | |||
| ) | [inline] |
| void COLOR::SetCMYK | ( | int | cyan, | |
| int | magenta, | |||
| int | yellow, | |||
| int | black, | |||
| int | range | |||
| ) | [inline] |
| void COLOR::SetColorRef | ( | UINT32 | ColorRef | ) | [inline] |
| void COLOR::SetIsICMCorrected | ( | bool | bCorrected | ) | [inline] |
Specify whether the color has been run through an ICM transformation.
This is used to insure that the same color isn't translated more than once. Of course there's no way to specify which target profile it's been corrected to. ICM-corrected colors should never be stored in files unless the whole file is corrected to some target device profile.
| void COLOR::SetOpacity | ( | UINT8 | opacity | ) | [inline] |
| void COLOR::SetReserved | ( | bool | reserved = true |
) | [inline] |
| void COLOR::SetRGB | ( | int | red, | |
| int | green, | |||
| int | blue, | |||
| int | range | |||
| ) | [inline] |
| void COLOR::SetRGB | ( | const COLOR & | color | ) | [inline] |
| void COLOR::SetTransparency | ( | UINT8 | transparency | ) | [inline] |
| void COLOR::Validate | ( | ) | [inline] |
1.5.2