diff options
author | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2023-03-10 16:51:25 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2023-03-11 13:14:07 +0100 |
commit | 9613cf0ad0f9ad1e09b76ada7f5e11edfe6a9532 (patch) | |
tree | bfa710353885d49a5ad1b6472469e00102e9ff09 | |
parent | e53dda8bb82b7fda38fd2d11afa10babe3c51a6b (diff) |
ipa: rkisp1: agc: Load ExposureValue from configjmondi/imx8mp/debix-a
Load the initial ExpoureValue correction value from configuration
file.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.cpp | 15 | ||||
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.h | 1 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 97a08c35..cb72962c 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -63,6 +63,7 @@ static constexpr double kEvGainTarget = 0.5; * \todo Why is the value different between IPU3 and RkISP1 ? */ static constexpr double kRelativeLuminanceTarget = 0.4; +static double initExposureValue = 0.0; Agc::Agc() : frameCount_(0), numCells_(0), numHistBins_(0), filteredExposure_(0s) @@ -71,6 +72,17 @@ Agc::Agc() } /** + * \copydoc libcamera::ipa::Algorithm::init + */ +int Agc::init([[maybe_unused]] IPAContext &context, + const YamlObject &tuningData) +{ + initExposureValue = tuningData["ExposureValue"].get<double>().value_or(0.0); + + return 0; +} + +/** * \brief Configure the AGC given a configInfo * \param[in] context The shared IPA context * \param[in] configInfo The IPA configuration data @@ -88,7 +100,8 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) context.activeState.agc.manual.gain = context.activeState.agc.automatic.gain; context.activeState.agc.manual.exposure = context.activeState.agc.automatic.exposure; context.activeState.agc.autoEnabled = !context.configuration.raw; - context.activeState.agc.exposureValue = 0.0; + + context.activeState.agc.exposureValue = initExposureValue; /* * According to the RkISP1 documentation: diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h index 8a222637..0fc3acb5 100644 --- a/src/ipa/rkisp1/algorithms/agc.h +++ b/src/ipa/rkisp1/algorithms/agc.h @@ -25,6 +25,7 @@ public: Agc(); ~Agc() = default; + int init(IPAContext &context, const YamlObject &tuningData) override; int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; void queueRequest(IPAContext &context, const uint32_t frame, |