Public Member Functions | Public Attributes | Friends

gnash::cxform Class Reference

Color Transformation Record. More...

#include <cxform.h>

List of all members.

Public Member Functions

 cxform ()
 Initialize to the identity color transform (no transform).
void concatenate (const cxform &c)
 Concatenate cxform c onto ours.
rgba transform (const rgba &in) const
 Transform the given color, return the result.
void transform (boost::uint8_t &r, boost::uint8_t &g, boost::uint8_t &b, boost::uint8_t &a) const
 Transform the given color.
void store_to (boost::int16_t *dst) const
 Store the cxform record to an external array.
cxformload_from (float *src)
 Load an cxform record from an external array.
bool is_identity () const
 Returns true when the cxform equals identity (no transform).
bool is_invisible () const
 Returns true when the cxform leads to alpha == 0.
void read_rgb (SWFStream &in)
 Read RGB from the SWF input stream.
void read_rgba (SWFStream &in)
 Read RGBA from the SWF input stream.
std::string toString () const

Public Attributes

boost::int16_t ra
boost::int16_t rb
boost::int16_t ga
boost::int16_t gb
boost::int16_t ba
boost::int16_t bb
boost::int16_t aa
boost::int16_t ab

Friends

bool operator== (const cxform &, const cxform &)
bool operator!= (const cxform &, const cxform &)
std::ostream & operator<< (std::ostream &os, const cxform &cx)

Detailed Description

Color Transformation Record.


Constructor & Destructor Documentation

gnash::cxform::cxform (  ) 

Initialize to the identity color transform (no transform).

References aa, ab, ba, bb, ga, gb, ra, and rb.


Member Function Documentation

void gnash::cxform::concatenate ( const cxform c  ) 

Concatenate cxform c onto ours.

When transforming colors, c's transform is applied first, then ours.

References aa, ab, ba, bb, ga, gb, ra, and rb.

Referenced by gnash::DisplayObject::get_world_cxform().

bool gnash::cxform::is_identity (  )  const

Returns true when the cxform equals identity (no transform).

bool gnash::cxform::is_invisible (  )  const

Returns true when the cxform leads to alpha == 0.

Not the _alpha property, but the visible alpha related to dislpay. The two might be completely diffrent. eg. mc._alpha ranges in [-32768, 32767] But the alpha on screen ranges in [0, 255]

cxform& gnash::cxform::load_from ( float *  src  )  [inline]

Load an cxform record from an external array.

References s2x::f.

void gnash::cxform::read_rgb ( SWFStream in  ) 

Read RGB from the SWF input stream.

Referenced by gnash::SWF::ButtonRecord::readRGBTransform().

void gnash::cxform::read_rgba ( SWFStream in  ) 

Read RGBA from the SWF input stream.

Referenced by gnash::SWF::ButtonRecord::read().

void gnash::cxform::store_to ( boost::int16_t *  dst  )  const [inline]

Store the cxform record to an external array.

std::string gnash::cxform::toString (  )  const
void gnash::cxform::transform ( boost::uint8_t &  r,
boost::uint8_t &  g,
boost::uint8_t &  b,
boost::uint8_t &  a 
) const

Transform the given color.

rgba gnash::cxform::transform ( const rgba in  )  const

Friends And Related Function Documentation

bool operator!= ( const cxform a,
const cxform b 
) [friend]
std::ostream& operator<< ( std::ostream &  os,
const cxform cx 
) [friend]
bool operator== ( const cxform a,
const cxform b 
) [friend]

Member Data Documentation

boost::int16_t gnash::cxform::aa
boost::int16_t gnash::cxform::ab
boost::int16_t gnash::cxform::ba
boost::int16_t gnash::cxform::bb
boost::int16_t gnash::cxform::ga
boost::int16_t gnash::cxform::gb
boost::int16_t gnash::cxform::ra
boost::int16_t gnash::cxform::rb

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