From 300f6e44345f5cb7bfe9aece6c6c5b5c0894487b Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 14 Feb 2020 17:02:18 +0200 Subject: libcamera: controls: Add templates to convert a type T to a ControlType These will be used to implement ControlValue::get() and set() as template functions. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/controls.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 3b6b231c..429f01b0 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -22,6 +22,34 @@ enum ControlType { ControlTypeInteger64, }; +namespace details { + +template +struct control_type { +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeNone; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeBool; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger32; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger64; +}; + +} /* namespace details */ + class ControlValue { public: -- cgit v1.2.1