synfig-core  1.0.3
Public Types | Public Member Functions | Public Attributes | List of all members
synfig::Matrix Class Reference

#include <matrix.h>

Public Types

typedef Real value_type

Public Member Functions

 Matrix ()
 Default constructor makes an identity matrix.
 Matrix (value_type m00, value_type m01, value_type m02, value_type m10, value_type m11, value_type m12, value_type m20, value_type m21, value_type m22)
 Matrix (Vector axis_x, Vector axis_y, Vector offset)
Vector get_axis_x () const
Vector get_axis_y () const
Vector get_offset () const
Matrixset_identity ()
 set_identity member. Set an identity matrix
bool is_identity () const
Matrixset_scale (const value_type &sx, const value_type &sy)
Matrixset_scale (const value_type &sxy)
Matrixset_scale (const Vector &s)
Matrixset_rotate (const Angle &a)
Matrixset_translate (const Vector &t)
Matrixset_translate (value_type x, value_type y)
Vector get_transformed (const Vector &v, bool translate=true) const
void get_transformed (value_type &out_x, value_type &out_y, const value_type x, const value_type y, bool translate=true) const
Matrix operator*= (const Matrix &rhs)
Matrix operator*= (const value_type &rhs)
Matrix operator+= (const Matrix &rhs)
Matrix operator* (const Matrix &rhs) const
Matrix operator* (const value_type &rhs) const
Matrix operator+ (const Matrix &rhs) const
bool is_invertible () const
Matrixinvert ()
String get_string (int spaces=0, String before=String(), String after=String()) const

Public Attributes

value_type m00
 The matrix array.
value_type m01
value_type m02
value_type m10
value_type m11
value_type m12
value_type m20
value_type m21
value_type m22

Detailed Description

Todo:
writeme

Member Typedef Documentation

Constructor & Destructor Documentation

Matrix::Matrix ( )

Default constructor makes an identity matrix.

synfig::Matrix::Matrix ( value_type  m00,
value_type  m01,
value_type  m02,
value_type  m10,
value_type  m11,
value_type  m12,
value_type  m20,
value_type  m21,
value_type  m22 
)
inline
synfig::Matrix::Matrix ( Vector  axis_x,
Vector  axis_y,
Vector  offset 
)
inline

Member Function Documentation

Vector synfig::Matrix::get_axis_x ( ) const
inline

References m00, and m01.

Referenced by synfig::Transformation::set_matrix().

Vector synfig::Matrix::get_axis_y ( ) const
inline

References m10, and m11.

Referenced by synfig::Transformation::set_matrix().

Vector synfig::Matrix::get_offset ( ) const
inline

References m20, and m21.

Referenced by synfig::Transformation::set_matrix().

Matrix & Matrix::set_identity ( )

set_identity member. Set an identity matrix

bool Matrix::is_identity ( ) const
Matrix & Matrix::set_scale ( const value_type sx,
const value_type sy 
)

set_scale member function. Sets a scale matrix

Parameters
sxScale by X axis
syScale by Y axis
Returns
A matrix reference filled with the sx, sy values

Referenced by synfig::ValueNode_BoneInfluence::calculate_transform(), and synfig::Bone::get_tip().

Matrix & Matrix::set_scale ( const value_type sxy)

set_scale member fucntion. Sets a scale matrix

Parameters
sxyScale by X and Y axis
Returns
A matrix reference filled with the sxy values
Matrix & Matrix::set_scale ( const Vector s)

set_scale member fucntion. Sets a scale matrix

Parameters
sVector that defines the scale
Returns
A matrix reference filled with the proper scale parameters
Matrix & Matrix::set_rotate ( const Angle a)

set_rotate member function. Sets a rotate matrix

Parameters
aRotation angle counter clockwise
Returns
A matrix reference filled with the proper rotation parameters

Referenced by synfig::Bone::get_tip().

Matrix & Matrix::set_translate ( const Vector t)

translate member function. Sets a translate matrix

Parameters
tVector that defines the translation
Returns
A matrix reference filled with the proper translation parameters
Matrix & Matrix::set_translate ( value_type  x,
value_type  y 
)

translate member function. Sets a translate matrix

Parameters
xScalar that defines the x component of the translation
yScalar that defines the y component of the translation
Returns
A matrix reference filled with the proper translation parameters
Vector Matrix::get_transformed ( const Vector v,
bool  translate = true 
) const
void Matrix::get_transformed ( value_type out_x,
value_type out_y,
const value_type  x,
const value_type  y,
bool  translate = true 
) const
Matrix Matrix::operator*= ( const Matrix rhs)

operator*=. Multiplication and assignment of one matrix by another

Parameters
rhsthe right hand side of the multiplication operation
Returns
the modified resulting matrix

References m00, m01, m02, m10, m11, m12, m20, m21, and m22.

Matrix Matrix::operator*= ( const value_type rhs)

operator*=. Multiplication and assignment of one matrix by a scalar

Parameters
rhsthe number to multiply by
Returns
the modifed resulting matrix
Matrix Matrix::operator+= ( const Matrix rhs)

operator+=. Sum and assignment of two matrixes

Parameters
rhsthe matrix to sum
Returns
modified matrix with the summed matrix

References m00, m01, m02, m10, m11, m12, m20, m21, and m22.

Matrix Matrix::operator* ( const Matrix rhs) const

operator*. Multiplication of one matrix by another

Parameters
rhsthe right hand side of the multiplication operation
Returns
the resulting matrix
Matrix Matrix::operator* ( const value_type rhs) const

operator*. Multiplication of one matrix by a number

Parameters
rhsthe number to multiply by
Returns
the resulting matrix
Matrix Matrix::operator+ ( const Matrix rhs) const

operator+. Sum two matrixes

Parameters
rhsthe matrix to sum
Returns
the resulting matrix
bool Matrix::is_invertible ( ) const
Matrix & Matrix::invert ( )
String Matrix::get_string ( int  spaces = 0,
String  before = String(),
String  after = String() 
) const

Get the string of the Matrix

Returns
String type. A string representation of the matrix components.

Referenced by synfig::ValueNode_BoneInfluence::calculate_transform(), and synfig::ValueNode_BoneInfluence::operator()().

Member Data Documentation

value_type synfig::Matrix::m00

The matrix array.

Referenced by get_axis_x(), operator*=(), and operator+=().

value_type synfig::Matrix::m01

Referenced by get_axis_x(), operator*=(), and operator+=().

value_type synfig::Matrix::m02

Referenced by operator*=(), and operator+=().

value_type synfig::Matrix::m10

Referenced by get_axis_y(), operator*=(), and operator+=().

value_type synfig::Matrix::m11

Referenced by get_axis_y(), operator*=(), and operator+=().

value_type synfig::Matrix::m12

Referenced by operator*=(), and operator+=().

value_type synfig::Matrix::m20

Referenced by get_offset(), operator*=(), and operator+=().

value_type synfig::Matrix::m21

Referenced by get_offset(), operator*=(), and operator+=().

value_type synfig::Matrix::m22

Referenced by operator*=(), and operator+=().


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