Monado OpenXR Runtime
Loading...
Searching...
No Matches
u_autoexpgain.h File Reference

Automatically compute exposure and gain values from an image stream. More...

#include "xrt/xrt_frame.h"
#include <stdint.h>
Include dependency graph for u_autoexpgain.h:

Go to the source code of this file.

Enumerations

enum  u_aeg_strategy { U_AEG_STRATEGY_TRACKING = 0 , U_AEG_STRATEGY_DYNAMIC_RANGE , U_AEG_STRATEGY_COUNT }
 An auto exposure/gain strategy tunes the algorithm for specific objectives. More...
 

Functions

struct u_autoexpgainu_autoexpgain_create (enum u_aeg_strategy strategy, bool enabled_from_start, int frame_delay)
 Create auto exposure and gain (AEG) algorithm object.
 
void u_autoexpgain_add_vars (struct u_autoexpgain *aeg, void *root, char *prefix)
 Setup UI for the AEG algorithm.
 
void u_autoexpgain_update (struct u_autoexpgain *aeg, struct xrt_frame *xf)
 Update the AEG with a frame.
 
float u_autoexpgain_get_exposure (struct u_autoexpgain *aeg)
 Get currently computed exposure value in usecs.
 
float u_autoexpgain_get_gain (struct u_autoexpgain *aeg)
 Get currently computed gain value in the [0, 255] range.
 
void u_autoexpgain_destroy (struct u_autoexpgain **aeg)
 Destroy AEG object.
 

Detailed Description

Automatically compute exposure and gain values from an image stream.

Author
Mateo de Mayo mateo.nosp@m..dem.nosp@m.ayo@c.nosp@m.olla.nosp@m.bora..nosp@m.com

Enumeration Type Documentation

◆ u_aeg_strategy

An auto exposure/gain strategy tunes the algorithm for specific objectives.

Enumerator
U_AEG_STRATEGY_TRACKING 

Lower exposure and gain at the cost of darker images.

U_AEG_STRATEGY_DYNAMIC_RANGE 

Tries to maximize the image information.

Function Documentation

◆ u_autoexpgain_add_vars()

◆ u_autoexpgain_create()

struct u_autoexpgain * u_autoexpgain_create ( enum u_aeg_strategy  strategy,
bool  enabled_from_start,
int  frame_delay 
)

Create auto exposure and gain (AEG) algorithm object.

Parameters
strategyWhat objective is preferred for the algorithm.
enabled_from_startUpdate exposure/gain from the start.
frame_delayAbout how many frames does it take for exp and gain to settle in.
Returns
struct u_autoexpgain* Created object

References u_autoexpgain::brightness, brightness_to_expgain(), u_var_combo::count, u_var_histogram_f32::count, u_autoexpgain::enable, u_autoexpgain::exposure, u_autoexpgain::frame_delay, u_autoexpgain::gain, u_autoexpgain::histogram, u_autoexpgain::histogram_ui, u_autoexpgain::last_brightness, LEVELS, u_autoexpgain::max_brightness_step, u_var_combo::options, u_autoexpgain::overshoots, u_autoexpgain::state, u_autoexpgain::strategy, u_autoexpgain::strategy_combo, u_autoexpgain::threshold, U_TYPED_CALLOC, u_var_combo::value, u_var_histogram_f32::values, and u_autoexpgain::wait.

◆ u_autoexpgain_destroy()

void u_autoexpgain_destroy ( struct u_autoexpgain **  aeg)

Destroy AEG object.

◆ u_autoexpgain_get_exposure()

float u_autoexpgain_get_exposure ( struct u_autoexpgain aeg)

Get currently computed exposure value in usecs.

References u_autoexpgain::exposure.

Referenced by update_expgain().

◆ u_autoexpgain_get_gain()

float u_autoexpgain_get_gain ( struct u_autoexpgain aeg)

Get currently computed gain value in the [0, 255] range.

References u_autoexpgain::gain.

Referenced by update_expgain().

◆ u_autoexpgain_update()

void u_autoexpgain_update ( struct u_autoexpgain aeg,
struct xrt_frame xf 
)

Update the AEG with a frame.

References update_expgain().

Referenced by update_expgain().