Represents a 2D transformation matrix.
More...
#include <novasvg.h>
|
| | Matrix ()=default |
| | Initializes the matrix to the identity matrix.
|
| |
| | Matrix (float a, float b, float c, float d, float e, float f) |
| | Constructs a matrix with the specified values.
|
| |
| | Matrix (const matrix_t &matrix) |
| |
| | Matrix (const Transform &transform) |
| |
| Matrix | operator* (const Matrix &matrix) const |
| | Multiplies this matrix with another matrix.
|
| |
| Matrix & | operator*= (const Matrix &matrix) |
| | Multiplies this matrix with another matrix in place.
|
| |
| Matrix & | multiply (const Matrix &matrix) |
| | Multiplies this matrix with another matrix.
|
| |
| Matrix & | translate (float tx, float ty) |
| | Translates this matrix by the specified offsets.
|
| |
| Matrix & | scale (float sx, float sy) |
| | Scales this matrix by the specified factors.
|
| |
| Matrix & | rotate (float angle, float cx=0.f, float cy=0.f) |
| | Rotates this matrix by the specified angle around a point.
|
| |
| Matrix & | shear (float shx, float shy) |
| | Shears this matrix by the specified factors.
|
| |
| Matrix & | invert () |
| | Inverts this matrix.
|
| |
| Matrix | inverse () const |
| | Returns the inverse of this matrix.
|
| |
| void | reset () |
| | Resets this matrix to the identity matrix.
|
| |
|
| static Matrix | translated (float tx, float ty) |
| | Creates a translation matrix with the specified offsets.
|
| |
| static Matrix | scaled (float sx, float sy) |
| | Creates a scaling matrix with the specified factors.
|
| |
| static Matrix | rotated (float angle, float cx=0.f, float cy=0.f) |
| | Creates a rotation matrix with the specified angle around a point.
|
| |
| static Matrix | sheared (float shx, float shy) |
| | Creates a shearing matrix with the specified factors.
|
| |
|
| float | a {1} |
| | The horizontal scaling factor.
|
| |
| float | b {0} |
| | The vertical shearing factor.
|
| |
| float | c {0} |
| | The horizontal shearing factor.
|
| |
| float | d {1} |
| | The vertical scaling factor.
|
| |
| float | e {0} |
| | The horizontal translation offset.
|
| |
| float | f {0} |
| | The vertical translation offset.
|
| |
Represents a 2D transformation matrix.
Definition at line 216 of file novasvg.h.
◆ Matrix() [1/4]
| novasvg::Matrix::Matrix |
( |
| ) |
|
|
default |
◆ Matrix() [2/4]
| novasvg::Matrix::Matrix |
( |
float |
a, |
|
|
float |
b, |
|
|
float |
c, |
|
|
float |
d, |
|
|
float |
e, |
|
|
float |
f |
|
) |
| |
|
inline |
Constructs a matrix with the specified values.
- Parameters
-
| a | The horizontal scaling factor. |
| b | The vertical shearing factor. |
| c | The horizontal shearing factor. |
| d | The vertical scaling factor. |
| e | The horizontal translation offset. |
| f | The vertical translation offset. |
Definition at line 748 of file novasvg.h.
◆ Matrix() [3/4]
| novasvg::Matrix::Matrix |
( |
const matrix_t & |
matrix | ) |
|
|
inline |
◆ Matrix() [4/4]
| novasvg::Matrix::Matrix |
( |
const Transform & |
transform | ) |
|
|
inline |
◆ inverse()
| Matrix novasvg::Matrix::inverse |
( |
| ) |
const |
|
inline |
◆ invert()
| Matrix & novasvg::Matrix::invert |
( |
| ) |
|
|
inline |
Inverts this matrix.
- Returns
- A reference to this matrix after inversion.
Definition at line 808 of file novasvg.h.
References inverse().
◆ multiply()
Multiplies this matrix with another matrix.
- Parameters
-
| matrix | The matrix to multiply with. |
- Returns
- A reference to this matrix after multiplication.
Definition at line 778 of file novasvg.h.
Referenced by rotate(), scale(), shear(), and translate().
◆ operator*()
| Matrix novasvg::Matrix::operator* |
( |
const Matrix & |
matrix | ) |
const |
|
inline |
Multiplies this matrix with another matrix.
- Parameters
-
| matrix | The matrix to multiply with. |
- Returns
- A new matrix that is the result of the multiplication.
Definition at line 763 of file novasvg.h.
◆ operator*=()
| Matrix & novasvg::Matrix::operator*= |
( |
const Matrix & |
matrix | ) |
|
|
inline |
Multiplies this matrix with another matrix in place.
- Parameters
-
| matrix | The matrix to multiply with. |
- Returns
- A reference to this matrix after multiplication.
Definition at line 773 of file novasvg.h.
◆ reset()
| void novasvg::Matrix::reset |
( |
| ) |
|
|
inline |
Resets this matrix to the identity matrix.
Definition at line 813 of file novasvg.h.
References Matrix().
◆ rotate()
| Matrix & novasvg::Matrix::rotate |
( |
float |
angle, |
|
|
float |
cx = 0.f, |
|
|
float |
cy = 0.f |
|
) |
| |
|
inline |
Rotates this matrix by the specified angle around a point.
- Parameters
-
| angle | The rotation angle in degrees. |
| cx | The x-coordinate of the center of rotation. |
| cy | The y-coordinate of the center of rotation. |
- Returns
- A reference to this matrix after rotation.
Definition at line 793 of file novasvg.h.
References multiply(), and rotated().
◆ rotated()
| Matrix novasvg::Matrix::rotated |
( |
float |
angle, |
|
|
float |
cx = 0.f, |
|
|
float |
cy = 0.f |
|
) |
| |
|
inlinestatic |
Creates a rotation matrix with the specified angle around a point.
- Parameters
-
| angle | The rotation angle in degrees. |
| cx | The x-coordinate of the center of rotation. |
| cy | The y-coordinate of the center of rotation. |
- Returns
- A new rotation matrix.
Definition at line 828 of file novasvg.h.
References novasvg::Transform::rotated().
Referenced by rotate().
◆ scale()
| Matrix & novasvg::Matrix::scale |
( |
float |
sx, |
|
|
float |
sy |
|
) |
| |
|
inline |
Scales this matrix by the specified factors.
- Parameters
-
| sx | The horizontal scaling factor. |
| sy | The vertical scaling factor. |
- Returns
- A reference to this matrix after scaling.
Definition at line 783 of file novasvg.h.
References multiply(), and scaled().
◆ scaled()
| Matrix novasvg::Matrix::scaled |
( |
float |
sx, |
|
|
float |
sy |
|
) |
| |
|
inlinestatic |
Creates a scaling matrix with the specified factors.
- Parameters
-
| sx | The horizontal scaling factor. |
| sy | The vertical scaling factor. |
- Returns
- A new scaling matrix.
Definition at line 823 of file novasvg.h.
References novasvg::Transform::scaled().
Referenced by scale().
◆ shear()
| Matrix & novasvg::Matrix::shear |
( |
float |
shx, |
|
|
float |
shy |
|
) |
| |
|
inline |
Shears this matrix by the specified factors.
- Parameters
-
| shx | The horizontal shearing factor. |
| shy | The vertical shearing factor. |
- Returns
- A reference to this matrix after shearing.
Definition at line 798 of file novasvg.h.
References multiply(), and sheared().
◆ sheared()
| Matrix novasvg::Matrix::sheared |
( |
float |
shx, |
|
|
float |
shy |
|
) |
| |
|
inlinestatic |
Creates a shearing matrix with the specified factors.
- Parameters
-
| shx | The horizontal shearing factor. |
| shy | The vertical shearing factor. |
- Returns
- A new shearing matrix.
Definition at line 833 of file novasvg.h.
References novasvg::Transform::sheared().
Referenced by shear().
◆ translate()
| Matrix & novasvg::Matrix::translate |
( |
float |
tx, |
|
|
float |
ty |
|
) |
| |
|
inline |
Translates this matrix by the specified offsets.
- Parameters
-
| tx | The horizontal translation offset. |
| ty | The vertical translation offset. |
- Returns
- A reference to this matrix after translation.
Definition at line 788 of file novasvg.h.
References multiply(), and translated().
◆ translated()
| Matrix novasvg::Matrix::translated |
( |
float |
tx, |
|
|
float |
ty |
|
) |
| |
|
inlinestatic |
Creates a translation matrix with the specified offsets.
- Parameters
-
| tx | The horizontal translation offset. |
| ty | The vertical translation offset. |
- Returns
- A new translation matrix.
Definition at line 818 of file novasvg.h.
References novasvg::Transform::translated().
Referenced by translate().
| float novasvg::Matrix::a {1} |
The horizontal scaling factor.
Definition at line 348 of file novasvg.h.
| float novasvg::Matrix::b {0} |
The vertical shearing factor.
Definition at line 349 of file novasvg.h.
| float novasvg::Matrix::c {0} |
The horizontal shearing factor.
Definition at line 350 of file novasvg.h.
| float novasvg::Matrix::d {1} |
The vertical scaling factor.
Definition at line 351 of file novasvg.h.
| float novasvg::Matrix::e {0} |
The horizontal translation offset.
Definition at line 352 of file novasvg.h.
| float novasvg::Matrix::f {0} |
The vertical translation offset.
Definition at line 353 of file novasvg.h.
The documentation for this class was generated from the following file:
- /home/runner/work/novasvg/novasvg/include/novasvg/novasvg.h