summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/lux.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-07-12 11:02:03 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-12 15:57:02 +0300
commitdf8cafaf8788eb27c25576ce94ca605f8a50527d (patch)
treebec65455099fd9e6d4bd899f040ebae43764c817 /src/ipa/raspberrypi/controller/rpi/lux.cpp
parentace5e21feba28cf43461375312f09c29230df370 (diff)
ipa: raspberrypi: Add a constructor struct DeviceStatus
The constructor sets all fields to 0. This replaces the memset(0) and default value initialisation usage in the agc and lux controllers respectively. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/lux.cpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/lux.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp
index f58d6939..6367b17d 100644
--- a/src/ipa/raspberrypi/controller/rpi/lux.cpp
+++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp
@@ -60,14 +60,7 @@ void Lux::Prepare(Metadata *image_metadata)
void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)
{
- // set some initial values to shut the compiler up
- DeviceStatus device_status = {
- .shutter_speed = 1.0ms,
- .analogue_gain = 1.0,
- .lens_position = 0.0,
- .aperture = 0.0,
- .flash_intensity = 0.0
- };
+ DeviceStatus device_status;
if (image_metadata->Get("device.status", device_status) == 0) {
double current_gain = device_status.analogue_gain;
double current_aperture = device_status.aperture;