Enum member isNumericRasterSample

Whether T is one portable numeric raster sample supported by the v0.2 generic numerical operation families.

enum isNumericRasterSample(T) = isRasterSampleType!T && (is(T == byte) || is(T == ubyte) || is(T == short) || is(T == ushort) || is(T == int) || is(T == uint) || is(T == long) || is(T == ulong) || is(T == float) || is(T == double));

This trait is intentionally narrower than isRasterSampleType.

Supported

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

real is deliberately excluded because its precision/representation is target-dependent.

Static arrays and POD pixel structs may still be valid raw raster sample representations, but they are not scalar numeric samples under this trait.

Example

Example distinguishing numeric samples from representation-only samples.

import raster;
static assert(isNumericRasterSample!float);
static assert(isNumericRasterSample!ulong);
static assert(!isNumericRasterSample!real);
static assert(!isNumericRasterSample!(ubyte[4]));