#include <cartotype_color.h>
|
static int32_t | Grey (int32_t aRed, int32_t aGreen, int32_t aBlue) |
|
A color.
Colors are represented by 32-bit integers containing 8 bits each of red, green, blue and alpha channel (transparency) data.
◆ TColor() [1/5]
CartoType::TColor::TColor |
( |
| ) |
|
|
inline |
Creates a color and set it to opaque black.
◆ TColor() [2/5]
CartoType::TColor::TColor |
( |
uint32_t |
aValue | ) |
|
|
inline |
Creates a color from an integer value.
◆ TColor() [3/5]
CartoType::TColor::TColor |
( |
int32_t |
aRed, |
|
|
int32_t |
aGreen, |
|
|
int32_t |
aBlue, |
|
|
int32_t |
aAlpha = 0xFF |
|
) |
| |
|
inline |
Creates a color from red, green, blue and alpha values.
◆ TColor() [4/5]
CartoType::TColor::TColor |
( |
const MString & |
aColor | ) |
|
|
explicit |
Creates a color from a color expression as used in style sheets.
◆ TColor() [5/5]
CartoType::TColor::TColor |
( |
const CString & |
aColor | ) |
|
|
explicit |
Creates a color from a color expression as used in style sheets.
◆ Alpha()
int32_t CartoType::TColor::Alpha |
( |
| ) |
const |
|
inline |
Returns the alpha (transparency) level as a value in the range 0...255: 0 = transparent, 255 = opaque.
◆ Blend() [1/2]
void CartoType::TColor::Blend |
( |
TColor |
aOtherColor | ) |
|
Blends aOtherColor with this color in the proportion specified by the other color's alpha value, preserving this color's alpha value.
◆ Blend() [2/2]
void CartoType::TColor::Blend |
( |
TColor |
aOtherColor, |
|
|
int32_t |
aOtherColorAlpha |
|
) |
| |
Blends aOtherColor with this color in the proportion specified by aOtherColorAlpha, which must be in the range 0...255.
◆ Blue()
int32_t CartoType::TColor::Blue |
( |
| ) |
const |
|
inline |
Returns the blue component as a value in the range 0...255.
◆ CombineAlpha()
void CartoType::TColor::CombineAlpha |
( |
int32_t |
aAlpha | ) |
|
Multiplies the current alpha value by a new alpha value in the range 0...255.
◆ Gray()
int32_t CartoType::TColor::Gray |
( |
| ) |
const |
|
inline |
◆ Green()
int32_t CartoType::TColor::Green |
( |
| ) |
const |
|
inline |
Returns the green component as a value in the range 0...255.
◆ Grey() [1/2]
int32_t CartoType::TColor::Grey |
( |
| ) |
const |
|
inline |
Returns the grey level as a value in the range 0...255. Uses the formula Grey = (Red * 0.299 + Green * 0.587 + Blue * 0.114), derived from the BT.601 standard.
◆ Grey() [2/2]
static int32_t CartoType::TColor::Grey |
( |
int32_t |
aRed, |
|
|
int32_t |
aGreen, |
|
|
int32_t |
aBlue |
|
) |
| |
|
inlinestatic |
Returns a grey level as a value in the range 0...255, calculated from red, green and blue levels in that range. Uses the formula Grey = (Red * 0.299 + Green * 0.587 + Blue * 0.114), derived from the BT.601 standard.
◆ IsNull()
bool CartoType::TColor::IsNull |
( |
| ) |
const |
|
inline |
Returns true if the colour is null.
◆ operator!=()
bool CartoType::TColor::operator!= |
( |
const TColor & |
aColor | ) |
const |
|
inline |
◆ operator==()
bool CartoType::TColor::operator== |
( |
const TColor & |
aColor | ) |
const |
|
inline |
◆ PremultiplyAlpha()
void CartoType::TColor::PremultiplyAlpha |
( |
| ) |
|
Converts a color to premultiplied-alpha format. This function assumes that the color is in non-premultiplied-alpha format, where the three color components can have any value, and multiplies the color components by the alpha value, yielding values in the range 0...alpha.
Premultiplied alpha format is the format used by CartoType in 32bpp RGBA bitmaps, and as the return value of MPaintServer::Color.
◆ Red()
int32_t CartoType::TColor::Red |
( |
| ) |
const |
|
inline |
Returns the red component as a value in the range 0...255.
◆ Set()
size_t CartoType::TColor::Set |
( |
const MString & |
aColor | ) |
|
Sets a color from a string. Returns the number of characters successfully parsed.
◆ SetAlpha()
void CartoType::TColor::SetAlpha |
( |
int32_t |
aAlpha | ) |
|
|
inline |
Sets the alpha (transparency) level to a value in the range 0...255: 0 = transparent, 255 = opaque.
◆ iValue
uint32_t CartoType::TColor::iValue { KBlack } |
The color value, containing, starting with the least significant byte, red, green, blue and alpha levels, each stored in eight bits. The color levels represent intensity. The alpha level represents opacity.
The documentation for this class was generated from the following files:
- cartotype_color.h
- cartotype_graphics.cpp