/** * SVG `transform` attribute parsing and exact affine application. * * A matrix is stored as the 6-tuple [a, b, c, d, e, f] matching SVG's * matrix(a b c d e f), i.e. * x' = a*x + c*y + e * y' = b*x + d*y + f * * Lines and beziers transform exactly by mapping their control points. Arcs are * handled exactly too: the unit-circle-to-ellipse matrix is rebuilt and * re-decomposed (2x2 SVD) so a transformed circle/ellipse arc remains an exact * (possibly rotated) ellipse arc, with sweep orientation flipped on reflection. */ import { Base } from "@bitbybit-dev/base"; import { SvgSegment, SvgSubpath } from "./svg-models"; export type Matrix = [number, number, number, number, number, number]; export declare const IDENTITY: Matrix; /** Compose so the result applied to a point = m1(m2(point)). */ export declare function multiply(m1: Matrix, m2: Matrix): Matrix; export declare function applyToPoint(m: Matrix, p: Base.Point2): Base.Point2; /** Parse a `transform` attribute value into a single composed matrix. */ export declare function parseTransform(value: string | undefined | null): Matrix; export declare function transformSegment(m: Matrix, seg: SvgSegment): SvgSegment; export declare function transformSubpath(m: Matrix, sp: SvgSubpath): SvgSubpath;