Struct RasterHistogram256Result
Value result of an exact ubyte frequency histogram.
struct RasterHistogram256Result;
bins[v] contains the number of selected logical samples equal to v. All 256 counts belong to the result value; no source storage is borrowed or retained. The caller may independently copy or modify the bins.
The default state is an unsuccessful invalid-plane result with 256 zero counts. On every failure the complete returned bins array is zero, never a partial accumulation. Inspect ok before using a result as a histogram.
Fields
| Name | Type | Description |
|---|---|---|
bins
|
ulong[256] | Exact frequency counts indexed by the original ubyte sample value. |
Properties
| Name | Type | Description |
|---|---|---|
error[get]
|
RasterHistogram256Error | Returns the reduction's success or failure category. |
ok[get]
|
bool | Whether the complete histogram was calculated successfully. |
Example
Example checking the deliberately failing default result.
import raster;
RasterHistogram256Result result;
assert(!result .ok);
assert(result .error == RasterHistogram256Error .invalidPlane);
foreach (count; result .bins)
assert(count == 0);