@@ -621,22 +621,22 @@ void AgcAlgorithm::process(const agc::Session &session, agc::ActiveState &state,
double minAnalogueGain;
double maxAnalogueGain;
- if (frameContext.autoExposureEnabled) {
+ if (state.autoExposureEnabled) {
minExposureTime = session.minExposureTime;
- maxExposureTime = std::clamp(frameContext.maxFrameDuration,
+ maxExposureTime = std::clamp(state.maxFrameDuration,
session.minExposureTime,
session.maxExposureTime);
} else {
- minExposureTime = lineDuration * frameContext.exposure;
+ minExposureTime = lineDuration * state.manual.exposure;
maxExposureTime = minExposureTime;
}
- if (frameContext.autoGainEnabled) {
+ if (state.autoGainEnabled) {
minAnalogueGain = session.minAnalogueGain;
maxAnalogueGain = session.maxAnalogueGain;
} else {
- minAnalogueGain = frameContext.gain;
- maxAnalogueGain = frameContext.gain;
+ minAnalogueGain = state.manual.gain;
+ maxAnalogueGain = state.manual.gain;
}
std::visit(utils::overloaded{
@@ -681,10 +681,10 @@ void AgcAlgorithm::process(const agc::Session &session, agc::ActiveState &state,
.traits = params->traits,
.yHist = params->yHist,
.effectiveExposureValue = effectiveExposureValue,
- .constraintModeIndex = frameContext.constraintMode,
- .exposureModeIndex = frameContext.exposureMode,
+ .constraintModeIndex = state.constraintMode,
+ .exposureModeIndex = state.exposureMode,
.lux = params->lux,
- .exposureCompensation = pow(2.0, frameContext.exposureValue),
+ .exposureCompensation = pow(2.0, state.exposureValue),
});
/* Update the estimated exposure and gain. */
The `frameContext` is of an already completed frame, its exposure/gain/etc is of no real concern for future frames, so take the most recent settings from the active state. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/agc.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)