libipa: exposure_mode_helper: Remove double calculation of lastStageGain
lastStageGain gets recalculated unconditionally even though it is the stageGain of the last stage. Refactor for increased simplicity and efficiency. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
f077c58e08
commit
0efa130b25
@@ -198,10 +198,10 @@ ExposureModeHelper::splitExposure(utils::Duration exposure) const
|
||||
|
||||
utils::Duration exposureTime;
|
||||
double stageGain = 1.0;
|
||||
double lastStageGain = 1.0;
|
||||
double gain;
|
||||
|
||||
for (unsigned int stage = 0; stage < gains_.size(); stage++) {
|
||||
double lastStageGain = stage == 0 ? 1.0 : clampGain(gains_[stage - 1]);
|
||||
utils::Duration stageExposureTime = clampExposureTime(exposureTimes_[stage]);
|
||||
stageGain = clampGain(gains_[stage]);
|
||||
|
||||
@@ -228,6 +228,8 @@ ExposureModeHelper::splitExposure(utils::Duration exposure) const
|
||||
|
||||
return { exposureTime, gain, exposure / (exposureTime * gain) };
|
||||
}
|
||||
|
||||
lastStageGain = stageGain;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user