summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-23 17:16:34 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-26 01:04:27 +0300
commitfbfdaa2d205b8898527609fb18d641429f0e0710 (patch)
treed5089409646e8118e2e0d9e1ea1e96fa015fab02 /include
parent994358dab6eef2b8c9a5c09b3ced99d000623701 (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/color_space.h2
1 files changed, 2 insertions, 0 deletions
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> &colorSpace);
+
+ static std::optional<ColorSpace> fromString(const std::string &str);
};
bool operator==(const ColorSpace &lhs, const ColorSpace &rhs);