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.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp
index 1e7eae06..3efb6482 100644
--- a/src/ipa/rpi/controller/rpi/agc_channel.cpp
+++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp
@@ -253,6 +253,8 @@ int AgcConfig::read(const libcamera::YamlObject &params)
stableRegion = params["stable_region"].get<double>(0.02);
+ desaturate = params["desaturate"].get<int>(1);
+
return 0;
}
@@ -860,8 +862,10 @@ bool AgcChannel::applyDigitalGain(double gain, double targetY, bool channelBound
* quickly (and we then approach the correct value more quickly from
* below).
*/
- bool desaturate = !channelBound &&
- targetY > config_.fastReduceThreshold && gain < sqrt(targetY);
+ bool desaturate = false;
+ if (config_.desaturate)
+ desaturate = !channelBound &&
+ targetY > config_.fastReduceThreshold && gain < sqrt(targetY);
if (desaturate)
dg /= config_.fastReduceThreshold;
LOG(RPiAgc, Debug) << "Digital gain " << dg << " desaturate? " << desaturate;