libcamera: controls: Add support for float controls

Add support for float values in Control<> and ControlValue classes.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Jacopo Mondi 2020-01-09 14:31:00 +01:00 committed by Laurent Pinchart
parent abd96336ed
commit 8b12a161e0
3 changed files with 29 additions and 3 deletions

View file

@ -24,6 +24,7 @@ enum ControlType {
ControlTypeBool,
ControlTypeInteger32,
ControlTypeInteger64,
ControlTypeFloat,
};
namespace details {
@ -52,6 +53,11 @@ struct control_type<int64_t> {
static constexpr ControlType value = ControlTypeInteger64;
};
template<>
struct control_type<float> {
static constexpr ControlType value = ControlTypeFloat;
};
template<typename T, std::size_t N>
struct control_type<Span<T, N>> : public control_type<std::remove_cv_t<T>> {
};