class PF2d::Transform

Defined in:

pf2d/transform.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

[View source]
def self.new #

[View source]

Class Method Detail

def self.identity #

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

Return a new inverted version of the given matrix


[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 bounding_box(x : Number, y : Number) #

Return the boudning box of the current transformation matrix


[View source]
def invert #

Invert the transformation


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

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

[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(n : Number) #

Scale both x and y by n


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

ditto


[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]