Gnash  0.8.11dev
Public Member Functions | Public Attributes | Friends | List of all members
gnash::rgba Class Reference

A basic RGBA type. More...

#include <RGBA.h>

Public Member Functions

constexpr rgba ()
 Construct default RGBA value. More...
 
 rgba (std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a)
 Construct an RGBA with the provided values. More...
 
void parseRGB (std::uint32_t rgbCol)
 Parse a 32-bit unsigned integer as three packed R,G,B bytes. More...
 
std::uint32_t toRGB () const
 Return a 32-bit unsigned integer as four packed R,G,B bytes. More...
 
std::uint32_t toRGBA () const
 Return a 32-bit unsigned integer as four packed A,R,G,B bytes. More...
 
bool operator== (const rgba &o) const
 
bool operator!= (const rgba &o) const
 

Public Attributes

std::uint8_t m_r
 
std::uint8_t m_g
 
std::uint8_t m_b
 
std::uint8_t m_a
 

Friends

std::ostream & operator<< (std::ostream &os, const rgba &r)
 

Detailed Description

A basic RGBA type.

This both represents a SWF RGBA record and is a basic Gnash type for color values.

Constructor & Destructor Documentation

§ rgba() [1/2]

constexpr gnash::rgba::rgba ( )
inline

Construct default RGBA value.

Default value is 0xffffffff (solid white).

§ rgba() [2/2]

gnash::rgba::rgba ( std::uint8_t  r,
std::uint8_t  g,
std::uint8_t  b,
std::uint8_t  a 
)
inline

Construct an RGBA with the provided values.

Parameters
rRed
gGreen
bBlue
aAlpha (transparency)

Member Function Documentation

§ operator!=()

bool gnash::rgba::operator!= ( const rgba o) const
inline

References gnash::key::o.

§ operator==()

bool gnash::rgba::operator== ( const rgba o) const
inline

References m_a, m_b, m_g, and m_r.

§ parseRGB()

void gnash::rgba::parseRGB ( std::uint32_t  rgbCol)
inline

Parse a 32-bit unsigned integer as three packed R,G,B bytes.

Alpha will be untouched. Blue is the least significant byte.

This function is meant to be used to parse ActionScript colors in numeric format.

Referenced by gnash::colorFromHexString(), gnash::registerMovieClipNative(), gnash::registerTextFieldNative(), gnash::StaticText::setSelectionColor(), and gnash::textformat_class_init().

§ toRGB()

std::uint32_t gnash::rgba::toRGB ( ) const
inline

Return a 32-bit unsigned integer as four packed R,G,B bytes.

Blue is the least significant byte. The most significant (alpha) byte is unused.

This function is meant to be used to output ActionScript colors in numeric format.

Referenced by gnash::registerTextFieldNative().

§ toRGBA()

std::uint32_t gnash::rgba::toRGBA ( ) const
inline

Return a 32-bit unsigned integer as four packed A,R,G,B bytes.

Blue is the least significant byte.

This function is meant to be used to output ActionScript colors in numeric format.

References gnash::operator<<(), and gnash::key::r.

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const rgba r 
)
friend

Member Data Documentation

§ m_a

std::uint8_t gnash::rgba::m_a

§ m_b

std::uint8_t gnash::rgba::m_b

§ m_g

std::uint8_t gnash::rgba::m_g

§ m_r

std::uint8_t gnash::rgba::m_r

The documentation for this class was generated from the following file: