class

PF2d::Transform

Inherits Reference < Object

Constructors

new(matrix : PF2d::Mat3x3(Float64))
Source

Class methods

identity
Source
invert(matrix : Mat3x3)

Return a new inverted version of the given matrix

Source
planar_perspective(src : Quad, dst : Quad)

https://docs.opencv.org/4.x/d9/dab/tutorial_homography.html

Source
rotation(angle : Number)

Returns a matrix representing a 2d rotation

Source
scale(x : Number, y : Number)

Returns a matrix representing a 2d scaling

Source
shear(x : Number, y : Number)

Returns a matrix representing a 2d shear

Source
translation(x : Number, y : Number)

Returns a matrix representing a 2d translation

Source

Instance methods

apply(x : Number, y : Number)
Source
apply(point : PF2d::Vec)
Source
apply(points : Enumerable(PF2d::Vec))
Source
apply(points : Enumerable(PF2d::Vec), &)
Source
bounding_box(x : Number, y : Number)

Return the boudning box of the current transformation matrix

Source
distort(src : Quad, dst : Quad)
Source
invert

Invert the transformation

Source
matrix
Source
matrix=(matrix : Mat3x3(Float64))
Source
reset

Reset the transformation to the identity matrix

Source
rotate(angle : Number)

Rotate by angle (in radians)

Source
scale(x : Number, y : Number)

Scale by x and y

Source
scale(point : PF2d::Vec)

ditto

Source
scale(n : Number)

Scale both x and y by n

Source
shear(x : Number, y : Number)

Shear by x and y

Source
shear(point : PF2d::Vec)

ditto

Source
translate(x : Number, y : Number)

Translate by x and y

Source
translate(point : PF2d::Vec)

ditto

Source