Function transformInto
Applies one compile-time same-type point transform from a selected source plane into a selected writable destination plane.
bool transformInto(alias transform, T)(
scope RasterView!T source,
size_t sourcePlaneIndex,
scope ref WritableRasterView!T destination,
size_t destinationPlaneIndex,
out RasterTransformError error
) nothrow @nogc @safe;
This is the v0.2 destination-oriented spelling of the existing qualified point-transform semantic.
The transform alias must be usable as:
@safe pure nothrow @nogc T -> T
source is deliberately the first runtime argument so the same free function supports ordinary-call and UFCS forms.
Structural, aliasing, layout, empty-input and failure semantics are exactly those of tryTransformRasterPlane():
- source and destination plane indices must be valid; - source and destination logical shapes must match; - matching empty shapes succeed without invoking transform; - destination mapping must be injective; - actual source/destination sample-byte overlap is rejected before writing; - every validated signed affine resident layout is supported; - structural failure occurs before the first destination write.
The function allocates no storage, retains neither operand, performs no implicit conversion and adds no scheduling or execution-policy surface.
The additional source/destination plane indices are a compatibility bridge while RasterPlaneView/WritableRasterPlaneView are not yet production types. A later plane-view overload may remove that plumbing without changing this semantic engine.
Example
Example using the v0.2 transform name through UFCS.
import raster;
alias plusOne =
(float value)
@safe pure nothrow @nogc
=> value + 1.0f;
RasterView!float source;
WritableRasterView!float destination;
RasterTransformError error;
assert(
!source .transformInto!plusOne(
0,
destination,
0,
error
)
);
assert(
error
== RasterTransformError .invalidSourcePlane
);