Skip to main content

Crate valo_geometry

Crate valo_geometry 

Source
Expand description

GPU-free geometry and color types for Valo.

Coordinates are y-down with the origin at the top-left. Units are logical pixels until transformed. Matrix is a full 4×4 transform, while draw ordering remains a renderer concern. Color stores straight-alpha sRGB.

Structs§

Color
Color is a straight-alpha sRGB color.
Contour
Contour is one path contour flattened into a polyline.
ContourMeasure
ContourMeasure finds positions, tangents, and segments by distance along a contour.
Dash
Dash defines alternating painted and skipped lengths along each contour.
Matrix
Matrix is a full 4×4 column-major transform.
Path
Path is an immutable collection of line and Bézier contours.
PathBuilder
PathBuilder records commands used to create an immutable Path.
PathSample
PathSample contains a position and direction along a measured contour.
Point
Point is a position or vector in two-dimensional coordinates.
Rect
Rect is an axis-aligned rectangle in Valo’s y-down coordinate system.
Size
Size is a width and height in two-dimensional coordinates.
Stroke
Stroke describes the width, ends, joins, and optional dash pattern of a line.

Enums§

Cap
Cap determines how a stroke ends at an open contour.
FillRule
FillRule determines which regions of overlapping contours are filled.
Join
Join determines how consecutive stroke segments meet.
MatrixKind
MatrixKind classifies the behavior relevant to two-dimensional rendering.
Winding
Winding selects the traversal direction of a closed contour.

Functions§

constrain_radii
constrain_radii proportionally reduces circular radii to fit a rectangle.
constrain_radii_elliptical
constrain_radii_elliptical proportionally reduces elliptical radii to fit.
dash_contours
dash_contours splits contours into the painted stretches of a dash pattern.
local_tolerance
local_tolerance returns local curve tolerance for quarter-pixel device error.
stroke_contains
stroke_contains reports whether a point lies inside expanded stroke geometry.
stroke_strip
stroke_strip expands contours into triangle-strip vertices.