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