Constructor
new Matrix(aopt, bopt, copt, dopt, txopt, tyopt)
Creates a new one with the specified parameter
Matrix
Object.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
a |
Number
|
<optional> |
1 | a (optional) a value that affects the location of pixels along the X axis when scaling or rotating images. |
b |
Number
|
<optional> |
0 | b (optional) a value that affects the positioning of pixels along the Y axis when rotating or tilting an image. |
c |
Number
|
<optional> |
0 | c (optional) a value that affects the positioning of pixels along the X axis when rotating or tilting an image. |
d |
Number
|
<optional> |
1 | d (optional) a value that affects the location of pixels along the Y axis when scaling or rotating images. |
tx |
Number
|
<optional> |
0 | tx (optional) the distance of each point along the X axis. |
ty |
Number
|
<optional> |
0 | ty (optional) the distance of each point along the Y axis. |
Member
a :Number
When scaling or rotating an image, it affects the value of pixels positioned along the X axis.
b :Number
When rotating or tilting an image, it affects the location of pixels along the Y axis.
c :Number
When rotating or tilting an image, it affects the location of pixels along the X axis.
d :Number
When scaling or rotating an image, it affects the value of pixels positioned along the Y axis.
tx :Number
Translate the distance along each point along the X axis.
ty :Number
Translate the distance along each point along the Y axis.
Methods
concat(matrix) → {Matrix}
The specified matrix is connected to the current matrix so that the geometric effects of the two matrices are effectively combined.
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix
|
The matrix to connect to the source matrix. |
copyTo(dec) → {Matrix}
Current Matrix Copy all of the matrix data in the object to the specified Matrix In object.
Parameters:
Name | Type | Description |
---|---|---|
dec |
Matrix
|
To copy the current matrix data Matrix Object. |
destroy()
Destroy this object.
getScaleX() → {Number}
Gets the X axis scale value.
Returns:
- Type:
-
Number
X axis scaling.
getScaleY() → {Number}
Gets the Y axis scale value.
Returns:
- Type:
-
Number
Y axis scaling.
invertTransformPoint(out) → {Point}
Applies the inverse transformation of the current matrix to the specified point and returns the point.
Parameters:
Name | Type | Description |
---|---|---|
out |
Point
|
The point Point object to be converted. |
mul(m1, m2, out) → {Matrix}
The result of multiplying the specified two matrices is assigned to the specified output object.
Parameters:
Name | Type | Description |
---|---|---|
m1 |
Matrix
|
Matrix one. |
m2 |
Matrix
|
Matrix two. |
out |
Matrix
|
Output object. |
mul16(m1, m2, out) → {Array}
Multiplies the specified two matrices, and the result is assigned to the specified output array, length 16.
Parameters:
Name | Type | Description |
---|---|---|
m1 |
Matrix
|
Matrix one. |
m2 |
Matrix
|
Matrix two. |
out |
Array
|
Output object Array. |
Returns:
- Type:
-
Array
As a result, the output object out.
rotate(angle)
Yes Matrix Object applies spin conversion.
Parameters:
Name | Type | Description |
---|---|---|
angle |
Number
|
The angle of rotation in radians. |
scale(x, y)
Apply scaling transformations to matrices.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
The multiplier used to scale objects along the X axis. |
y |
Number
|
The multiplier used to scale objects along the Y axis. |
setTo(a, b, c, d, tx, ty) → {Matrix}
take Matrix The member is set to the specified value.
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
When scaling or rotating an image, it affects the value of pixels positioned along the X axis. |
b |
Number
|
When rotating or tilting an image, it affects the location of pixels along the Y axis. |
c |
Number
|
When rotating or tilting an image, it affects the location of pixels along the X axis. |
d |
Number
|
When scaling or rotating an image, it affects the value of pixels positioned along the Y axis. |
tx |
Number
|
Translate the distance along each point along the X axis. |
ty |
Number
|
Translate the distance along each point along the Y axis. |
setTranslate(x, y) → {Matrix}
Sets the distance to each point along the X and Y axes.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Translate the distance along each point along the X axis. |
y |
Number
|
Translate the distance along each point along the Y axis. |
skew(x, y) → {Matrix}
Yes Matrix Object using skew transformation.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Bend the 2D along the X axis. |
y |
Number
|
Bend the 2D along the Y axis. |
toString() → {String}
Returns listing Matrix The text value of the object property.
Returns:
- Type:
-
String
A string that contains Matrix Object property values: A, B, C, D, TX, and ty.
transformPoint(out) → {Point}
take Matrix The geometric transformations represented by the object are applied to the specified points.
Parameters:
Name | Type | Description |
---|---|---|
out |
Point
|
A point used to set output results. |
transformPointN(out) → {Point}
take Matrix Object representation of the geometric transformation applied to the specified point, ignoring TX, ty.
Parameters:
Name | Type | Description |
---|---|---|
out |
Point
|
A point used to set output results. |
translate(x, y) → {Matrix}
The translation matrix along the X and Y axes, the translation change, is specified by the X and Y parameters.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
The amount of movement along the X axis (in pixels). |
y |
Number
|
The amount of moving along the axial direction of Y (in pixels). |