Struct RasterHistogramResult
Result of counting a single numeric raster plane into caller-owned bins.
struct RasterHistogramResult;
The histogram bins are not retained in this result: the caller owns the destination slice supplied to histogramInto. On success, belowRange and aboveRange count values outside the closed requested range; nanCount counts floating-point NaNs (zero for integer inputs). Infinite floating samples belong to the corresponding out-of-range category.
On error, all three result counters AND the entire caller-supplied bins slice are zero. The default .init state is an invalid-plane failure.
Fields
| Name | Type | Description |
|---|---|---|
aboveRange
|
ulong | Samples strictly above the upper bound, including +Infinity. |
belowRange
|
ulong | Samples strictly below the lower bound, including -Infinity. |
nanCount
|
ulong | NaN samples, for floating-point sources only. |
Properties
| Name | Type | Description |
|---|---|---|
error[get]
|
RasterHistogramError | The operation's result or error category. |
ok[get]
|
bool | Whether all counts were produced successfully. |
Example
Example checking the failing default result and zero counts.
import raster;
RasterHistogramResult result;
assert(!result .ok);
assert(result .error == RasterHistogramError .invalidPlane);
assert(result .belowRange == 0);
assert(result .aboveRange == 0);
assert(result .nanCount == 0);