Gnash
0.8.10
|
#include <SWFMatrix.h>
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 |
SWFMatrix & | invert () |
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. |
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 |
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.
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 |
return the magnitude scale of our x coord output
Referenced by gnash::DisplayObject::setHeight(), gnash::DisplayObject::setMatrix(), gnash::geometry::pointTest(), gnash::renderer::openvg::Renderer_ovg::apply_mask(), set_rotation(), and gnash::SWF::TextRecord::displayRecords().
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 |
return the magnitude scale of our y coord output
Referenced by gnash::DisplayObject::setWidth(), gnash::DisplayObject::setMatrix(), gnash::geometry::pointTest(), set_rotation(), and gnash::SWF::TextRecord::displayRecords().
int gnash::SWFMatrix::get_y_translation | ( | ) | const [inline] |
return y translation in TWIPS unit.
Referenced by gnash::TextField::mouseEvent().
SWFMatrix & gnash::SWFMatrix::invert | ( | ) |
Invert this SWFMatrix and return the result.
References set_identity(), d(), a(), c(), and b().
Referenced by gnash::MorphShape::pointInShape(), gnash::MovieClip::topmostMouseEntity(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::renderer::openvg::Renderer_ovg::pixel_to_world(), gnash::renderer::DirectFB::Renderer_DirectFB::pixel_to_world(), gnash::renderer::gles1::Renderer_gles1::pixel_to_world(), gnash::Shape::pointInShape(), gnash::TextField::topmostMouseEntity(), gnash::TextField::pointInShape(), and gnash::readFills().
void gnash::SWFMatrix::set_identity | ( | ) |
Set the SWFMatrix to identity.
Referenced by gnash::renderer::openvg::Renderer_ovg::set_scale(), and invert().
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 | ||
) |
Set x and y scales, rotation is unchanged.
References get_rotation(), and set_scale_rotation().
Referenced by gnash::Bitmap::construct(), gnash::gradientMatrix(), and gnash::renderer::openvg::Renderer_ovg::set_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] |
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 |
Transform a given point by our SWFMatrix.
References gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
Referenced by gnash::Button::topmostMouseEntity(), gnash::getHeight(), gnash::DisplayObject::boundsInClippingArea(), gnash::DisplayObject::pointInBounds(), gnash::Edge::transform(), gnash::Path::transform(), gnash::MorphShape::pointInShape(), gnash::movie_root::setDragState(), gnash::MovieClip::topmostMouseEntity(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), gnash::renderer::openvg::Renderer_ovg::pixel_to_world(), gnash::Renderer_cairo::drawVideoFrame(), gnash::renderer::DirectFB::Renderer_DirectFB::pixel_to_world(), gnash::renderer::gles1::Renderer_gles1::pixel_to_world(), gnash::Shape::pointInShape(), transform(), gnash::SWFRect::enclose_transformed_rect(), gnash::SWFRect::expand_to_transformed_rect(), gnash::TextField::add_invalidated_bounds(), gnash::TextField::topmostMouseEntity(), and gnash::TextField::pointInShape().
void gnash::SWFMatrix::transform | ( | boost::int32_t & | x, |
boost::int32_t & | y | ||
) | const |
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 |
Transform Range2d<float> 'r' by our SWFMatrix.
NULL and WORLD ranges are untouched.
References gnash::geometry::Range2d::getMinX(), gnash::geometry::Range2d::getMaxX(), gnash::geometry::Range2d::getMinY(), gnash::geometry::Range2d::getMaxY(), transform(), gnash::geometry::Range2d::setTo(), gnash::geometry::Point2d::x, gnash::geometry::Point2d::y, and gnash::geometry::Range2d::expandTo().
void gnash::SWFMatrix::transform | ( | SWFRect & | r | ) | const |
boost::int32_t gnash::SWFMatrix::tx | ( | ) | const [inline] |
boost::int32_t gnash::SWFMatrix::ty | ( | ) | const [inline] |
Allow direct access to values for equality.