From fbfdaa2d205b8898527609fb18d641429f0e0710 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 23 Aug 2022 17:16:34 +0300 Subject: libcamera: color_space: Add fromString() function Add a ColorSpace:fromString() function to parse a string into a color space. The string can either contain the name of a well-known color space, or four color space components separate by a '/' character. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- include/libcamera/color_space.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libcamera/color_space.h b/include/libcamera/color_space.h index 8030a264..f493f72d 100644 --- a/include/libcamera/color_space.h +++ b/include/libcamera/color_space.h @@ -59,6 +59,8 @@ public: std::string toString() const; static std::string toString(const std::optional &colorSpace); + + static std::optional fromString(const std::string &str); }; bool operator==(const ColorSpace &lhs, const ColorSpace &rhs); -- cgit v1.2.1