Function minMax
Returns both minimum and maximum of one selected logical raster plane.
RasterMinMaxResult!T minMax(T)(
scope RasterView!T source,
size_t planeIndex
) nothrow @nogc @safe
if (isSupportedExtremaSample!T);
minMax performs one logical pass.
Its minimum and maximum are semantically identical to separate min() and max() calls over the same logical samples, including NaN propagation, infinities and signed-zero tie handling.
Empty input fails with RasterExtremaError.emptyInput.
All validated resident signed affine layouts are semantically equivalent. The operation allocates nothing and retains no source.
Example
Example compiling ordinary and UFCS extrema forms.
import raster;
RasterView!float source;
const ordinary =
min(
source,
0
);
const ufcs =
source .max(
0
);
const pair =
source .minMax(
0
);
assert(!ordinary .ok);
assert(!ufcs .ok);
assert(!pair .ok);
assert(
ordinary .error
== RasterExtremaError .invalidPlane
);
assert(ufcs .error == ordinary .error);
assert(pair .error == ordinary .error);