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

#include <SWFMatrix.h>

Public Member Functions

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

Friends

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

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

§ SWFMatrix() [1/2]

constexpr gnash::SWFMatrix::SWFMatrix ( )
inline

Construct an identity SWFMatrix.

§ SWFMatrix() [2/2]

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

§ a()

std::int32_t gnash::SWFMatrix::a ( ) const
inline

§ b()

std::int32_t gnash::SWFMatrix::b ( ) const
inline

§ c()

std::int32_t gnash::SWFMatrix::c ( ) const
inline

§ concatenate()

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*=().

§ concatenate_scale()

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(), and gnash::registerMovieClipNative().

§ concatenate_translation()

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

§ d()

std::int32_t gnash::SWFMatrix::d ( ) const
inline

§ get_rotation()

double gnash::SWFMatrix::get_rotation ( ) const

return rotation component in radians.

References a(), b(), c(), and d().

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

§ get_x_scale()

double gnash::SWFMatrix::get_x_scale ( ) const

§ get_x_translation()

int gnash::SWFMatrix::get_x_translation ( ) const
inline

return x translation n TWIPS unit.

Referenced by gnash::TextField::mouseEvent(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().

§ get_y_scale()

double gnash::SWFMatrix::get_y_scale ( ) const

§ get_y_translation()

int gnash::SWFMatrix::get_y_translation ( ) const
inline

§ invert()

SWFMatrix & gnash::SWFMatrix::invert ( )

§ set_identity()

void gnash::SWFMatrix::set_identity ( )

Set the SWFMatrix to identity.

Referenced by invert().

§ set_lerp()

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

§ set_rotation()

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

§ set_scale()

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::Bitmap::construct(), and gnash::gradientMatrix().

§ set_scale_rotation()

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

§ set_translation()

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

Set x and y translation in TWIPS.

References gnash::key::p, gnash::key::r, x, and y.

Referenced by gnash::gradientMatrix(), gnash::registerTextFieldNative(), and gnash::movie_root::setDragState().

§ set_x_scale()

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

§ set_x_translation()

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

§ set_y_scale()

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

Set y scale, rotation and x scale are unchanged.

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

§ set_y_translation()

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

Set y translation in TWIPS.

References y.

Referenced by gnash::registerMovieClipNative(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().

§ transform() [1/5]

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

§ transform() [2/5]

void gnash::SWFMatrix::transform ( std::int32_t &  x,
std::int32_t &  y 
) const

Transform the given point by our SWFMatrix.

§ transform() [3/5]

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::geometry::Point2d::x, and gnash::geometry::Point2d::y.

§ transform() [4/5]

void gnash::SWFMatrix::transform ( geometry::Range2d< std::int32_t > &  r) const

§ transform() [5/5]

void gnash::SWFMatrix::transform ( SWFRect r) const

§ tx()

std::int32_t gnash::SWFMatrix::tx ( ) const
inline

§ ty()

std::int32_t gnash::SWFMatrix::ty ( ) const
inline

Friends And Related Function Documentation

§ operator==

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: