Gnash  0.8.10
Public Member Functions | Friends
gnash::SWFMatrix Class Reference

#include <SWFMatrix.h>

List of all members.

Public Member Functions

 SWFMatrix ()
 Construct an identity SWFMatrix.
 SWFMatrix (int a, int b, int c, int d, int x, int y)
 Construct a SWFMatrix with all values.
boost::int32_t a () const
boost::int32_t b () const
boost::int32_t c () const
boost::int32_t d () const
boost::int32_t tx () const
boost::int32_t ty () const
void set_identity ()
 Set the SWFMatrix to identity.
void concatenate (const SWFMatrix &m)
 Concatenate m's transform onto ours.
void concatenate_translation (int _tx, int _ty)
 Concatenate a translation onto the front of our SWFMatrix.
void concatenate_scale (double x, double y)
 Concatenate scale x and y to the front of our SWFMatrix.
void set_lerp (const SWFMatrix &m1, const SWFMatrix &m2, float t)
 Set this SWFMatrix to a blend of m1 and m2, parameterized by t.
void set_scale_rotation (double x_scale, double y_scale, double rotation)
 Set the scale & rotation part of the SWFMatrix. angle in radians.
void set_scale (double x_scale, double y_scale)
 Set x and y scales, rotation is unchanged.
void set_x_scale (double scale)
 Set x scale, rotation any y scale are unchanged.
void set_y_scale (double scale)
 Set y scale, rotation and x scale are unchanged.
void set_rotation (double rotation)
 Set rotation in radians, scales component are unchanged.
void set_x_translation (int x)
 Set x translation in TWIPS.
void set_y_translation (int y)
 Set y translation in TWIPS.
void set_translation (int x, int y)
 Set x and y translation in TWIPS.
void transform (geometry::Point2d &p) const
 Transform a given point by our SWFMatrix.
void transform (boost::int32_t &x, boost::int32_t &y) const
 Transform the given point by our SWFMatrix.
void transform (geometry::Point2d *result, const geometry::Point2d &p) const
 Transform point 'p' by our SWFMatrix.
void transform (geometry::Range2d< boost::int32_t > &r) const
 Transform Range2d<float> 'r' by our SWFMatrix.
void transform (SWFRect &r) const
SWFMatrixinvert ()
 Invert this SWFMatrix and return the result.
double get_x_scale () const
 return the magnitude scale of our x coord output
double get_y_scale () const
 return the magnitude scale of our y coord output
double get_rotation () const
 return rotation component in radians.
int get_x_translation () const
 return x translation n TWIPS unit.
int get_y_translation () const
 return y translation in TWIPS unit.

Friends

bool operator== (const SWFMatrix &a, const SWFMatrix &b)
 Allow direct access to values for equality.

Detailed Description

The SWF SWFMatrix record.

Conceptually, it represents a 3*3 linear transformation SWFMatrix like this:

| scale_x rotateSkew_y translate_x | | rotateSkey_x scale_y traslate_y | | 0 0 1 |


Constructor & Destructor Documentation

gnash::SWFMatrix::SWFMatrix ( ) [inline]

Construct an identity SWFMatrix.

gnash::SWFMatrix::SWFMatrix ( int  a,
int  b,
int  c,
int  d,
int  x,
int  y 
) [inline]

Construct a SWFMatrix with all values.


Member Function Documentation

boost::int32_t gnash::SWFMatrix::a ( ) const [inline]
boost::int32_t gnash::SWFMatrix::b ( ) const [inline]
boost::int32_t gnash::SWFMatrix::c ( ) const [inline]
void gnash::SWFMatrix::concatenate ( const SWFMatrix m)

Concatenate m's transform onto ours.

When transforming points, m happens first, then our original xform.

References gnash::key::t.

Referenced by gnash::SWF::DefineTextTag::display(), gnash::getWorldMatrix(), gnash::gradientMatrix(), gnash::AddStyles::operator()(), and gnash::Transform::operator*=().

void gnash::SWFMatrix::concatenate_scale ( double  x,
double  y 
)

Concatenate scale x and y to the front of our SWFMatrix.

When transforming points, these scales happen first, then our original SWFMatrix.

Referenced by gnash::SWF::TextRecord::displayRecords().

void gnash::SWFMatrix::concatenate_translation ( int  _tx,
int  _ty 
)

Concatenate a translation onto the front of our SWFMatrix.

When transforming points, the translation happens first, then our original xform.

Referenced by gnash::TextField::display(), and gnash::SWF::TextRecord::displayRecords().

boost::int32_t gnash::SWFMatrix::d ( ) const [inline]
double gnash::SWFMatrix::get_rotation ( ) const

return rotation component in radians.

Referenced by gnash::DisplayObject::setMatrix(), and set_scale().

double gnash::SWFMatrix::get_x_scale ( ) const
int gnash::SWFMatrix::get_x_translation ( ) const [inline]

return x translation n TWIPS unit.

Referenced by gnash::TextField::mouseEvent().

double gnash::SWFMatrix::get_y_scale ( ) const
int gnash::SWFMatrix::get_y_translation ( ) const [inline]

return y translation in TWIPS unit.

Referenced by gnash::TextField::mouseEvent().

SWFMatrix & gnash::SWFMatrix::invert ( )
void gnash::SWFMatrix::set_identity ( )

Set the SWFMatrix to identity.

Referenced by gnash::renderer::openvg::Renderer_ovg::set_scale(), and invert().

void gnash::SWFMatrix::set_lerp ( const SWFMatrix m1,
const SWFMatrix m2,
float  t 
)

Set this SWFMatrix to a blend of m1 and m2, parameterized by t.

References gnash::key::t.

Referenced by gnash::GradientFill::setLerp(), and gnash::BitmapFill::setLerp().

void gnash::SWFMatrix::set_rotation ( double  rotation)

Set rotation in radians, scales component are unchanged.

References get_x_scale(), and get_y_scale().

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

void gnash::SWFMatrix::set_scale ( double  x_scale,
double  y_scale 
)
void gnash::SWFMatrix::set_scale_rotation ( double  x_scale,
double  y_scale,
double  rotation 
)

Set the scale & rotation part of the SWFMatrix. angle in radians.

Referenced by gnash::DisplayObject::setWidth(), gnash::DisplayObject::setHeight(), set_scale(), and test_renderer().

void gnash::SWFMatrix::set_translation ( int  x,
int  y 
) [inline]

Set x and y translation in TWIPS.

References x, and y.

Referenced by gnash::gradientMatrix().

void gnash::SWFMatrix::set_x_scale ( double  scale)

Set x scale, rotation any y scale are unchanged.

Referenced by gnash::DisplayObject::set_x_scale(), and gnash::DisplayObject::set_rotation().

void gnash::SWFMatrix::set_x_translation ( int  x) [inline]

Set x translation in TWIPS.

References x.

void gnash::SWFMatrix::set_y_scale ( double  scale)

Set y scale, rotation and x scale are unchanged.

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

void gnash::SWFMatrix::set_y_translation ( int  y) [inline]

Set y translation in TWIPS.

References y.

void gnash::SWFMatrix::transform ( geometry::Point2d p) const
void gnash::SWFMatrix::transform ( boost::int32_t &  x,
boost::int32_t &  y 
) const

Transform the given point by our SWFMatrix.

void gnash::SWFMatrix::transform ( geometry::Point2d result,
const geometry::Point2d p 
) const

Transform point 'p' by our SWFMatrix.

Put the result in *result.

References assert, gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.

void gnash::SWFMatrix::transform ( geometry::Range2d< boost::int32_t > &  r) const
void gnash::SWFMatrix::transform ( SWFRect r) const
boost::int32_t gnash::SWFMatrix::tx ( ) const [inline]
boost::int32_t gnash::SWFMatrix::ty ( ) const [inline]

Friends And Related Function Documentation

bool operator== ( const SWFMatrix a,
const SWFMatrix b 
) [friend]

Allow direct access to values for equality.


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