Module raster.data_plane

Scoped data-plane access for downstream kernels.

This is the first, deliberately narrow, public step toward the data-plane contract tracked by raster-d issue #261. The contiguous helper admits a flat logical region; the affine helper below additionally supports signed row and sample strides, including interleaved layouts, while keeping the same callback-scoped lifetime and aliasing rules.

Date

2026-10-23

Functions

NameDescription
withContiguousPlane(view, planeIndex, callback) Visits one flat contiguous read plane without per-sample bounds checks.
withContiguousPlane(view, planeIndex, callback) Visits one flat contiguous writable plane without per-sample bounds checks.
withContiguousPlanesInto(source, sourcePlanes, destination, destinationPlanes, sourceSlices, destinationSlices, kernel) Visits several validated flat-contiguous source and destination planes in one synchronous callback. The callback is entered only after every plane has passed contiguous-layout validation; no partial execution occurs.
withPlane(view, planeIndex, callback) Visits any validated affine read plane. The callback is synchronous and receives no raw pointer; load preserves arbitrary signed strides.
withPlane(view, planeIndex, callback) Visits any validated affine writable plane without exposing a pointer.
withPlanesInto(source, sourcePlanes, destination, destinationPlanes, sourceWindows, destinationWindows, kernel) Validates and exposes multiple source and destination planes as one synchronous kernel invocation.
withPlanesIntoParallel(source, sourcePlanes, destination, destinationPlanes, sourceWindows, destinationWindows, workerLimit, minimumChunk, kernel) Validates affine planes and executes a bounded row-parallel kernel.
withPlanesIntoParallelPhases(source, sourcePlanes, destination, destinationPlanes, sourceWindows, destinationWindows, workerLimit, minimumChunk, phases) Performs multiple synchronous row phases under one validated source-to-destination borrow. Destination alias checks are identical to withPlanesIntoParallel; the destination windows remain callback-scoped.
withPlanesParallel(source, sourcePlanes, sourceWindows, workerLimit, minimumChunk, kernel) Validates read-only affine planes and executes a bounded row-parallel kernel. Unlike withPlanesIntoParallel, this source-only form does not require a fabricated destination. Read-only planes may overlap.
withPlanesParallelPhases(source, sourcePlanes, sourceWindows, workerLimit, minimumChunk, phases) Performs multiple synchronous row phases under one validated source-only borrow. phases owns the operation barrier: every forRows call joins its callbacks before returning, so callers may reduce phase-local state before starting the next phase.
withViewsIntoParallelPhases(sources, sourcePlanes, sourceWindows, destination, destinationPlanes, destinationWindows, workerLimit, minimumChunk, phases) Multi-view source-to-destination phased execution. Source views may have distinct backings, while all source and destination views must share the same logical extent. Destination alias checks are conservative and are performed before the callback is entered.
withViewsParallelPhases(sources, sourcePlanes, sourceWindows, workerLimit, minimumChunk, phases) Performs multiple synchronous row phases over planes belonging to several independently backed, read-only views. All views must have the same logical extent. sourcePlanes[i] selects planes from sources[i] and sourceWindows[i] is caller-owned workspace for the corresponding callback-scoped windows.

Structs

NameDescription
RasterPlaneRow A callback-scoped row view of a validated affine plane.
RasterPlaneWindow A validated, read-only affine plane window valid only inside one callback.
WritableRasterPlaneRow A callback-scoped writable row view of a validated affine plane.
WritableRasterPlaneWindow A validated, writable affine plane window valid only inside one callback.