Gnash
0.8.11dev
|
#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 |
SWFMatrix & | invert () |
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... | |
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 |
|
inline |
Construct an identity SWFMatrix.
|
inline |
Construct a SWFMatrix with all values.
|
inline |
Referenced by gnash::renderer::gles1::bitmap_info_ogl::apply(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::AggStyle::color(), get_rotation(), get_x_scale(), gnash::Renderer_cairo::getPixel(), invert(), gnash::operator<<(), gnash::operator==(), gnash::renderer::openvg::Renderer_ovg::printVGMatrix(), and gnash::transform_class_init().
|
inline |
Referenced by gnash::renderer::gles1::bitmap_info_ogl::apply(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::AggStyle::color(), get_rotation(), get_x_scale(), gnash::Renderer_cairo::getPixel(), invert(), gnash::operator<<(), gnash::renderer::openvg::Renderer_ovg::printVGMatrix(), and gnash::transform_class_init().
|
inline |
Referenced by gnash::renderer::gles1::bitmap_info_ogl::apply(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::AggStyle::color(), get_rotation(), get_y_scale(), gnash::Renderer_cairo::getPixel(), invert(), gnash::operator<<(), gnash::renderer::openvg::Renderer_ovg::printVGMatrix(), and gnash::transform_class_init().
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(), and gnash::registerMovieClipNative().
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().
|
inline |
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().
double gnash::SWFMatrix::get_x_scale | ( | ) | const |
return the magnitude scale of our x coord output
Referenced by gnash::renderer::openvg::Renderer_ovg::disable_mask(), gnash::SWF::TextRecord::displayRecords(), gnash::geometry::pointTest(), set_rotation(), gnash::DisplayObject::setHeight(), and gnash::DisplayObject::setMatrix().
|
inline |
return x translation n TWIPS unit.
Referenced by gnash::TextField::mouseEvent(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
double gnash::SWFMatrix::get_y_scale | ( | ) | const |
return the magnitude scale of our y coord output
Referenced by gnash::renderer::openvg::Renderer_ovg::disable_mask(), gnash::SWF::TextRecord::displayRecords(), gnash::geometry::pointTest(), set_rotation(), gnash::DisplayObject::setMatrix(), and gnash::DisplayObject::setWidth().
|
inline |
return y translation in TWIPS unit.
References gnash::key::a, gnash::key::b, and gnash::geometry::operator==().
Referenced by gnash::TextField::mouseEvent(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
SWFMatrix & gnash::SWFMatrix::invert | ( | ) |
Invert this SWFMatrix and return the result.
References a(), b(), c(), d(), and set_identity().
Referenced by gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::renderer::DirectFB::Renderer_DirectFB::pixel_to_world(), gnash::renderer::openvg::Renderer_ovg::pixel_to_world(), gnash::renderer::gles1::Renderer_gles1::pixel_to_world(), gnash::Shape::pointInShape(), gnash::MorphShape::pointInShape(), gnash::TextField::pointInShape(), gnash::MovieClip::pointInVisibleShape(), gnash::readCxFormRGBA(), gnash::readFills(), gnash::registerMovieClipNative(), gnash::movie_root::setDragState(), gnash::TextField::topmostMouseEntity(), gnash::MovieClip::topmostMouseEntity(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
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().
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(), and 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(), gnash::DisplayObject::setWidth(), and test_renderer().
|
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().
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().
|
inline |
Set x translation in TWIPS.
References x.
Referenced by gnash::registerMovieClipNative(), gnash::TextField::setFont(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::SWFMatrix::set_y_scale | ( | double | scale | ) |
Set y scale, rotation and x scale are unchanged.
Referenced by gnash::DisplayObject::set_y_scale().
|
inline |
Set y translation in TWIPS.
References y.
Referenced by gnash::registerMovieClipNative(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
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::TextField::add_invalidated_bounds(), gnash::DisplayObject::boundsInClippingArea(), gnash::Renderer_cairo::drawVideoFrame(), gnash::SWFRect::enclose_transformed_rect(), gnash::SWFRect::expand_to_transformed_rect(), gnash::getHeight(), gnash::renderer::DirectFB::Renderer_DirectFB::pixel_to_world(), gnash::renderer::openvg::Renderer_ovg::pixel_to_world(), gnash::renderer::gles1::Renderer_gles1::pixel_to_world(), gnash::DisplayObject::pointInBounds(), gnash::Shape::pointInShape(), gnash::MorphShape::pointInShape(), gnash::TextField::pointInShape(), gnash::MovieClip::pointInVisibleShape(), gnash::registerBitmapDataNative(), gnash::registerMovieClipNative(), gnash::movie_root::setDragState(), gnash::TextField::setFont(), gnash::Button::topmostMouseEntity(), gnash::TextField::topmostMouseEntity(), gnash::MovieClip::topmostMouseEntity(), gnash::Edge::transform(), transform(), gnash::Path::transform(), gnash::renderer::openvg::Renderer_ovg::world_to_pixel(), and gnash::DisplayObject::MaskRenderer::~MaskRenderer().
void gnash::SWFMatrix::transform | ( | std::int32_t & | x, |
std::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 gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
void gnash::SWFMatrix::transform | ( | geometry::Range2d< std::int32_t > & | r | ) | const |
Transform Range2d<float> 'r' by our SWFMatrix.
NULL and WORLD ranges are untouched.
References gnash::geometry::Range2d< T >::expandTo(), gnash::geometry::Range2d< T >::getMaxX(), gnash::geometry::Range2d< T >::getMaxY(), gnash::geometry::Range2d< T >::getMinX(), gnash::geometry::Range2d< T >::getMinY(), gnash::geometry::Range2d< T >::setTo(), transform(), gnash::geometry::Point2d::x, and gnash::geometry::Point2d::y.
void gnash::SWFMatrix::transform | ( | SWFRect & | r | ) | const |
|
inline |
Referenced by gnash::renderer::gles1::bitmap_info_ogl::apply(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::AggStyle::color(), gnash::SWF::TextRecord::displayRecords(), gnash::Renderer_cairo::getPixel(), gnash::operator<<(), gnash::renderer::openvg::Renderer_ovg::printVGMatrix(), gnash::registerMovieClipNative(), and gnash::transform_class_init().
|
inline |
References gnash::key::m, gnash::key::t, x, and y.
Referenced by gnash::renderer::gles1::bitmap_info_ogl::apply(), gnash::renderer::openvg::OpenVGBitmap::applyPatternBitmap(), gnash::AggStyle::color(), gnash::SWF::TextRecord::displayRecords(), gnash::Renderer_cairo::getPixel(), gnash::operator<<(), gnash::renderer::openvg::Renderer_ovg::printVGMatrix(), gnash::registerMovieClipNative(), and gnash::transform_class_init().
Allow direct access to values for equality.