mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 16:45:07 +03:00
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
5eaf4fed19
commit
300f6e4434
2 changed files with 29 additions and 1 deletions
|
@ -22,6 +22,34 @@ enum ControlType {
|
|||
ControlTypeInteger64,
|
||||
};
|
||||
|
||||
namespace details {
|
||||
|
||||
template<typename T>
|
||||
struct control_type {
|
||||
};
|
||||
|
||||
template<>
|
||||
struct control_type<void> {
|
||||
static constexpr ControlType value = ControlTypeNone;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct control_type<bool> {
|
||||
static constexpr ControlType value = ControlTypeBool;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct control_type<int32_t> {
|
||||
static constexpr ControlType value = ControlTypeInteger32;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct control_type<int64_t> {
|
||||
static constexpr ControlType value = ControlTypeInteger64;
|
||||
};
|
||||
|
||||
} /* namespace details */
|
||||
|
||||
class ControlValue
|
||||
{
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue