tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
Loading...
Searching...
No Matches
tiny_skia::Transform Class Reference

2D affine transformation: [sx kx tx; ky sy ty; 0 0 1]. More...

#include <tiny_skia/Transform.h>

Public Member Functions

std::optional< Transforminvert () const
 Returns the inverse, or nullopt if singular.
 
Transform preConcat (const Transform &other) const
 Returns this * other (other applied first).
 
Transform postConcat (const Transform &other) const
 Returns other * this (this applied first).
 
void mapPoints (std::span< Point > points) const
 Transforms an array of points in-place.
 

Static Public Member Functions

static constexpr Transform fromRow (float sx, float ky, float kx, float sy, float tx, float ty)
 Creates from all 6 matrix entries (row-major: sx, ky, kx, sy, tx, ty).
 

Public Attributes

float sx = 1.0f
 Horizontal scale.
 
float kx = 0.0f
 Horizontal skew.
 
float ky = 0.0f
 Vertical skew.
 
float sy = 1.0f
 Vertical scale.
 
float tx = 0.0f
 Horizontal translation.
 
float ty = 0.0f
 Vertical translation.
 

Detailed Description

Supports translate, scale, skew. Use fromTranslate/fromScale for common cases, fromRow for arbitrary matrices. Compose with preConcat/postConcat.


The documentation for this class was generated from the following file: