Loading...
Searching...
No Matches
agc.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2021, Ideas On Board
*
* IPU3 AGC/AEC mean-based control algorithm
*/
#pragma once
#include <linux/intel-ipu3.h>
#include <libcamera/base/utils.h>
#include <libcamera/geometry.h>
#include "libipa/agc_mean_luminance.h"
#include "libipa/histogram.h"
#include "algorithm.h"
namespace libcamera {
struct IPACameraSensorInfo;
namespace ipa::ipu3::algorithms {
class Agc : public Algorithm, public AgcMeanLuminance
{
public:
Agc();
~Agc() = default;
int init(IPAContext &context, const YamlObject &tuningData) override;
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
void process(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
const ipu3_uapi_stats_3a *stats,
ControlList &metadata) override;
private:
double estimateLuminance(double gain) const override;
Histogram parseStatistics(const ipu3_uapi_stats_3a *stats,
const ipu3_uapi_grid_config &grid);
utils::Duration minExposureTime_;
utils::Duration maxExposureTime_;
double minAnalogueGain_;
double maxAnalogueGain_;
uint32_t stride_;
double rGain_;
double gGain_;
double bGain_;
ipu3_uapi_grid_config bdsGrid_;
std::vector<std::tuple<uint8_t, uint8_t, uint8_t>> rgbTriples_;
};
} /* namespace ipa::ipu3::algorithms */
} /* 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::YamlObject
A class representing the tree structure of the YAML content.
Definition yaml_parser.h:28
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 YamlObject &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:322
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.