class PF2d::Transform

Defined in:

pf2d/transform.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(matrix : PF2d::Mat3x3(Float64)) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.identity #

[View source]
def self.invert(matrix : Mat3x3) #

Return a new inverted version of the given matrix


[View source]
def self.planar_perspective(src : Quad, dst : Quad) #

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


[View source]
def self.rotation(angle : Number) #

Returns a matrix representing a 2d rotation


[View source]
def self.scale(x : Number, y : Number) #

Returns a matrix representing a 2d scaling


[View source]
def self.shear(x : Number, y : Number) #

Returns a matrix representing a 2d shear


[View source]
def self.translation(x : Number, y : Number) #

Returns a matrix representing a 2d translation


[View source]

Instance Method Detail

def apply(x : Number, y : Number) #

[View source]
def apply(point : PF2d::Vec) #

[View source]
def apply(points : Enumerable(PF2d::Vec)) #

[View source]
def apply(points : Enumerable(PF2d::Vec), &) #

[View source]
def bounding_box(x : Number, y : Number) #

Return the boudning box of the current transformation matrix


[View source]
def distort(src : Quad, dst : Quad) #

[View source]
def invert #

Invert the transformation


[View source]
def matrix : Mat3x3(Float64) #

[View source]
def matrix=(matrix : Mat3x3(Float64)) #

[View source]
def reset #

Reset the transformation to the identity matrix


[View source]
def rotate(angle : Number) #

Rotate by angle (in radians)


[View source]
def scale(x : Number, y : Number) #

Scale by x and y


[View source]
def scale(point : PF2d::Vec) #

ditto


[View source]
def scale(n : Number) #

Scale both x and y by n


[View source]
def shear(x : Number, y : Number) #

Shear by x and y


[View source]
def shear(point : PF2d::Vec) #

ditto


[View source]
def translate(x : Number, y : Number) #

Translate by x and y


[View source]
def translate(point : PF2d::Vec) #

ditto


[View source]