summaryrefslogtreecommitdiff
path: root/src/ipa/rpi/controller/rpi/agc_channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/rpi/controller/rpi/agc_channel.cpp')
-rw-r--r--src/ipa/rpi/controller/rpi/agc_channel.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp
index 3957dbc3..e856289a 100644
--- a/src/ipa/rpi/controller/rpi/agc_channel.cpp
+++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp
@@ -473,7 +473,8 @@ void AgcChannel::prepare(Metadata *imageMetadata)
Duration actualExposure = deviceStatus.shutterSpeed *
deviceStatus.analogueGain;
if (actualExposure) {
- double digitalGain = totalExposureValue / actualExposure;
+ double digitalGain = std::chrono::duration(totalExposureValue) /
+ std::chrono::duration(actualExposure);
LOG(RPiAgc, Debug) << "Want total exposure " << totalExposureValue;
/*
* Never ask for a gain < 1.0, and also impose
@@ -925,7 +926,8 @@ void AgcChannel::divideUpExposure()
}
if (status_.fixedAnalogueGain == 0.0) {
if (exposureMode_->gain[stage] * shutterTime >= exposureValue) {
- analogueGain = exposureValue / shutterTime;
+ analogueGain = std::chrono::duration(exposureValue) /
+ std::chrono::duration(shutterTime);
break;
}
analogueGain = exposureMode_->gain[stage];
@@ -941,10 +943,11 @@ void AgcChannel::divideUpExposure()
*/
if (!status_.fixedShutter && !status_.fixedAnalogueGain &&
status_.flickerPeriod) {
- int flickerPeriods = shutterTime / status_.flickerPeriod;
+ int flickerPeriods = std::chrono::duration(shutterTime) /
+ std::chrono::duration(status_.flickerPeriod);
if (flickerPeriods) {
Duration newShutterTime = flickerPeriods * status_.flickerPeriod;
- analogueGain *= shutterTime / newShutterTime;
+ analogueGain *= shutterTime / std::chrono::duration(newShutterTime);
/*
* We should still not allow the ag to go over the
* largest value in the exposure mode. Note that this