From 6e889113380111dfa10438e4a5a6b25d73e84c18 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 28 Feb 2023 11:23:26 +0000 Subject: ipa: raspberrypi: Ensure shutter speed and gain are clipped in the AGC Make a copy of the CameraMode structure on a switch mode call. This replaces the existing lastSensitivity_ field. Limit the AGC gain calculations to the minimum value given by the CameraMode structure. The maximum value remains unclipped as any gain over the sensor maximum will be made up by digital gain. Rename clipShutter to limitShutter for consistency, and have the latter limit the shutter speed to both upper and lower bounds. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- src/ipa/raspberrypi/controller/rpi/agc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ipa/raspberrypi/controller/rpi/agc.h') diff --git a/src/ipa/raspberrypi/controller/rpi/agc.h b/src/ipa/raspberrypi/controller/rpi/agc.h index f04896ca..4fa9b8de 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.h +++ b/src/ipa/raspberrypi/controller/rpi/agc.h @@ -103,10 +103,12 @@ private: void filterExposure(bool desaturate); void divideUpExposure(); void writeAndFinish(Metadata *imageMetadata, bool desaturate); - libcamera::utils::Duration clipShutter(libcamera::utils::Duration shutter); + libcamera::utils::Duration limitShutter(libcamera::utils::Duration shutter); + double limitGain(double gain) const; AgcMeteringMode *meteringMode_; AgcExposureMode *exposureMode_; AgcConstraintMode *constraintMode_; + CameraMode mode_; uint64_t frameCount_; AwbStatus awb_; struct ExposureValues { @@ -124,7 +126,6 @@ private: int lockCount_; DeviceStatus lastDeviceStatus_; libcamera::utils::Duration lastTargetExposure_; - double lastSensitivity_; /* sensitivity of the previous camera mode */ /* Below here the "settings" that applications can change. */ std::string meteringModeName_; std::string exposureModeName_; -- cgit v1.2.1