SourceClass Matrix
from skia import Matrixclass Matrix:Methods§
def get(self, /, row: int, col: int) -> float§
Sourcedef is_identity(self, /) -> bool§
Returns true if the matrix is identity. The identity matrix is:
Sourcedef map_point(self, /, x: float, y: float) -> tuple[float, float]§
Returns the point multiplied by the matrix. Given:
the result is computed as:
Sourcedef post_rotate(self, /, x: float, y: float, degs: float) -> None§
Sets the matrix to a matrix constructed from rotating by degrees about the pivot point
pivot, multiplied by the matrix. This can be thought of as rotating about a pivot point
after applying the matrix.
Positive degrees rotates clockwise.
Given:
where
sets the matrix to:
Sourcedef post_scale(self, /, sx: float, sy: float) -> None§
Sets the matrix to a matrix constructed from scaling by (sx, sy) about the pivot point
pivot, multiplied by the matrix. This can be thought of as scaling about a pivot point
after applying the matrix.
Given:
where
sets the matrix to:
sxhorizontal scale factorsyvertical scale factor
Sourcedef post_translate(self, /, tx: float, ty: float) -> None§
Sets the matrix to a matrix constructed from translation delta multiplied by the matrix.
This can be thought of as moving the point to be mapped after applying the matrix.
Given:
sets the matrix to:
Sourcedef pre_rotate(self, /, x: float, y: float, degs: float) -> None§
Sets the matrix to the matrix multiplied by a matrix constructed from rotating by degrees
about the pivot point pivot. This can be thought of as rotating about a pivot point before
applying the matrix.
Positive degrees rotates clockwise.
Given:
where
sets the matrix to:
Sourcedef pre_scale(self, /, sx: float, sy: float) -> None§
Sets the matrix to the matrix multiplied by a matrix constructed from scaling by (sx, sy)
about the pivot point pivot. This can be thought of as scaling about a pivot point before
applying the matrix.
Given:
where
sets the matrix to:
sxhorizontal scale factorsyvertical scale factor
Sourcedef pre_translate(self, /, tx: float, ty: float) -> None§
Sets the matrix to the matrix multiplied by a matrix constructed from translation delta.
This can be thought of as moving the point to be mapped before applying the matrix.
Given:
sets the matrix to:
Sourcedef set_all(self, /, a1: float, a2: float, a3: float, b1: float, b2: float, b3: float, c1: float, c2: float, c3: float) -> None§
Sets all values from parameters. Sets the matrix to:
Sourcedef set_identity(self, /) -> None§
Sets the matrix to identity, which has no effect on mapped points. Sets the matrix to:
Also called skia.Matrix.reset(); use the one that provides better inline documentation.
Sourcedef set_rotate(self, /, x: float, y: float, degs: float) -> None§
Sets the matrix to rotate by degrees about a pivot point at pivot. The pivot point is
unchanged when mapped with the matrix.
Positive degrees rotates clockwise.
Sourcedef set_scale(self, /, sx: float, sy: float) -> None§
Sets the matrix to scale by (sx, sy), about a pivot point at pivot. The pivot point is
unchanged when mapped with the matrix.
sxhorizontal scale factorsyvertical scale factor
Sourcedef set_translate(self, /, tx: float, ty: float) -> None§
Sets the matrix to translate by v.