diff options
Diffstat (limited to 'src/ipa/rkisp1/algorithms/agc.cpp')
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.cpp | 11 |
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. |