6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../component_batch.hpp"
9#include "../components/colormap.hpp"
10#include "../components/depth_meter.hpp"
11#include "../components/draw_order.hpp"
12#include "../components/fill_ratio.hpp"
13#include "../components/image_buffer.hpp"
14#include "../components/image_format.hpp"
15#include "../components/value_range.hpp"
16#include "../image_utils.hpp"
17#include "../indicator_component.hpp"
18#include "../result.hpp"
91 std::optional<rerun::components::DepthMeter>
meter;
96 std::optional<rerun::components::Colormap>
colormap;
126 static constexpr const char IndicatorComponentName[] =
127 "rerun.components.DepthImageIndicator";
139 template <
typename TElement>
142 reinterpret_cast<const uint8_t*>(pixels), resolution, get_datatype(pixels)} {}
151 template <
typename TElement>
153 :
DepthImage{pixels.to_uint8(), resolution, get_datatype(pixels.data())} {}
179 :
buffer{bytes},
format{datatypes::ImageFormat{resolution, datatype}} {
182 ErrorCode::InvalidTensorDimension,
183 "DepthnImage buffer has the wrong size. Got " + std::to_string(
buffer.
size()) +
204 meter = std::move(_meter);
206 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
215 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
232 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
245 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
254 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
262 template <
typename T>
267 struct AsComponents<archetypes::DepthImage> {
269 static Result<std::vector<ComponentBatch>> serialize(
const archetypes::DepthImage& archetype
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
Status outcome object (success or error) returned for fallible operations.
Definition error.hpp:95
void handle() const
Handle this error based on the set log handler.
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:76
Colormap
Component: Colormap for mapping scalar values within a given range to a color.
Definition colormap.hpp:28
ChannelDatatype
Datatype: The innermost datatype of an image.
Definition channel_datatype.hpp:26
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Collection< TElement > borrow(const TElement *data, size_t num_instances=1)
Borrows binary data into a Collection from a pointer.
Definition collection.hpp:461
The width and height of an image.
Definition image_utils.hpp:13
Archetype: A depth image, i.e.
Definition depth_image.hpp:77
rerun::components::ImageFormat format
The format of the image.
Definition depth_image.hpp:82
std::optional< rerun::components::DrawOrder > draw_order
An optional floating point value that specifies the 2D drawing order, used only if the depth image is...
Definition depth_image.hpp:123
rerun::components::ImageBuffer buffer
The raw depth image data.
Definition depth_image.hpp:79
std::optional< rerun::components::Colormap > colormap
Colormap to use for rendering the depth image.
Definition depth_image.hpp:96
DepthImage with_colormap(rerun::components::Colormap _colormap) &&
Colormap to use for rendering the depth image.
Definition depth_image.hpp:212
DepthImage(Collection< uint8_t > bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype)
Constructs image from pixel data + resolution + datatype.
Definition depth_image.hpp:176
DepthImage with_point_fill_ratio(rerun::components::FillRatio _point_fill_ratio) &&
Scale the radii of the points in the point cloud generated from this image.
Definition depth_image.hpp:242
std::optional< rerun::components::FillRatio > point_fill_ratio
Scale the radii of the points in the point cloud generated from this image.
Definition depth_image.hpp:118
DepthImage(Collection< TElement > pixels, WidthHeight resolution)
Constructs image from pixel data + resolution with datatype inferred from the passed collection.
Definition depth_image.hpp:152
std::optional< rerun::components::ValueRange > depth_range
The expected range of depth values.
Definition depth_image.hpp:109
DepthImage with_meter(rerun::components::DepthMeter _meter) &&
An optional floating point value that specifies how long a meter is in the native depth units.
Definition depth_image.hpp:203
DepthImage(const void *bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype)
Constructs image from pixel data + resolution with explicit datatype.
Definition depth_image.hpp:162
std::optional< rerun::components::DepthMeter > meter
An optional floating point value that specifies how long a meter is in the native depth units.
Definition depth_image.hpp:91
DepthImage with_depth_range(rerun::components::ValueRange _depth_range) &&
The expected range of depth values.
Definition depth_image.hpp:229
DepthImage(const TElement *pixels, WidthHeight resolution)
Constructs image from pointer + resolution, inferring the datatype from the pointer type.
Definition depth_image.hpp:140
DepthImage with_draw_order(rerun::components::DrawOrder _draw_order) &&
An optional floating point value that specifies the 2D drawing order, used only if the depth image is...
Definition depth_image.hpp:251
Component: The world->depth map scaling factor.
Definition depth_meter.hpp:21
Component: Draw order of 2D elements.
Definition draw_order.hpp:19
Component: How much a primitive fills out the available space.
Definition fill_ratio.hpp:19
Component: A buffer that is known to store image data.
Definition image_buffer.hpp:18
size_t size() const
Number of bytes.
Definition image_buffer.hpp:23
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30
Component: Range of expected or valid values, specifying a lower and upper bound.
Definition value_range.hpp:15