summaryrefslogtreecommitdiff
path: root/include/libcamera/controls.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcamera/controls.h')
-rw-r--r--include/libcamera/controls.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 39e24043..dfe69916 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -55,9 +55,13 @@ class ControlValue
{
public:
ControlValue();
- ControlValue(bool value);
- ControlValue(int32_t value);
- ControlValue(int64_t value);
+
+ template<typename T>
+ ControlValue(T value)
+ : type_(details::control_type<std::remove_cv_t<T>>::value)
+ {
+ *reinterpret_cast<T *>(&bool_) = value;
+ }
ControlType type() const { return type_; }
bool isNone() const { return type_ == ControlTypeNone; }