[libcamera-devel,v3,1/2] libcamera: camera: Add a mode sensitivity field
diff mbox series

Message ID 20220413095342.389460-2-kieran.bingham@ideasonboard.com
State Superseded
Headers show
Series
  • Application support for per-mode sensitivities
Related show

Commit Message

Kieran Bingham April 13, 2022, 9:53 a.m. UTC
From: David Plowman <david.plowman@raspberrypi.com>

The modeSensitivity field is a number that describes how sensitive the
selected sensor mode is compared to other readout modes of the same
sensor. For example, a binned mode might have twice the sensitivity of
the full resolution mode, meaning you would get double the signal
level for the same exposure and gains.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---

v3: [Kieran] : Spelling correction

 include/libcamera/camera.h |  2 ++
 src/libcamera/camera.cpp   | 16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h
index 5bb065847e04..826181cabc92 100644
--- a/include/libcamera/camera.h
+++ b/include/libcamera/camera.h
@@ -67,6 +67,8 @@  public:
 
 	Transform transform;
 
+	float modeSensitivity;
+
 protected:
 	CameraConfiguration();
 
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 713543fd1bdf..c2e64a0ba5e4 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -160,7 +160,7 @@  LOG_DECLARE_CATEGORY(Camera)
  * \brief Create an empty camera configuration
  */
 CameraConfiguration::CameraConfiguration()
-	: transform(Transform::Identity), config_({})
+	: transform(Transform::Identity), modeSensitivity(1.0), config_({})
 {
 }
 
@@ -412,6 +412,20 @@  CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF
  * may adjust this field at its discretion if the selection is not supported.
  */
 
+/**
+ * \var CameraConfiguration::modeSensitivity
+ * \brief The relative sensitivity of the chosen sensor mode
+ *
+ * Some sensors have readout modes with different sensitivities. For example,
+ * a binned camera mode might, with the same exposure and gains, produce
+ * twice the signal level of the full resolution readout. This would be
+ * signalled by the binned mode, when it is chosen, indicating a value here
+ * that is twice that of the full resolution mode.
+ *
+ * This value should only be read, and not set, by the user. It will be
+ * valid after the configure method has returned successfully.
+ */
+
 /**
  * \var CameraConfiguration::config_
  * \brief The vector of stream configurations