Function max
Returns the maximum sample of one selected logical raster plane.
RasterExtremaResult!T max(T)(
scope RasterView!T source,
size_t planeIndex
) nothrow @nogc @safe
if (isSupportedExtremaSample!T);
Supported sample types and failure semantics match min().
Floating semantics:
- if any logical sample is NaN, the operation succeeds with a NaN value; - infinities participate as ordinary ordered floating values; - when both signed zeros occur, the maximum is +0 independent of encounter order.
All validated resident signed affine layouts are semantically equivalent. The operation allocates nothing and retains no source.
Example
Example reporting an invalid plane to max.
import raster;
RasterView!float source;
const result = source .max(0);
assert(!result .ok);
assert(result .error == RasterExtremaError .invalidPlane);