From 6377817f9f892e6a4601776de523505c14817527 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Tue, 20 Oct 2020 17:05:50 +0200 Subject: libcamera: controls: Construct from valid values Add a new constructor to the ControlInfo class that allows creating a class instance from the list of the control valid values with an optional default one. Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- include/libcamera/controls.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/libcamera') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index a556328c..3b7f3347 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -269,10 +270,13 @@ public: explicit ControlInfo(const ControlValue &min = 0, const ControlValue &max = 0, const ControlValue &def = 0); + explicit ControlInfo(Span values, + const ControlValue &def = {}); const ControlValue &min() const { return min_; } const ControlValue &max() const { return max_; } const ControlValue &def() const { return def_; } + const std::vector &values() const { return values_; } std::string toString() const; @@ -290,6 +294,7 @@ private: ControlValue min_; ControlValue max_; ControlValue def_; + std::vector values_; }; using ControlIdMap = std::unordered_map; -- cgit v1.2.1