@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include <libcamera/color_space.h>
#include <libcamera/framebuffer.h>
#include <libcamera/geometry.h>
#include <libcamera/pixel_format.h>
@@ -47,6 +48,8 @@ struct StreamConfiguration {
unsigned int bufferCount;
+ std::optional<ColorSpace> colorSpace;
+
Stream *stream() const { return stream_; }
void setStream(Stream *stream) { stream_ = stream; }
const StreamFormats &formats() const { return formats_; }
@@ -329,6 +329,26 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)
* \brief Requested number of buffers to allocate for the stream
*/
+/**
+ * \var StreamConfiguration::colorSpace
+ * \brief The ColorSpace for this stream
+ *
+ * This field allows a ColorSpace to be selected for this Stream.
+ *
+ * The field is optional and an application can choose to leave it unset.
+ * Platforms that support the use of color spaces may provide default
+ * values through the generateConfiguration() method. An application can
+ * override these when necessary.
+ *
+ * If a specific ColorSpace is requested but the Camera cannot deliver it,
+ * then the StreamConfiguration will be adjusted to a value that can be
+ * delivered. In this case the validate() method will indicate via its
+ * return value that the CameraConfiguration has been adjusted.
+ *
+ * Note that platforms will typically have different constraints on what
+ * color spaces can be supported and in what combinations.
+ */
+
/**
* \fn StreamConfiguration::stream()
* \brief Retrieve the stream associated with the configuration