NAME

Intertangle::Taffeta::Transform::Affine2D - A 2D affine transform

VERSION

version 0.001

EXTENDS

ATTRIBUTES

matrix

The Intertangle::Yarn::Graphene::Matrix matrix representing the affine transform.

This matrix is the identity matrix by default.

cairo_matrix

A Cairo::Matrix representation of the affine transform.

svg_transform

A Str representation of the affine transform that can be used with transform attribute for SVG elements such as <g> or graphics elements.

See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform.

METHODS

BUILDARGS

matrix_abcdef

[
    a c 0 0
    b d 0 0
    0 0 1 0
    e f 0 1
]

matrix_xy

[
   xx yx  0  0
   xy yy  0  0
    0  0  1  0
   x0 y0  0  1
]

If keys are not given for either approach, the default values for the identity matrix are used:

a, d : 1
b, c : 0
e, f : 0

xx, yy : 1
yx, xy : 0
x0, y0 : 0

compose

Compose the transform with another transform by using matrix multiplication: (this x that).

compose_premultiply

Compose the transform with another transform by using matrix multiplication: (that x this).

apply_to_bounds

Apply the transformation to a Intertangle::Yarn::Graphene::Rect.

apply_to_point

Apply the transformation to a Intertangle::Yarn::Graphene::Point.

apply_to_vec3

Apply the transformation to a Intertangle::Yarn::Graphene::Vec3.

AUTHOR

Zakariyya Mughal <zmughal@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Zakariyya Mughal.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.