Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Burger::Flash::RGBAWord8 Class Reference

RGBA color class for Flash. More...

Inheritance diagram for Burger::Flash::RGBAWord8:
Inheritance graph
[legend]
Collaboration diagram for Burger::Flash::RGBAWord8:
Collaboration graph
[legend]

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}
 

Detailed Description

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).

See also
RGBAWord8_t

Constructor & Destructor Documentation

◆ RGBAWord8() [1/3]

Burger::Flash::RGBAWord8::RGBAWord8 ( )
inline

Default constructor.


Sets the color to white (255,255,255,255).

See also
RGBAWord8(uint8_t,uint8_t,uint8_t,uint8_t) or RGBAWord8(double)

◆ RGBAWord8() [2/3]

Burger::Flash::RGBAWord8::RGBAWord8 ( uint8_t bRed,
uint8_t bGreen,
uint8_t bBlue,
uint8_t bAlpha )
inline

Default constructor.


Sets the color a specific color

Parameters
bRedDefault red component
bGreenDefault green component
bBlueDefault blue component
bAlphaDefault alpha component
See also
RGBAWord8() or RGBAWord8(double)

◆ RGBAWord8() [3/3]

Burger::Flash::RGBAWord8::RGBAWord8 ( double dColor)
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.

Parameters
dColorEncoded color number
See also
Set(double), RGBAWord8(uint8_t,uint8_t,uint8_t,uint8_t) or RGBAWord8()

Member Function Documentation

◆ Print()

void BURGER_API Burger::Flash::RGBAWord8::Print ( void ) const

Prints the color to the debugger.


Prints the color to Debug::Message()

◆ Read()

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

Parameters
pStreamPointer to the data stream
uTagTypeShape type.
See also
ReadRGBA(Stream*) or ReadRGB(Stream*)

◆ ReadRGB()

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

Parameters
pStreamPointer to the data stream
See also
Read(Stream*,uint_t) or ReadRGBA(Stream*)

◆ ReadRGBA()

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.

Parameters
pStreamPointer to the data stream
See also
Read(Stream*,uint_t) or ReadRGB(Stream*)

◆ Set() [1/3]

Burger::Flash::RGBAWord8::Set ( double dColor)
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

Parameters
dColor24 bit color encoded into a 64 bit floating point number
See also
Set(uint32_t)

◆ Set() [2/3]

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

Parameters
uColorColor encoded into a 24 bit number
See also
Set(double)

◆ Set() [3/3]

Burger::Flash::RGBAWord8::Set ( uint8_t bRed,
uint8_t bGreen,
uint8_t bBlue,
uint8_t bAlpha )
inline

Sets the color.


Sets the color a specific color

Parameters
bRedNew red component
bGreenNew green component
bBlueNew blue component
bAlphaNew alpha component
See also
Set(double) or Set(uint32_t)