Function tryFillRasterPlane

Fills one logical destination plane with one exact sample value.

bool tryFillRasterPlane(T)(
  scope ref WritableRasterView!T destination,
  size_t planeIndex,
  T value
) nothrow @nogc @safe;

Every validated writable resident layout is semantically supported, including positive/negative strides and valid non-injective mappings.

Non-injective mappings are well-defined for fill because every logical coordinate writes the same exact T value. Repeated writes to one reachable sample start are therefore idempotent.

A valid empty destination plane succeeds as a no-op.

Returns false only when planeIndex does not select a logical destination plane.

The operation is allocation-free and retains no operand.

Example

Example rejecting a fill when no destination plane exists.

import raster;
WritableRasterView!ubyte destination;
assert(!tryFillRasterPlane(destination, 0, cast(ubyte) 7));