libcamera: controls: Add array information to ControlId
Add to ControlId information on whether or not it is an array control, and the size of the control if it is an array control. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
505e49b76e
commit
ab67fdd210
@@ -389,11 +389,12 @@ void ControlValue::reserve(ControlType type, bool isArray, std::size_t numElemen
|
||||
* \param[in] id The control numerical ID
|
||||
* \param[in] name The control name
|
||||
* \param[in] type The control data type
|
||||
* \param[in] size The size of the array control, or 0 if scalar control
|
||||
* \param[in] enumStrMap The map from enum names to values (optional)
|
||||
*/
|
||||
ControlId::ControlId(unsigned int id, const std::string &name, ControlType type,
|
||||
const std::map<std::string, int32_t> &enumStrMap)
|
||||
: id_(id), name_(name), type_(type), enumStrMap_(enumStrMap)
|
||||
std::size_t size, const std::map<std::string, int32_t> &enumStrMap)
|
||||
: id_(id), name_(name), type_(type), size_(size), enumStrMap_(enumStrMap)
|
||||
{
|
||||
for (const auto &pair : enumStrMap_)
|
||||
reverseMap_[pair.second] = pair.first;
|
||||
@@ -417,6 +418,19 @@ ControlId::ControlId(unsigned int id, const std::string &name, ControlType type,
|
||||
* \return The control data type
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn bool ControlId::isArray() const
|
||||
* \brief Determine if the control is an array control
|
||||
* \return True if the control is an array control, false otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn std::size_t ControlId::size() const
|
||||
* \brief Retrieve the size of the control if it is an array control
|
||||
* \return The size of the array control, size_t::max for dynamic extent, or 0
|
||||
* for non-array
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn const std::map<int32_t, std::string> &ControlId::enumerators() const
|
||||
* \brief Retrieve the map of enum values to enum names
|
||||
|
||||
Reference in New Issue
Block a user