Skia.Matrix (Skia v0.1.1)

Copy Markdown View Source

2D affine transform matrix used by shaders and canvas transforms.

Summary

Functions

Identity matrix.

Creates a matrix from Skia's 2D affine tuple {sx, kx, tx, ky, sy, ty}.

Rotation matrix around the origin, in degrees.

Scale matrix.

Skew matrix.

Translation matrix.

Types

t()

@type t() :: %Skia.Matrix{
  values: {float(), float(), float(), float(), float(), float()}
}

Functions

identity()

@spec identity() :: t()

Identity matrix.

new(arg)

@spec new({number(), number(), number(), number(), number(), number()}) :: t()

Creates a matrix from Skia's 2D affine tuple {sx, kx, tx, ky, sy, ty}.

rotate(degrees)

@spec rotate(number()) :: t()

Rotation matrix around the origin, in degrees.

scale(x, y)

@spec scale(number(), number()) :: t()

Scale matrix.

skew(x, y)

@spec skew(number(), number()) :: t()

Skew matrix.

translate(x, y)

@spec translate(number(), number()) :: t()

Translation matrix.