Skip to content

CheckerboardModifier

CheckerboardModifier is a coordinate modifier that masks alternating pixels in a checkerboard pattern: pixels where (x + y + z) % 2 == 1 are set to NO_VIRT (physical LED goes black), while even-sum pixels pass through unchanged.

Purpose

Checkerboard masking is the reference for the NO_VIRT mask path in EffectsLayer::applyModifiers(). It demonstrates that a modifier can eliminate individual physical LEDs from the output without shrinking the buffer.

Controls

Key UI type Default Description
enabled toggle true When false the modifier is bypassed

The checkerboard pattern has no configurable parameters: it is always (x + y + z) % 2 == 1 masked.

Wiring

Add as a child of an EffectsLayer:

{ "type": "CheckerboardModifier", "id": "checker1", "parent_id": "effects1" }

Behaviour

  • Static (isStatic() == true): the mask is computed once at map-build time. Masked physical LEDs receive NO_VIRT in the per-layer PhysMap and are skipped in the blend loop.
  • Does not change buffer dimensions: modifyDims() is a no-op.
  • Composable: can be combined with MirrorModifier in the same chain.

Test coverage

See Modifiers — masking of odd-sum pixels, identity on even-sum pixels, composition with MirrorModifier.

Source