fontlabapp.contours.affine · declarations 001
Back to fontlabapp.contours.affine
Affine
module-attribute
Affine
SINGULAR_EPSILON
module-attribute
SINGULAR_EPSILON
apply
apply(t: Affine, x: float, y: float, *, finite: bool = True) -> tuple[float, float]
Map one point (x, y) through t.
concat
Apply first, then then (Qt's row-vector first * then).
Order matters. With finite set, both inputs and the result must be
finite; an overflow therefore raises ValueError too.
from_qtransform
from_qtransform(qt_transform: Any, *, finite: bool = True) -> Affine
Copy a QTransform into six floats; retain no native wrapper.
invert
Return the inverse of t.
Raises ValueError for a non-finite or singular matrix (|det| below
SINGULAR_EPSILON).
rotation
rotation(degrees: float) -> Affine
Return a rotation about the origin; positive turns x toward y.
viewport_transform
viewport_transform(canvas: Any, point_type: Callable[[float, float], Any]) -> Affine
Sample canvas.mapToViewportF at (0,0), (1,0), (0,1) as one Affine.
mapToViewportF maps canvas units to widget pixels and is affine. Three
samples fix it. point_type is the caller's QPointF class; it keeps
this module free of Qt. Read fresh at each paint or poll: pan and zoom
change the map. Raises ValueError when the native map is non-finite.