[WIP,RFC,18/26] libcamera: stream: Add bayerOrder for raw formats
diff mbox series

Message ID 20261023-b4-raw-model-v1-18-eadb9948901b@ideasonboard.com
State New
Headers show
Series
  • Support the new common raw sensor model
Related show

Commit Message

Jai Luthra Oct. 23, 2026, 10:58 a.m. UTC
Now that we only use bayer-independent PixelFormats, communicate the
bayer order through an optional property in StreamConfiguration for raw
streams so applications can process them correctly.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 include/libcamera/stream.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index b5e8f0a9a22d..afc8f07f99f1 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -12,6 +12,7 @@ 
 #include <string>
 #include <vector>
 
+#include <libcamera/color_filter_array.h>
 #include <libcamera/color_space.h>
 #include <libcamera/framebuffer.h>
 #include <libcamera/geometry.h>
@@ -50,6 +51,22 @@  struct StreamConfiguration {
 
 	std::optional<ColorSpace> colorSpace;
 
+	/**
+	 * \brief The color filter array pattern of the raw data of the stream
+	 *
+	 * This field is only meaningful for streams with a raw pixel format.
+	 * Pipeline handlers populate it in
+	 * CameraConfiguration::generateConfiguration() with the sensor's
+	 * native color filter array pattern, and adjust it in
+	 * CameraConfiguration::validate() for any transform applied to the
+	 * sensor data.
+	 *
+	 * A ColorFilterArray::MONO value indicates monochrome raw data
+	 * without a color filter array. The field is left unset for non-raw
+	 * streams.
+	 */
+	std::optional<ColorFilterArray> bayerOrder;
+
 	Stream *stream() const { return stream_; }
 	void setStream(Stream *stream) { stream_ = stream; }
 	const StreamFormats &formats() const { return formats_; }