summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/agc.h
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-02-28 11:23:26 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-03-28 14:12:18 +0100
commit6e889113380111dfa10438e4a5a6b25d73e84c18 (patch)
tree866542923c5a71a712718afec2a11821872470fe /src/ipa/raspberrypi/controller/rpi/agc.h
parentf0b9eaeaa82d00a939a91115a7e686151068a9e7 (diff)
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 <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/agc.h')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/agc.h5
1 files changed, 3 insertions, 2 deletions
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_;