libcamera v0.0.0+3240-f2a18172-dirty (2022-02-06T09:24:04+00:00)
Supporting cameras in Linux since 2019
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 * agc.h - IPU3 AGC/AEC mean-based control algorithm
6 */
7#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__
8#define __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__
9
10#include <linux/intel-ipu3.h>
11
13
14#include <libcamera/geometry.h>
15
16#include "algorithm.h"
17
18namespace libcamera {
19
20struct IPACameraSensorInfo;
21
22namespace ipa::ipu3::algorithms {
23
24class Agc : public Algorithm
25{
26public:
27 Agc();
28 ~Agc() = default;
29
30 int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
31 void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override;
32
33private:
34 void measureBrightness(const ipu3_uapi_stats_3a *stats,
35 const ipu3_uapi_grid_config &grid);
36 void filterExposure();
37 void computeExposure(IPAFrameContext &frameContext, double currentYGain);
38 double computeInitialY(IPAFrameContext &frameContext,
39 const ipu3_uapi_grid_config &grid,
40 const ipu3_uapi_stats_3a *stats,
41 double currentYGain);
42
43 uint64_t frameCount_;
44
45 double iqMean_;
46
47 utils::Duration lineDuration_;
48 utils::Duration minShutterSpeed_;
49 utils::Duration maxShutterSpeed_;
50
51 double minAnalogueGain_;
52 double maxAnalogueGain_;
53
54 utils::Duration filteredExposure_;
55 utils::Duration currentExposure_;
56
57 uint32_t stride_;
58};
59
60} /* namespace ipa::ipu3::algorithms */
61
62} /* namespace libcamera */
63
64#endif /* __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__ */
Algorithm common interface.
The base class for all IPU3 algorithms.
Definition: algorithm.h:19
A mean-based auto-exposure algorithm.
Definition: agc.h:25
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override
Configure the AGC given a configInfo.
Definition: agc.cpp:88
void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override
Process IPU3 statistics, and run AGC operations.
Definition: agc.cpp:313
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition: utils.h:324
Data structures related to geometric objects.
Top-level libcamera namespace.
Definition: backtrace.h:17
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:63
Per-frame context for algorithms.
Definition: ipa_context.h:36
Miscellaneous utility functions.