Monado OpenXR Runtime
Loading...
Searching...
No Matches
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.
 
enum u_aeg_state state
 AEG is a finite state machine.
 
enum u_logging_level log_level
 
int overshoots
 Counts how many times we've overshooted in the last brightness change.
 
int wait
 There are buffer states that wait frame_delay frames to ensure we are not overshooting.
 
enum u_aeg_strategy strategy
 The selected strategy affects various targets of the algorithm.
 
struct u_var_combo strategy_combo
 UI combo box for selecting strategy
 
float histogram [256]
 Pixel intensity histogram.
 
struct u_var_histogram_f32 histogram_ui
 UI for histogram
 
struct u_var_draggable_f32 brightness
 This is a made up scalar that lives in the [0, 1] range.
 
float last_brightness
 Triggers a exp/gain update when it differs.
 
float max_brightness_step
 Max brightness step for each update.
 
float current_score
 The AEG score lives in the [-1, +1] range and represents how dark or bright this image is.
 
float threshold
 Scores further than threshold from the target score will trigger a brightness update.
 
int frame_delay
 A camera might take a couple of frames until the new exposure/gain sets in the image.
 
float exposure
 Currently computed exposure value to use.
 
float gain
 Currently computed gain value to use.
 
struct u_aeg_step steps [U_AEG_MAX_STEPS]
 Custom exp/gain table, used instead of the strategy's default when not empty.
 
int steps_count
 

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 u_autoexpgain_add_vars(), u_autoexpgain_create(), u_autoexpgain_create_with_steps(), and 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.

Referenced by u_autoexpgain_add_vars().

◆ enable

bool u_autoexpgain::enable

Whether to enable auto exposure and gain adjustment.

Referenced by u_autoexpgain_add_vars(), and u_autoexpgain_create().

◆ exposure

float u_autoexpgain::exposure

Currently computed exposure value to use.

Referenced by u_autoexpgain_create(), u_autoexpgain_create_with_steps(), 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.

Referenced by set_state(), u_autoexpgain_add_vars(), u_autoexpgain_create(), and u_autoexpgain_create_with_steps().

◆ gain

float u_autoexpgain::gain

Currently computed gain value to use.

Referenced by u_autoexpgain_create(), u_autoexpgain_create_with_steps(), u_autoexpgain_get_gain(), and update_expgain().

◆ histogram

float u_autoexpgain::histogram[256]

Pixel intensity histogram.

Referenced by get_score(), and u_autoexpgain_create().

◆ histogram_ui

struct u_var_histogram_f32 u_autoexpgain::histogram_ui

UI for histogram

Referenced by u_autoexpgain_add_vars(), and u_autoexpgain_create().

◆ last_brightness

float u_autoexpgain::last_brightness

Triggers a exp/gain update when it differs.

Referenced by u_autoexpgain_create(), and update_expgain().

◆ max_brightness_step

float u_autoexpgain::max_brightness_step

Max brightness step for each update.

Referenced by u_autoexpgain_add_vars(), and u_autoexpgain_create().

◆ 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.

Referenced by set_state(), and u_autoexpgain_create().

◆ 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().

◆ steps

struct u_aeg_step u_autoexpgain::steps[U_AEG_MAX_STEPS]

Custom exp/gain table, used instead of the strategy's default when not empty.

Referenced by brightness_to_expgain(), and u_autoexpgain_create_with_steps().

◆ strategy

enum u_aeg_strategy u_autoexpgain::strategy

The selected strategy affects various targets of the algorithm.

Referenced by brightness_to_expgain(), get_score(), u_autoexpgain_create(), and u_autoexpgain_create_with_steps().

◆ strategy_combo

struct u_var_combo u_autoexpgain::strategy_combo

UI combo box for selecting strategy

Referenced by u_autoexpgain_add_vars(), and u_autoexpgain_create().

◆ threshold

float u_autoexpgain::threshold

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

Referenced by u_autoexpgain_add_vars(), and u_autoexpgain_create().

◆ 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

Referenced by set_state(), and u_autoexpgain_create().


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