Function subtractInto
Subtracts corresponding right samples from left samples into destination.
bool subtractInto(T)(
scope RasterView!T left,
size_t leftPlaneIndex,
scope RasterView!T right,
size_t rightPlaneIndex,
scope ref WritableRasterView!T destination,
size_t destinationPlaneIndex,
out RasterZipTransformError error
) nothrow @nogc @safe
if (isRasterArithmeticSample!T);
Supported T:
byte, ubyte, short, ushort, int, uint, long, ulong, float, double
Integer result:
mathematical difference reduced modulo 2^N to T
Floating result:
D/IEEE-754 subtraction in T
Structural, alias, failure, allocation and execution semantics are inherited unchanged from zipTransformInto().
Example
Example reporting subtract failure through the shared zip-transform model.
import raster;
RasterView!float left;
RasterView!float right;
WritableRasterView!float destination;
RasterZipTransformError error;
assert(!subtractInto(left, 0, right, 0, destination, 0, error));
assert(error == RasterZipTransformError .invalidLeftPlane);