summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/device_status.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipa/raspberrypi/controller/device_status.h')
-rw-r--r--src/ipa/raspberrypi/controller/device_status.h39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h
index aa08608b..c4a5d9c8 100644
--- a/src/ipa/raspberrypi/controller/device_status.h
+++ b/src/ipa/raspberrypi/controller/device_status.h
@@ -1,30 +1,39 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
- * Copyright (C) 2019, Raspberry Pi (Trading) Limited
+ * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited
*
* device_status.h - device (image sensor) status
*/
#pragma once
-// Definition of "device metadata" which stores things like shutter time and
-// analogue gain that downstream control algorithms will want to know.
+#include <iostream>
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include <libcamera/base/utils.h>
+
+/*
+ * Definition of "device metadata" which stores things like shutter time and
+ * analogue gain that downstream control algorithms will want to know.
+ */
struct DeviceStatus {
- // time shutter is open, in microseconds
- double shutter_speed;
+ DeviceStatus()
+ : shutter_speed(std::chrono::seconds(0)), frame_length(0),
+ analogue_gain(0.0), lens_position(0.0), aperture(0.0),
+ flash_intensity(0.0)
+ {
+ }
+
+ friend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d);
+
+ /* time shutter is open */
+ libcamera::utils::Duration shutter_speed;
+ /* frame length given in number of lines */
+ uint32_t frame_length;
double analogue_gain;
- // 1.0/distance-in-metres, or 0 if unknown
+ /* 1.0/distance-in-metres, or 0 if unknown */
double lens_position;
- // 1/f so that brightness quadruples when this doubles, or 0 if unknown
+ /* 1/f so that brightness quadruples when this doubles, or 0 if unknown */
double aperture;
- // proportional to brightness with 0 = no flash, 1 = maximum flash
+ /* proportional to brightness with 0 = no flash, 1 = maximum flash */
double flash_intensity;
};
-
-#ifdef __cplusplus
-}
-#endif