[v4,4/4] libcamera: ipa: core: Add IPACameraSensorInfo::pixelArrayArea property
diff mbox series

Message ID 20260918091835.2332386-5-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • Clarify rectangle behavior
Related show

Commit Message

Stefan Klug Sept. 18, 2026, 9:10 a.m. UTC
Add a IPACameraSensorInfo::pixelArrayArea property to communicate the
full area of the pixel array to the IPA. This property is not used today
but will be useful to do sanity checks on coordinates handled in the
algorithms.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

---

Changes in v4:
- switch from pixelArraySize to pixelArrayArea

Changes in v3:
- Collected tag
---
 include/libcamera/ipa/core.mojom              | 8 ++++++++
 src/libcamera/sensor/camera_sensor_legacy.cpp | 1 +
 src/libcamera/sensor/camera_sensor_raw.cpp    | 1 +
 3 files changed, 10 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom
index 32ff25bbfc2b..5ff3d79c4366 100644
--- a/include/libcamera/ipa/core.mojom
+++ b/include/libcamera/ipa/core.mojom
@@ -152,6 +152,13 @@  module libcamera;
  * RGB for sensors that don't have a CFA.
  */
 
+/**
+ * \var IPACameraSensorInfo::pixelArrayArea
+ * \brief The area of the physical pixel array of the sensor in pixels
+ *
+ * The top left corner of this rectangle is always at (0,0).
+ */
+
 /**
  * \var IPACameraSensorInfo::activeArea
  * \brief The active pixel area of the sensor, relative to the physical pixel
@@ -250,6 +257,7 @@  struct IPACameraSensorInfo {
 	uint32 bitsPerPixel;
 	uint32 cfaPattern;
 
+	Rectangle pixelArrayArea;
 	Rectangle activeArea;
 	Rectangle analogCrop;
 	Size outputSize;
diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp
index 62f346aa06df..bbe3f2e8fc7d 100644
--- a/src/libcamera/sensor/camera_sensor_legacy.cpp
+++ b/src/libcamera/sensor/camera_sensor_legacy.cpp
@@ -886,6 +886,7 @@  int CameraSensorLegacy::sensorInfo(IPACameraSensorInfo *info) const
 		return -EINVAL;
 
 	info->model = model();
+	info->pixelArrayArea = pixelArrayArea_;
 
 	/*
 	 * The active area is a static property, while the crop rectangle needs
diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp
index 940e7514ae93..389b9ddfe19f 100644
--- a/src/libcamera/sensor/camera_sensor_raw.cpp
+++ b/src/libcamera/sensor/camera_sensor_raw.cpp
@@ -1007,6 +1007,7 @@  int CameraSensorRaw::setEmbeddedDataEnabled(bool enable)
 int CameraSensorRaw::sensorInfo(IPACameraSensorInfo *info) const
 {
 	info->model = model();
+	info->pixelArrayArea = pixelArrayArea_;
 
 	/*
 	 * The active area is a static property, while the crop rectangle needs