Function tryRgbPercentile

Find each channel's nearest-rank stored-byte percentile. The percentile is an integer from 0 through 100. Zero selects the minimum observed byte; for 1..100 the one-based rank is ceil(percentile * includedPixels / 100). The smallest byte whose cumulative count reaches that rank is returned. This is a discrete order statistic with no interpolation or colour-space conversion. An empty selection, percentile above 100, or malformed public record returns false and leaves published unchanged. The computation is exact for the full ulong count domain without an overflowing product. No raster access or allocation occurs.

bool tryRgbPercentile(
  ref const(RgbHistogram256) histogram,
  uint percentile,
  ref ubyte[3] published
) pure nothrow @nogc @safe;

Parameters

NameDescription
histogram Completed RGB histogram returned by tryRgbHistogram256.
percentile Whole-number percentile in [0, 100].
published R, G, B stored-byte values, assigned on success.

Returns

true when a nonempty valid record yields all three values.