libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
agc.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2021, Ideas On Board
4 *
5 * IPU3 AGC/AEC mean-based control algorithm
6 */
7
8#pragma once
9
10#include <linux/intel-ipu3.h>
11
12#include <libcamera/base/utils.h>
13
14#include <libcamera/geometry.h>
15
16#include "libipa/agc_mean_luminance.h"
17#include "libipa/histogram.h"
18
19#include "algorithm.h"
20
21 namespace libcamera {
22
23 struct IPACameraSensorInfo;
24
25 namespace ipa::ipu3::algorithms {
26
27 class Agc : public Algorithm, public AgcMeanLuminance
28{
29 public:
30 Agc();
31 ~Agc() = default;
32
33 int init(IPAContext &context, const ValueNode &tuningData) override;
34 int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
35 void process(IPAContext &context, const uint32_t frame,
36 IPAFrameContext &frameContext,
37 const ipu3_uapi_stats_3a *stats,
38 ControlList &metadata) override;
39
40 private:
41 double estimateLuminance(double gain) const override;
42 Histogram parseStatistics(const ipu3_uapi_stats_3a *stats,
43 const ipu3_uapi_grid_config &grid);
44
45 utils::Duration minExposureTime_;
46 utils::Duration maxExposureTime_;
47
48 double minAnalogueGain_;
49 double maxAnalogueGain_;
50
51 uint32_t stride_;
52 double rGain_;
53 double gGain_;
54 double bGain_;
55 ipu3_uapi_grid_config bdsGrid_;
56 std::vector<std::tuple<uint8_t, uint8_t, uint8_t>> rgbTriples_;
57};
58
59} /* namespace ipa::ipu3::algorithms */
60
61} /* namespace libcamera */
agc_mean_luminance.h
Base class implementing mean luminance AEGC.
libcamera::ControlList
Associate a list of ControlId with their values for an object.
Definition controls.h:409
libcamera::ValueNode
A class representing a tree structure of values.
Definition value_node.h:27
libcamera::ipa::Histogram
The base class for creating histograms.
Definition histogram.h:23
libcamera::ipa::ipu3::algorithms::Agc::process
void process(IPAContext &context, const uint32_t frame, IPAFrameContext &frameContext, const ipu3_uapi_stats_3a *stats, ControlList &metadata) override
Process IPU3 statistics, and run AGC operations.
Definition agc.cpp:205
libcamera::ipa::ipu3::algorithms::Agc::configure
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override
Configure the AGC given a configInfo.
Definition agc.cpp:95
libcamera::ipa::ipu3::algorithms::Agc::init
int init(IPAContext &context, const ValueNode &tuningData) override
Initialise the AGC algorithm from tuning files.
Definition agc.cpp:75
libcamera::utils::Duration
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition utils.h:331
geometry.h
Data structures related to geometric objects.
histogram.h
Class to represent Histograms and manipulate them.
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17
libcamera::IPACameraSensorInfo
Report the image sensor characteristics.
Definition core_ipa_interface.h:31
libcamera::ipa::ipu3::IPAContext
Global IPA context data shared between all algorithms.
Definition ipa_context.h:86
libcamera::ipa::ipu3::IPAFrameContext
IPU3-specific FrameContext.
Definition ipa_context.h:79
utils.h
Miscellaneous utility functions.