Skip to content

raisin::RgbaLuminanceMetrics ​

struct · #include <rayrai/Capture.hpp>

Display-space luminance statistics of an RGBA8 image (RayraiWindow::analyzeRgbaLuminance()).

Luminance is Rec. 709 luma (0.2126 R + 0.7152 G + 0.0722 B) of the 8-bit values normalized to [0, 1], without linearization. Alpha is ignored.

Public attributes ​

width ​

cpp
int width

Image width passed in, pixels.

height ​

cpp
int height

Image height passed in, pixels.

pixelCount ​

cpp
size_t pixelCount

Pixels analyzed (limited by the buffer size).

averageLuminance ​

cpp
double averageLuminance

Mean luminance.

medianLuminance ​

cpp
double medianLuminance

50th-percentile luminance.

p95Luminance ​

cpp
double p95Luminance

95th-percentile luminance.

p99Luminance ​

cpp
double p99Luminance

99th-percentile luminance.

minLuminance ​

cpp
double minLuminance

Darkest pixel luminance.

maxLuminance ​

cpp
double maxLuminance

Brightest pixel luminance.

averageSaturation ​

cpp
double averageSaturation

Mean HSV-style saturation, (max - min) / max per pixel.

contrastP95ToMedian ​

cpp
double contrastP95ToMedian

p95Luminance / medianLuminance (0 when the median is ~0).

clippedChannelFraction ​

cpp
double clippedChannelFraction

Fraction of RGB channel values >= 250.

RaiSim — physics for robotics and AI.