[][src]Module wlroots::render::matrix

Matrix math is used to render things on a computer screen. This is common throughout computer graphics, for examples and primers on using matrix math to render things to screens please read an OpengGL tutorial.

In wlroots we primarily use a 3x3 matrix of 32 bit floating point values to represent a 2D screen. We also provide basic helper functions to assist in transforming the matrices.

Constants

IDENTITY

Functions

multiply

Multiply two matrices together.

project_box

Shortcut for the various matrix operations involved in projecting the specified wlr_box onto a given orthographic projection with a given rotation. The result can be applied to each coordinate of the box to get a new coordinate from [-1,1].

projection

Create a 2D orthographic projection matrix of (width, height) with a specified wl_output_transform

rotate

Rotate the matrix by some amount of radians.

scale

Scales the 2D matrix to a magnitude of (x, y).

transform

Transform the matrix based on the given Wayland output transform mode.

translate

Translate the 2D matrix to a magnitude of (x, y).

transpose

Flip the values over the diagonal of a matrix