std1.0.0-beta-7 SafeC docs

std :: gui::gui_path

Struct std::GuiMatrix

#include <std/gui/gui_path.h> source

struct GuiMatrix {
    float a;
    float b;
    float c;
    float d;
    float e;
    float f;
}

x' = ax + cy + e y' = bx + dy + f

Fields

§float asource
§float bsource
§float csource
§float dsource
§float esource
§float fsource

Methods

§static struct GuiMatrix identity()source · definition
§static struct GuiMatrix translation(float tx, float ty)source · definition
§static struct GuiMatrix scaling(float sx, float sy)source · definition
§static struct GuiMatrix rotation(float radians)source · definition
§static struct GuiMatrix new(float a, float b, float c, float d, float e, float f)source · definition
§struct GuiMatrix mul(struct GuiMatrix inner) constsource · definition

'self' applied after 'inner': (self * inner)(p) = self(inner(p)).

§struct GuiMatrix translate(float tx, float ty) constsource · definition

self * T/S/R — i.e. the new transform first translates/scales/ rotates points, then applies self (how a canvas' translate() etc. compose).

§struct GuiMatrix scale(float sx, float sy) constsource · definition
§struct GuiMatrix rotate(float radians) constsource · definition
§int invert(&GuiMatrix out) constsource · definition

1 and the inverse in 'out', or 0 if the matrix is singular.

§float apply_x(float x, float y) constsource · definition
§float apply_y(float x, float y) constsource · definition
§struct GuiRect apply_rect(struct GuiRect r) constsource · definition

The transformed bounding box of 'r'.

§float scale_factor() constsource · definition

sqrt(|det|): how much the matrix scales areas, per axis on average.

§int is_identity() constsource · definition
§int is_translation() constsource · definition

only e/f differ from identity

§int is_axis_aligned() constsource · definition

no rotation/skew (b == c == 0)