summaryrefslogtreecommitdiff
path: root/src/libcamera/controls.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-02-29 03:39:46 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-04-28 20:44:47 +0300
commitd4680c8ca2b5cac4f723ec869b297099000b1100 (patch)
tree3ba027f269d3701afe251e381e5062d1e8376701 /src/libcamera/controls.cpp
parent8a9be175a76d34ed9fcf4c4f0233ef73736b8eab (diff)
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>
Diffstat (limited to 'src/libcamera/controls.cpp')
-rw-r--r--src/libcamera/controls.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index 540cc026..08df7f29 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -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;