summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/agc.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-09-13 16:42:12 +0200
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-03-11 13:14:00 +0100
commite53dda8bb82b7fda38fd2d11afa10babe3c51a6b (patch)
treed0cb9886c7bb0f89652392e2416f1c50a3cde9f8 /src/ipa/rkisp1/algorithms/agc.cpp
parent97da589e657467f1d1e5d48b7fb838e1ad9e988d (diff)
ipa: rkisp: Add support for ExposureValue
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/ipa/rkisp1/algorithms/agc.cpp')
-rw-r--r--src/ipa/rkisp1/algorithms/agc.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp
index 4c702576..97a08c35 100644
--- a/src/ipa/rkisp1/algorithms/agc.cpp
+++ b/src/ipa/rkisp1/algorithms/agc.cpp
@@ -88,6 +88,7 @@ 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;
/*
* According to the RkISP1 documentation:
@@ -129,6 +130,12 @@ void Agc::queueRequest(IPAContext &context,
{
auto &agc = context.activeState.agc;
+ const auto exposureValue = controls.get(controls::ExposureValue);
+ if (exposureValue) {
+ LOG(RkISP1Agc, Debug) << "Set ExposureValue to: " << *exposureValue;
+ agc.exposureValue = *exposureValue;
+ }
+
if (!context.configuration.raw) {
const auto &agcEnable = controls.get(controls::AeEnable);
if (agcEnable && *agcEnable != agc.autoEnabled) {
@@ -308,6 +315,10 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext,
*/
exposureValue = filterExposure(exposureValue);
+ const auto &agc = context.activeState.agc;
+ double exposureAdj = std::pow(2 * 1.0, agc.exposureValue);
+ exposureValue *= exposureAdj;
+
/*
* Push the shutter time up to the maximum first, and only then
* increase the gain.