summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/agc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/rkisp1/algorithms/agc.cpp')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.cpp15
1 files changed, 14 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: