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

NameTypeDescription
bins ulong[256]Exact frequency counts indexed by the original ubyte sample value.

Properties

NameTypeDescription
error[get] RasterHistogram256ErrorReturns the reduction's success or failure category.
ok[get] boolWhether 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);