RGBA color class for Flash. More...
Public Member Functions | |
RGBAWord8 () | |
Default constructor. | |
RGBAWord8 (uint8_t bRed, uint8_t bGreen, uint8_t bBlue, uint8_t bAlpha) | |
Default constructor. | |
RGBAWord8 (double dColor) | |
Default constructor. | |
void | Read (Stream *pStream, uint_t uTagType) |
Read an RGB(A) color from an input stream based on a shape type. | |
void | ReadRGBA (Stream *pStream) |
Read an RGBA color from an input stream. | |
void | ReadRGB (Stream *pStream) |
Read an RGB color from an input stream. | |
void | Set (uint8_t bRed, uint8_t bGreen, uint8_t bBlue, uint8_t bAlpha) |
Sets the color. | |
void | Set (uint32_t uColor) |
Convert a 24 bit color to RGB. | |
void | Set (double dColor) |
Convert a 24 bit (double) color to RGB. | |
void | Print (void) const |
Prints the color to the debugger. | |
Public Member Functions inherited from Burger::RGBAWord8_t | |
uint32_t | ToARGB (void) const |
Convert the color to an ARGB 32 bit integer. | |
uint32_t | ToABGR (void) const |
Convert the color to a ABGR 32 bit integer. | |
void | FromARGB (uint32_t uColor) |
Initialize the color with a 32 bit integer. | |
void | FromABGR (uint32_t uColor) |
Initialize the color with a 32 bit integer. | |
void | Interpolate (const RGBAWord8_t *pFrom, const RGBAWord8_t *pTo, float fFactor) |
Interpolates between two colors. | |
Additional Inherited Members | |
Public Attributes inherited from Burger::RGBAWord8_t | |
uint8_t | m_uRed |
8 bit red value | |
uint8_t | m_uGreen |
8 bit green value | |
uint8_t | m_uBlue |
8 bit blue value | |
uint8_t | m_uAlpha |
8 bit alpha value | |
Static Public Attributes inherited from Burger::RGBAWord8_t | |
static const RGBAWord8_t | Aqua = {0,255,255,255} |
static const RGBAWord8_t | Black = {0,0,0,255} |
static const RGBAWord8_t | Blue = {0,0,255,255} |
static const RGBAWord8_t | Fuchsia = {255,0,255,255} |
static const RGBAWord8_t | Gray = {128,128,128,255} |
static const RGBAWord8_t | Green = {0,128,0,255} |
static const RGBAWord8_t | Lime = {0,255,0,255} |
static const RGBAWord8_t | Maroon = {128,0,0,255} |
static const RGBAWord8_t | Navy = {0,0,128,255} |
static const RGBAWord8_t | Olive = {128,128,0,255} |
static const RGBAWord8_t | Orange = {255,165,0,255} |
static const RGBAWord8_t | Purple = {128,0,128,255} |
static const RGBAWord8_t | Red = {255,0,0,255} |
static const RGBAWord8_t | Silver = {192,192,192,255} |
static const RGBAWord8_t | Teal = {0,128,128,255} |
static const RGBAWord8_t | White = {255,255,255,255} |
static const RGBAWord8_t | Yellow = {255,255,0,255} |
RGBA color class for Flash.
Converts the Burgerlib RGBAWord8_t structure into a class that has constructors. Will default to white (255,255,255,255).
|
inline |
Default constructor.
Sets the color to white (255,255,255,255).
|
inline |
Default constructor.
Sets the color a specific color
bRed | Default red component |
bGreen | Default green component |
bBlue | Default blue component |
bAlpha | Default alpha component |
|
inline |
Default constructor.
Sets the color a specific color where Red is dColor/65536, Green is dColor/256 and Blue is dColor and all values are clamped to 8 bit.
dColor | Encoded color number |
void BURGER_API Burger::Flash::RGBAWord8::Print | ( | void | ) | const |
void BURGER_API Burger::Flash::RGBAWord8::Read | ( | Stream * | pStream, |
uint_t | uTagType ) |
Read an RGB(A) color from an input stream based on a shape type.
Given a shape type of type 1, 2 or 3, read in the RGB color into the record. Type 1 and 2 reads in R,G, and B and sets the alpha to 255 where type 3 reads in all four components.
The shape type is documented on page 132 of swf-file-format-spec.pdf
pStream | Pointer to the data stream |
uTagType | Shape type. |
void BURGER_API Burger::Flash::RGBAWord8::ReadRGB | ( | Stream * | pStream | ) |
Read an RGB color from an input stream.
Read in three bytes, Red, Green, and Blue from the input stream. Set Alpha to 255
pStream | Pointer to the data stream |
void BURGER_API Burger::Flash::RGBAWord8::ReadRGBA | ( | Stream * | pStream | ) |
Read an RGBA color from an input stream.
Read in four bytes, Red, Green, Blue and Alpha from the input stream.
pStream | Pointer to the data stream |
|
inline |
Convert a 24 bit (double) color to RGB.
Convert the 64 bit floating point number into a 24 bit integer and then shift the color 16 bits right to obtain red, 8 bits to the right to obtain green and clamp to 8 bits to obtain blue.
Red = (uColor>>16)&0xFF Green = (uColor>>8)&0xFF Blue = uColor&0xFF
dColor | 24 bit color encoded into a 64 bit floating point number |
void BURGER_API Burger::Flash::RGBAWord8::Set | ( | uint32_t | uColor | ) |
Convert a 24 bit color to RGB.
Shift the color 16 bits right to obtain red, 8 bits to the right to obtain green and clamp to 8 bits to obtain blue.
Red = (uColor>>16)&0xFF Green = (uColor>>8)&0xFF Blue = uColor&0xFF
uColor | Color encoded into a 24 bit number |
|
inline |
Sets the color.
Sets the color a specific color
bRed | New red component |
bGreen | New green component |
bBlue | New blue component |
bAlpha | New alpha component |