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.

Data Structures

struct  u_aeg_step
 These are steps for constructing a piecewise linear function that maps brightness into (exposure, gain) pairs. More...
 

Macros

#define U_AEG_MAX_STEPS   16
 Most steps a custom table passed to u_autoexpgain_create_with_steps can have.
 

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_autoexpgain * u_autoexpgain_create (enum u_aeg_strategy strategy, bool enabled_from_start, int frame_delay)
 Create auto exposure and gain (AEG) algorithm object.
 
struct u_autoexpgain * u_autoexpgain_create_with_steps (enum u_aeg_strategy strategy, bool enabled_from_start, int frame_delay, const struct u_aeg_step *steps, int step_count)
 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.
 
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

Macro Definition Documentation

◆ U_AEG_MAX_STEPS

#define U_AEG_MAX_STEPS   16

Most steps a custom table passed to u_autoexpgain_create_with_steps can have.

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 
)

◆ u_autoexpgain_create_with_steps()

struct u_autoexpgain * u_autoexpgain_create_with_steps ( enum u_aeg_strategy  strategy,
bool  enabled_from_start,
int  frame_delay,
const struct u_aeg_step *  steps,
int  step_count 
)

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
Parameters
stepsBrightness ascending, from 0 to 1; copied.
step_countBetween 2 and U_AEG_MAX_STEPS.

References u_autoexpgain::brightness, brightness_to_expgain(), u_autoexpgain::exposure, u_autoexpgain::frame_delay, u_autoexpgain::gain, u_autoexpgain::steps, u_autoexpgain::strategy, U_AEG_MAX_STEPS, and u_autoexpgain_create().

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

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