class PF::Transform2d

Defined in:

transform2d.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(matrix : PF::Matrix(Float64, 9)) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.identity #

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

Return a new inverted version of the given matrix


[View source]
def self.rotation(angle : Float | Int) #

Returns a matrix representing a 2d rotation


[View source]
def self.scale(x : Float | Int, y : Float | Int) #

Returns a matrix representing a 2d scaling


[View source]
def self.shear(x : Float | Int, y : Float | Int) #

Returns a matrix representing a 2d shear


[View source]
def self.translation(x : Float | Int, y : Float | Int) #

Returns a matrix representing a 2d translation


[View source]

Instance Method Detail

def apply(x : Float | Int, y : Float | Int) #

[View source]
def apply(point : Vector2) #

[View source]
def bounding_box(x : Float | Int, y : Float | Int) #

Return the boudning box of the current transformation matrix


[View source]
def invert #

Invert the transformation


[View source]
def matrix : Matrix(Float64, 9) #

[View source]
def matrix=(matrix : Matrix(Float64, 9)) #

[View source]
def reset #

Reset the transformation to the identity matrix


[View source]
def rotate(angle : Float | Int) #

Rotate by angle (in radians)


[View source]
def scale(x : Float | Int, y : Float | Int) #

Scale by x and y


[View source]
def scale(point : Vector2) #

ditto


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

Scale both x and y by n


[View source]
def shear(x : Float | Int, y : Float | Int) #

Shear by x and y


[View source]
def shear(point : Vector2) #

ditto


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

Translate by x and y


[View source]
def translate(point : Vector2) #

ditto


[View source]