Public Member Functions | Public Attributes | 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.
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.

Public Attributes

int sx
 Xscale, 16.16 fixed point. xx in swfdec. 'a' in AS Matrix.
int shx
 Xshear, 16.16 fixed point. yx in swfdec. 'b' in AS Matrix.
int shy
 Yshear, 16.16 fixed point. xy in swfdec. 'c' in AS Matrix.
int sy
 Yscale, 16.16 fixed point. yy in swfdec. 'd' in AS Matrix.
int tx
 Xtranslation, TWIPS. x0 in swfdec. 'tx' in AS Matrix.
int ty
 Ytranslation, TWIPS. y0 in swfdec. 'ty' in AS Matrix.

Friends

bool operator== (const SWFMatrix &, const SWFMatrix &)
std::ostream & operator<< (std::ostream &, const SWFMatrix &)

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

void gnash::SWFMatrix::concatenate ( const SWFMatrix m  ) 

Concatenate m's transform onto ours.

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

References shx, shy, sx, sy, tx, and ty.

Referenced by gnash::StyleHandler::addFocalGradient(), gnash::StyleHandler::addRadialGradient(), gnash::SWF::DefineTextTag::display(), gnash::DisplayObject::getWorldMatrix(), gnash::gradientMatrix(), main(), and gnash::AddStyles::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().

double gnash::SWFMatrix::get_rotation (  )  const

return rotation component in radians.

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

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

return x translation n TWIPS unit.

Referenced by main(), and gnash::TextField::notifyEvent().

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

return y translation in TWIPS unit.

Referenced by main(), and gnash::TextField::notifyEvent().

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

Set the SWFMatrix to identity.

Referenced by 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 shx, shy, sx, sy, tx, and ty.

Referenced by gnash::BitmapFill::setLerp(), and gnash::GradientFill::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 
)

Set x and y scales, rotation is unchanged.

References get_rotation(), and set_scale_rotation().

Referenced by gnash::gradientMatrix().

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 set_scale(), gnash::DisplayObject::setHeight(), and gnash::DisplayObject::setWidth().

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

Set x scale, rotation any y scale are unchanged.

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

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

Set x translation in TWIPS.

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.

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 gnash::key::p.

void gnash::SWFMatrix::transform ( geometry::Point2d p  )  const
void gnash::SWFMatrix::transform ( SWFRect r  )  const
void gnash::SWFMatrix::transform ( geometry::Range2d< boost::int32_t > &  r  )  const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const SWFMatrix m 
) [friend]
bool operator== ( const SWFMatrix a,
const SWFMatrix b 
) [friend]

Member Data Documentation

Xshear, 16.16 fixed point. yx in swfdec. 'b' in AS Matrix.

Referenced by concatenate(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().

Yshear, 16.16 fixed point. xy in swfdec. 'c' in AS Matrix.

Referenced by concatenate(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().

Xscale, 16.16 fixed point. xx in swfdec. 'a' in AS Matrix.

Referenced by concatenate(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().

Yscale, 16.16 fixed point. yy in swfdec. 'd' in AS Matrix.

Referenced by concatenate(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().

Xtranslation, TWIPS. x0 in swfdec. 'tx' in AS Matrix.

Referenced by concatenate(), gnash::SWF::TextRecord::displayRecords(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().

Ytranslation, TWIPS. y0 in swfdec. 'ty' in AS Matrix.

Referenced by concatenate(), gnash::SWF::TextRecord::displayRecords(), main(), gnash::operator<<(), gnash::operator==(), and set_lerp().


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