1.0.0 • Published 8 years ago

special-draw-transform v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

special-draw-transform

An efficient way to apply simple transformations (any combination of mirroring and rotation by multiples of 90 degrees.)

GSpecialSessionModifier *
    graphics_special_draw_create_transform_modifier(
         GRect area, GSpecialTransformationType type);

Creates a transform modifier. Supply any of the following GSpecialTransformationTypes:

GSpecialTransformMirrorYR270
GSpecialTransformRotate90
GSpecialTransformRotate270
GSpecialTransformMirrorYR90
GSpecialTransformIdentity [does nothing; included for completeness.]
GSpecialTransformMirrorX
GSpecialTransformMirrorY
GSpecialTransformRotate180

Example of transform types

Rotation must be supplied with a square area.

Technical details

Uses 2×2 linear transformation matrices in which only -1, 0, and 1 are supported. Two fields must be 0 diagonally. All of the 8 possible combinations are already predefined as a GSpecialTransformationType.

If you'd like to extend these abilities, please open an issue or PR!

1.0.0

8 years ago