6#include "../datatypes/vec2d.hpp"
7#include "../rerun_sdk_export.hpp"
8#include "../result.hpp"
23 Resolution(
float width,
float height) : resolution{width, height} {}
27 : resolution{static_cast<float>(width), static_cast<float>(height)} {}
37 resolution = resolution_;
41 Resolution(std::array<float, 2> xy_) : resolution(xy_) {}
43 Resolution& operator=(std::array<float, 2> xy_) {
60 struct Loggable<components::Resolution> {
61 static constexpr std::string_view ComponentType =
"rerun.components.Resolution";
64 static const std::shared_ptr<arrow::DataType>& arrow_datatype() {
65 return Loggable<rerun::datatypes::Vec2D>::arrow_datatype();
69 static Result<std::shared_ptr<arrow::Array>> to_arrow(
70 const components::Resolution* instances,
size_t num_instances
72 if (num_instances == 0) {
73 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
nullptr, 0);
74 }
else if (instances ==
nullptr) {
76 ErrorCode::UnexpectedNullArgument,
77 "Passed array instances is null when num_elements> 0."
80 return Loggable<rerun::datatypes::Vec2D>::to_arrow(
81 &instances->resolution,
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:99
All built-in components. See Types in the Rerun manual.
Definition rerun.hpp:79
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
Component: Pixel resolution width & height, e.g.
Definition resolution.hpp:18
Resolution(float width, float height)
Construct resolution from width and height floats.
Definition resolution.hpp:23
Resolution(int width, int height)
Construct resolution from width and height integers.
Definition resolution.hpp:26
Datatype: A vector in 2D space.
Definition vec2d.hpp:20