From 5e5eadabd812481c8975315320046972e6b76a65 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Fri, 10 Dec 2021 14:44:23 +0000 Subject: libcamera: camera: Add validateColorSpaces to CameraConfiguration class This function forces raw streams to have the "raw" color space, and also optionally makes all non-raw output streams to share the same color space as some platforms may require this. When sharing color spaces we take the shared value to be the one from the largest of these streams. This choice is ultimately arbitrary, but can be appropriate if smaller output streams are used for image analysis rather than human consumption, when the precise colours may be less important. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Laurent Pinchart --- include/libcamera/camera.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index a7759ccb..5bb06584 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -69,6 +70,15 @@ public: protected: CameraConfiguration(); + enum class ColorSpaceFlag { + None, + StreamsShareColorSpace, + }; + + using ColorSpaceFlags = Flags; + + Status validateColorSpaces(ColorSpaceFlags flags = ColorSpaceFlag::None); + std::vector config_; }; -- cgit v1.2.1