Skip to content

LayoutBase

Source: LayoutBase.h

CoordSink

struct CoordSink
src/light/layouts/LayoutBase.h:46

The sink a layout emits its positions into — a builder with one method per KIND of pixel, not a coordinate plus a boolean flag.

pixel() is a normal light that maps to a logical cell; blackPixel() is a GAP: a physical wire slot the driver still clocks (so data flows through it on a continuous strand) that stays black, mapping to no logical light. A layout with no dark regions only ever calls pixel() and stays unaware blackPixel() exists; the black/lit choice is made once, at the emit site, where the layout already knows the position.

This is the builder/visitor-sink shape — named emit methods per variant, as in Skia's SkPath (moveTo/lineTo/close) or a SAX/serde visitor — chosen over a bool black parameter (the "boolean-trap" a named method avoids). The two function pointers are the consumer's wiring: cb receives lit pixels; blackCb receives gaps, and is null for a consumer that doesn't distinguish them (a plain bounding-box or count walk), in which case a gap falls back to a normal pixel.

Public Attributes

CoordCallback cb

CoordCallback blackCb

void * ctx

Public Methods

inline void pixel(nrOfLightsType idx, lengthType x, lengthType y, lengthType z) const : A normal light at physical index idx, position (x,y,z). What every layout calls.

inline void blackPixel(nrOfLightsType idx, lengthType x, lengthType y, lengthType z) const : A GAP light: a physical slot that stays black.

LayoutBase

class LayoutBase
src/light/layouts/LayoutBase.h:66

Inherits: MoonModule

Base for one layout child of the Layouts container.

A concrete layout (grid, sphere shell, …) implements lightCount and forEachCoord directly — no wrapper. Every layout control changes the physical light count, so any control change triggers the pipeline-wide rebuild.

Public Methods

virtual inline ModuleRole role() const override : Role for type identification (no RTTI needed).

virtual nrOfLightsType lightCount() const

virtual void forEachCoord(constCoordSink & sink) const

virtual inline bool hasBlackPixels() const : Whether this layout emits any GAP (black) pixels — physical wire slots held dark.

virtual inline bool affectsPrepare(constchar *) const override : Every layout control (grid width/height/depth, …) changes the physical light count and therefore needs the pipeline-wide rebuild.