diff options
Diffstat (limited to 'src/ipa/rkisp1/algorithms')
-rw-r--r-- | src/ipa/rkisp1/algorithms/agc.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index e5aeb342..42f158fc 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -76,7 +76,7 @@ int Agc::configure(IPAContext &context, const IPACameraSensorInfo &configInfo) /* Configure the default exposure and gain. */ context.activeState.agc.automatic.gain = context.configuration.sensor.minAnalogueGain; context.activeState.agc.automatic.exposure = - 10ms / context.configuration.sensor.lineDuration; + 10ms / std::chrono::duration(context.configuration.sensor.lineDuration); 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; @@ -135,7 +135,7 @@ void Agc::queueRequest(IPAContext &context, const auto &exposure = controls.get(controls::ExposureTime); if (exposure && !agc.autoEnabled) { agc.manual.exposure = *exposure * 1.0us - / context.configuration.sensor.lineDuration; + / std::chrono::duration(context.configuration.sensor.lineDuration); LOG(RkISP1Agc, Debug) << "Set exposure to " << agc.manual.exposure; @@ -303,16 +303,17 @@ void Agc::computeExposure(IPAContext &context, IPAFrameContext &frameContext, * Push the shutter time up to the maximum first, and only then * increase the gain. */ - utils::Duration shutterTime = std::clamp<utils::Duration>(exposureValue / minAnalogueGain, + utils::Duration shutterTime = std::clamp<utils::Duration>(std::chrono::duration(exposureValue) / minAnalogueGain, minShutterSpeed, maxShutterSpeed); - double stepGain = std::clamp(exposureValue / shutterTime, + double stepGain = std::clamp(exposureValue / std::chrono::duration(shutterTime), minAnalogueGain, maxAnalogueGain); LOG(RkISP1Agc, Debug) << "Divided up shutter and gain are " << shutterTime << " and " << stepGain; /* Update the estimated exposure and gain. */ - activeState.agc.automatic.exposure = shutterTime / configuration.sensor.lineDuration; + activeState.agc.automatic.exposure = std::chrono::duration(shutterTime) / + std::chrono::duration(configuration.sensor.lineDuration); activeState.agc.automatic.gain = stepGain; } |