libcamera: controls: Add rectangle and size control types
Add two control types to store rectangles and sizes. These will be useful for the properties related to the pixel array. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -58,6 +58,8 @@ static constexpr size_t ControlValueSize[] = {
|
||||
[ControlTypeInteger64] = sizeof(int64_t),
|
||||
[ControlTypeFloat] = sizeof(float),
|
||||
[ControlTypeString] = sizeof(char),
|
||||
[ControlTypeRectangle] = sizeof(Rectangle),
|
||||
[ControlTypeSize] = sizeof(Size),
|
||||
};
|
||||
|
||||
} /* namespace */
|
||||
@@ -242,6 +244,16 @@ std::string ControlValue::toString() const
|
||||
str += std::to_string(*value);
|
||||
break;
|
||||
}
|
||||
case ControlTypeRectangle: {
|
||||
const Rectangle *value = reinterpret_cast<const Rectangle *>(data);
|
||||
str += value->toString();
|
||||
break;
|
||||
}
|
||||
case ControlTypeSize: {
|
||||
const Size *value = reinterpret_cast<const Size *>(data);
|
||||
str += value->toString();
|
||||
break;
|
||||
}
|
||||
case ControlTypeNone:
|
||||
case ControlTypeString:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user