libcamera v0.5.0+59-d83ff0a4
Supporting cameras in Linux since 2019
ipa_context.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2021, Google Inc.
4 *
5 * IPU3 IPA Context
6 *
7 */
8
9#pragma once
10
11#include <linux/intel-ipu3.h>
12
14
15#include <libcamera/controls.h>
16#include <libcamera/geometry.h>
17
18#include <libipa/fc_queue.h>
19
20namespace libcamera {
21
22namespace ipa::ipu3 {
23
25 struct {
26 ipu3_uapi_grid_config bdsGrid;
28 uint32_t stride;
30
31 struct {
32 ipu3_uapi_grid_config afGrid;
33 } af;
34
35 struct {
40 } agc;
41
42 struct {
43 int32_t defVBlank;
47};
48
50 struct {
51 uint32_t focus;
53 bool stable;
54 } af;
55
56 struct {
57 uint32_t exposure;
58 double gain;
59 uint32_t constraintMode;
60 uint32_t exposureMode;
61 } agc;
62
63 struct {
64 struct {
65 double red;
66 double green;
67 double blue;
69
71 } awb;
72
73 struct {
74 double gamma;
75 struct ipu3_uapi_gamma_corr_lut gammaCorrection;
77};
78
80 struct {
81 uint32_t exposure;
82 double gain;
84};
85
86struct IPAContext {
87 IPAContext(unsigned int frameContextSize)
88 : frameContexts(frameContextSize)
89 {
90 }
91
94
96
98};
99
100} /* namespace ipa::ipu3 */
101
102} /* namespace libcamera*/
std::unordered_map< const ControlId *, ControlInfo > Map
The base std::unsorted_map<> container.
Definition: controls.h:369
Describe a two-dimensional size.
Definition: geometry.h:51
A support class for managing FrameContext instances in IPA modules.
Definition: fc_queue.h:33
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition: utils.h:371
Framework to manage controls related to an object.
Queue of per-frame contexts.
Data structures related to geometric objects.
Top-level libcamera namespace.
Definition: backtrace.h:17
Context for a frame.
Definition: fc_queue.h:24
The active state of the IPA algorithms.
Definition: ipa_context.h:49
struct libcamera::ipa::ipu3::IPAActiveState::@12 toneMapping
Context for ToneMapping and Gamma control.
uint32_t focus
Current position of the lens.
Definition: ipa_context.h:51
double blue
White balance gain for B channel.
Definition: ipa_context.h:67
struct ipu3_uapi_gamma_corr_lut gammaCorrection
Per-pixel tone mapping implemented as a LUT.
Definition: ipa_context.h:75
double temperatureK
Estimated color temperature.
Definition: ipa_context.h:70
struct libcamera::ipa::ipu3::IPAActiveState::@9 af
Context for the Automatic Focus algorithm.
struct libcamera::ipa::ipu3::IPAActiveState::@11 awb
Context for the Automatic White Balance algorithm.
uint32_t exposure
Exposure time expressed as a number of lines.
Definition: ipa_context.h:57
double green
White balance gain for G channel.
Definition: ipa_context.h:66
struct libcamera::ipa::ipu3::IPAActiveState::@10 agc
Context for the Automatic Gain Control algorithm.
double red
White balance gain for R channel.
Definition: ipa_context.h:65
struct libcamera::ipa::ipu3::IPAActiveState::@11::@13 gains
White balance gains.
double gain
Analogue gain multiplier.
Definition: ipa_context.h:58
double maxVariance
The maximum variance of the current image.
Definition: ipa_context.h:52
bool stable
It is set to true, if the best focus is found.
Definition: ipa_context.h:53
double gamma
Gamma value for the LUT.
Definition: ipa_context.h:74
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:86
IPAActiveState activeState
The current state of IPA algorithms.
Definition: ipa_context.h:93
IPASessionConfiguration configuration
The IPA session configuration, immutable during the session.
Definition: ipa_context.h:92
ControlInfoMap::Map ctrlMap
A ControlInfoMap::Map of controls populated by the algorithms.
Definition: ipa_context.h:97
IPAContext(unsigned int frameContextSize)
Initialize the instance with the given number of frame contexts.
Definition: ipa_context.h:87
FCQueue< IPAFrameContext > frameContexts
Ring buffer of the IPAFrameContext(s)
Definition: ipa_context.h:95
IPU3-specific FrameContext.
Definition: ipa_context.h:79
struct libcamera::ipa::ipu3::IPAFrameContext::@14 sensor
Effective sensor values that were applied for the frame.
double gain
Analogue gain multiplier.
Definition: ipa_context.h:82
uint32_t exposure
Exposure time expressed as a number of lines.
Definition: ipa_context.h:81
Session configuration for the IPA module.
Definition: ipa_context.h:24
utils::Duration maxExposureTime
Maximum exposure time supported with the configured sensor.
Definition: ipa_context.h:37
ipu3_uapi_grid_config afGrid
AF scene grid configuration.
Definition: ipa_context.h:32
int32_t defVBlank
The default vblank value of the sensor.
Definition: ipa_context.h:43
Size size
Sensor output resolution.
Definition: ipa_context.h:45
double maxAnalogueGain
Maximum analogue gain supported with the configured sensor.
Definition: ipa_context.h:39
utils::Duration minExposureTime
Minimum exposure time supported with the configured sensor.
Definition: ipa_context.h:36
struct libcamera::ipa::ipu3::IPASessionConfiguration::@6 af
AF grid configuration of the IPA.
uint32_t stride
Number of cells on one line including the ImgU padding.
Definition: ipa_context.h:28
struct libcamera::ipa::ipu3::IPASessionConfiguration::@8 sensor
Sensor-specific configuration of the IPA.
ipu3_uapi_grid_config bdsGrid
Bayer Down Scaler grid plane config used by the kernel.
Definition: ipa_context.h:26
double minAnalogueGain
Minimum analogue gain supported with the configured sensor.
Definition: ipa_context.h:38
utils::Duration lineDuration
Line duration in microseconds.
Definition: ipa_context.h:44
Size bdsOutputSize
BDS output size configured by the pipeline handler.
Definition: ipa_context.h:27
struct libcamera::ipa::ipu3::IPASessionConfiguration::@5 grid
Grid configuration of the IPA.
struct libcamera::ipa::ipu3::IPASessionConfiguration::@7 agc
AGC parameters configuration of the IPA.
Miscellaneous utility functions.