Monado OpenXR Runtime
u_autoexpgain Struct Reference

Auto exposure and gain (AEG) adjustment algorithm state. More...

Collaboration diagram for u_autoexpgain:

Data Fields

bool enable
 Whether to enable auto exposure and gain adjustment. More...
 
enum u_aeg_state state
 AEG is a finite state machine. More...
 
enum u_logging_level log_level
 
int overshoots
 Counts how many times we've overshooted in the last brightness change. More...
 
int wait
 There are buffer states that wait frame_delay frames to ensure we are not overshooting. More...
 
enum u_aeg_strategy strategy
 The selected strategy affects various targets of the algorithm. More...
 
struct u_var_combo strategy_combo
 UI combo box for selecting strategy More...
 
float histogram [256]
 Pixel intensity histogram. More...
 
struct u_var_histogram_f32 histogram_ui
 UI for histogram More...
 
struct u_var_draggable_f32 brightness
 This is a made up scalar that lives in the [0, 1] range. More...
 
float last_brightness
 Triggers a exp/gain update when it differs. More...
 
float max_brightness_step
 Max brightness step for each update. More...
 
float current_score
 The AEG score lives in the [-1, +1] range and represents how dark or bright this image is. More...
 
float threshold
 Scores further than threshold from the target score will trigger a brightness update. More...
 
int frame_delay
 A camera might take a couple of frames until the new exposure/gain sets in the image. More...
 
float exposure
 Currently computed exposure value to use. More...
 
float gain
 Currently computed gain value to use. More...
 

Detailed Description

Auto exposure and gain (AEG) adjustment algorithm state.

Field Documentation

◆ brightness

struct u_var_draggable_f32 u_autoexpgain::brightness

This is a made up scalar that lives in the [0, 1] range.

0 maps to minimum exp/gain values while 1 to their maximums. An autoexposure strategy limits itself to modify this value. The mapping between the scalar and the respective exp/gain values is provided by brightness_to_expgain.

Referenced by update_expgain().

◆ current_score

float u_autoexpgain::current_score

The AEG score lives in the [-1, +1] range and represents how dark or bright this image is.

Values close to zero (by threshold) represent images with a good enough brightness value.

◆ enable

bool u_autoexpgain::enable

Whether to enable auto exposure and gain adjustment.

Referenced by u_autoexpgain_create().

◆ exposure

float u_autoexpgain::exposure

Currently computed exposure value to use.

Referenced by u_autoexpgain_get_exposure(), and update_expgain().

◆ frame_delay

int u_autoexpgain::frame_delay

A camera might take a couple of frames until the new exposure/gain sets in the image.

Knowing how many (this variable) helps in avoiding overshooting brightness changes.

◆ gain

float u_autoexpgain::gain

Currently computed gain value to use.

Referenced by u_autoexpgain_get_gain(), and update_expgain().

◆ histogram

float u_autoexpgain::histogram[256]

Pixel intensity histogram.

Referenced by get_score().

◆ histogram_ui

struct u_var_histogram_f32 u_autoexpgain::histogram_ui

UI for histogram

◆ last_brightness

float u_autoexpgain::last_brightness

Triggers a exp/gain update when it differs.

Referenced by update_expgain().

◆ max_brightness_step

float u_autoexpgain::max_brightness_step

Max brightness step for each update.

◆ overshoots

int u_autoexpgain::overshoots

Counts how many times we've overshooted in the last brightness change.

It's then used for exponential backoff of the brightness step.

◆ state

enum u_aeg_state u_autoexpgain::state

AEG is a finite state machine.

See also
set_state.

Referenced by set_state(), and u_autoexpgain_create().

◆ strategy

enum u_aeg_strategy u_autoexpgain::strategy

The selected strategy affects various targets of the algorithm.

Referenced by get_score().

◆ strategy_combo

struct u_var_combo u_autoexpgain::strategy_combo

UI combo box for selecting strategy

◆ threshold

float u_autoexpgain::threshold

Scores further than threshold from the target score will trigger a brightness update.

◆ wait

int u_autoexpgain::wait

There are buffer states that wait frame_delay frames to ensure we are not overshooting.

This field counts the remaining frames to wait.

See also
set_state

The documentation for this struct was generated from the following file: