Module raster.arithmetic_into

v0.2 arithmetic convenience wrappers over zipTransformInto().

These wrappers define common same-type arithmetic without introducing separate execution, layout, aliasing, allocation, or failure engines.

Supported convenience sample types:

integer

byte, ubyte, short, ushort, int, uint, long, ulong

floating

float, double

Integer add/subtract/multiply results are defined modulo 2^N in the destination sample type T. This is explicit raster-d API semantics rather than an accidental consequence of integer promotion.

Floating add/subtract/multiply/divide use D's IEEE-754 floating semantics for T, including NaN, infinities, signed zero, overflow and underflow.

Integer division is deliberately not provided because D runtime integer division has undefined cases (zero divisor and signed min / -1) while the generic zip primitive has no per-element failure channel. A safe integer division policy belongs in a separately specified checked operation.

Date

2026-10-06

Functions

NameDescription
addInto(left, leftPlaneIndex, right, rightPlaneIndex, destination, destinationPlaneIndex, error) Adds corresponding samples from left and right into destination.
divideInto(left, leftPlaneIndex, right, rightPlaneIndex, destination, destinationPlaneIndex, error) Divides corresponding left samples by right samples into destination.
multiplyInto(left, leftPlaneIndex, right, rightPlaneIndex, destination, destinationPlaneIndex, error) Multiplies corresponding left/right samples into destination.
subtractInto(left, leftPlaneIndex, right, rightPlaneIndex, destination, destinationPlaneIndex, error) Subtracts corresponding right samples from left samples into destination.