Function min

Returns the minimum sample of one selected logical raster plane.

RasterExtremaResult!T min(T)(
  scope RasterView!T source,
  size_t planeIndex
) nothrow @nogc @safe
if (isSupportedExtremaSample!T);

Supported sample types are:

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

real and non-numeric representation-only Raster sample types are rejected at compile time.

A valid empty selected plane fails with RasterExtremaError.emptyInput.

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 minimum 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 min.

import raster;
RasterView!float source;
const result = source.min(0);
assert(!result.ok);
assert(result.error == RasterExtremaError.invalidPlane);