hal/shader/slug-outline.lisp
The most bands an axis may be cut into when the count is chosen automatically. The reference's format allows 256; more bands cost header texels and, past a point, only overlap epsilon.
How far, in em, a band reaches past its edges when deciding which curves it holds, so a curve grazing a boundary is in both bands. The reference suggests 1/1024.
Encode a straight segment in Slug's {p1,p2,p2} quadratic form.
Return outline's validated curves in contour order.
Return the exact signed area swept by a connected quadratic contour.
Return the largest number of curves any of band-count bands cut along
membership-axis holds, and the total over all bands.
The fewest bands in [1, maximum-count] that minimize the most curves any
one band holds: the reference's advice for choosing a glyph's band counts,
with ties going to the cheaper header block.
Build conservative, sorted horizontal and vertical Slug curve bands.
A band count left unspecified is chosen per axis by choose-slug-band-count.
The most bands an axis may be cut into when the count is chosen automatically. The reference's format allows 256; more bands cost header texels and, past a point, only overlap epsilon.
How far, in em, a band reaches past its edges when deciding which curves it holds, so a curve grazing a boundary is in both bands. The reference suggests 1/1024.
(start end)(left right)Logical conjunction of tests and raw truth values.
Test whether two compatible scalars are equal.
(contour contour-index)(outline)Multiplication and scalar scaling.
Subtraction or unary negation.
Addition over compatible quantities.
Division of two represented quantities.
(contour)(contour)(curve axis)(curve axis)The minimum of compatible quantities.
(curve axis)The maximum of compatible quantities.
(curve axis)(curve axis minimum maximum band-count &key (epsilon 1/1024))(curves axis direction left right)Logical disjunction of tests and raw truth values.
Test whether one compatible scalar is greater than another.
Test whether one compatible scalar is less than another.
(curves membership-axis sort-axis minimum maximum band-count)(curves membership-axis minimum maximum band-count)Return the largest number of curves any of BAND-COUNT bands cut along MEMBERSHIP-AXIS holds, and the total over all bands.
(curves membership-axis minimum maximum
&optional (maximum-count *slug-maximum-band-count*))The fewest bands in [1, MAXIMUM-COUNT] that minimize the most curves any one band holds: the reference's advice for choosing a glyph's band counts, with ties going to the cheaper header block.
(outline &key horizontal-band-count vertical-band-count)Build conservative, sorted horizontal and vertical Slug curve bands. A band count left unspecified is chosen per axis by CHOOSE-SLUG-BAND-COUNT.
Test whether one compatible scalar is at most another.
CPU-owned quadratic outline and Slug band preprocessing.