Skip to content

LabelCullScratch

Defined in: labels/cull.ts:196

Reusable buffers for cullLabels. Placement runs on the per-frame path (every setTransform re-places every label), so the caller holds ONE of these and passes it back in: the steady-state cull then allocates nothing but the survivor array. Same shape of contract as core/declutter’s core!DeclutterScratch.

lastTests / lastPlaced / lastCandidates describe the last call — the deterministic signature the per-frame guard asserts on (tests must stay O(candidates), never O(candidates²)).

aux: Int32Array

Defined in: labels/cull.ts:216


boxes: Float64Array

Defined in: labels/cull.ts:207

Placed AABBs, stride 4: minX, minY, maxX, maxY.


corners: Float64Array

Defined in: labels/cull.ts:209

Placed corners, stride 8: x0,y0, x1,y1, x2,y2, x3,y3 (for the oriented SAT test).


head: Int32Array

Defined in: labels/cull.ts:203

Per-cell head of the intrusive list of placed labels (−1 = empty).


hist: Uint32Array

Defined in: labels/cull.ts:217


keyHi: Uint32Array

Defined in: labels/cull.ts:214

Radix scratch (large candidate sets only, see RADIX_MIN): the sortable high/low words of each candidate’s priority, the ping-pong target, and the 16-bit digit histogram.


keyLo: Uint32Array

Defined in: labels/cull.ts:215


keys: Float64Array

Defined in: labels/cull.ts:201

Candidate priorities, indexed BY CANDIDATE INDEX, so the placement-order sort compares two typed reads instead of two property loads through the candidate array (6.5× faster at 200k).


lastCandidates: number

Defined in: labels/cull.ts:223

In-viewport candidates considered by the last call.


lastPlaced: number

Defined in: labels/cull.ts:221

Labels placed by the last call.


lastTests: number

Defined in: labels/cull.ts:219

Pairwise overlap tests performed by the last call.


next: Int32Array

Defined in: labels/cull.ts:205

Next placed label in the same cell (−1 = end).


order: Int32Array

Defined in: labels/cull.ts:198

Candidate indices, in placement (priority-descending) order.


oriented: Uint8Array

Defined in: labels/cull.ts:211

1 when the placed label is rotated (needs SAT rather than the AABB verdict).