Rerun C++ SDK
|
Archetype: A depth image, i.e. More...
#include <rerun/archetypes/depth_image.hpp>
Public Types | |
using | IndicatorComponent = rerun::components::IndicatorComponent< IndicatorComponentName > |
Indicator component, used to identify the archetype when converting to a list of components. | |
Public Member Functions | |
template<typename TElement > | |
DepthImage (const TElement *pixels, WidthHeight resolution) | |
Constructs image from pointer + resolution, inferring the datatype from the pointer type. | |
template<typename TElement > | |
DepthImage (Collection< TElement > pixels, WidthHeight resolution) | |
Constructs image from pixel data + resolution with datatype inferred from the passed collection. | |
DepthImage (const void *bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype) | |
Constructs image from pixel data + resolution with explicit datatype. | |
DepthImage (Collection< uint8_t > bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype) | |
Constructs image from pixel data + resolution + datatype. | |
DepthImage (DepthImage &&other)=default | |
DepthImage | with_meter (rerun::components::DepthMeter _meter) && |
An optional floating point value that specifies how long a meter is in the native depth units. | |
DepthImage | with_colormap (rerun::components::Colormap _colormap) && |
Colormap to use for rendering the depth image. | |
DepthImage | with_depth_range (rerun::components::ValueRange _depth_range) && |
The expected range of depth values. | |
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. | |
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 shown as a 2D image. | |
Public Attributes | |
rerun::components::ImageBuffer | buffer |
The raw depth image data. | |
rerun::components::ImageFormat | format |
The format of the image. | |
std::optional< rerun::components::DepthMeter > | meter |
An optional floating point value that specifies how long a meter is in the native depth units. | |
std::optional< rerun::components::Colormap > | colormap |
Colormap to use for rendering the depth image. | |
std::optional< rerun::components::ValueRange > | depth_range |
The expected range of depth values. | |
std::optional< rerun::components::FillRatio > | point_fill_ratio |
Scale the radii of the points in the point cloud generated from this image. | |
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 shown as a 2D image. | |
Static Public Attributes | |
static constexpr const char | IndicatorComponentName [] |
Archetype: A depth image, i.e.
as captured by a depth camera.
Each pixel corresponds to a depth value in units specified by components::DepthMeter
.
Since the underlying rerun::datatypes::ImageBuffer
uses rerun::Collection
internally, data can be passed in without a copy from raw pointers or by reference from std::vector
/std::array
/c-arrays. If needed, this "borrow-behavior" can be extended by defining your own rerun::CollectionAdapter
.
|
inline |
Constructs image from pointer + resolution, inferring the datatype from the pointer type.
pixels | The raw image data. ⚠️ Does not take ownership of the data, the caller must ensure the data outlives the image. The number of elements is assumed to be W * H . |
resolution | The resolution of the image as {width, height}. |
|
inline |
Constructs image from pixel data + resolution with datatype inferred from the passed collection.
pixels | The raw image data. If the data does not outlive the image, use std::move or create the rerun::Collection explicitly ahead of time with rerun::Collection::take_ownership . The length of the data should be W * H . |
resolution | The resolution of the image as {width, height}. |
|
inline |
Constructs image from pixel data + resolution with explicit datatype.
Borrows data from a pointer (i.e. data must outlive the image!).
bytes | The raw image data. ⚠️ Does not take ownership of the data, the caller must ensure the data outlives the image. The byte size of the data is assumed to be W * H * datatype.size |
resolution | The resolution of the image as {width, height}. |
datatype | How the data should be interpreted. |
|
inline |
Constructs image from pixel data + resolution + datatype.
bytes | The raw image data as bytes. If the data does not outlive the image, use std::move or create the rerun::Collection explicitly ahead of time with rerun::Collection::take_ownership . The length of the data should be W * H . |
resolution | The resolution of the image as {width, height}. |
datatype | How the data should be interpreted. |
|
inline |
An optional floating point value that specifies how long a meter is in the native depth units.
For instance: with uint16, perhaps meter=1000 which would mean you have millimeter precision and a range of up to ~65 meters (2^16 / 1000).
Note that the only effect on 2D views is the physical depth values shown when hovering the image. In 3D views on the other hand, this affects where the points of the point cloud are placed.
|
inline |
Colormap to use for rendering the depth image.
If not set, the depth image will be rendered using the Turbo colormap.
|
inline |
The expected range of depth values.
This is typically the expected range of valid values. Everything outside of the range is clamped to the range for the purpose of colormpaping. Note that point clouds generated from this image will still display all points, regardless of this range.
If not specified, the range will be automatically estimated from the data. Note that the Viewer may try to guess a wider range than the minimum/maximum of values in the contents of the depth image. E.g. if all values are positive, some bigger than 1.0 and all smaller than 255.0, the Viewer will guess that the data likely came from an 8bit image, thus assuming a range of 0-255.
|
inline |
Scale the radii of the points in the point cloud generated from this image.
A fill ratio of 1.0 (the default) means that each point is as big as to touch the center of its neighbor if it is at the same depth, leaving no gaps. A fill ratio of 0.5 means that each point touches the edge of its neighbor if it has the same depth.
TODO(#6744): This applies only to 3D views!
|
inline |
An optional floating point value that specifies the 2D drawing order, used only if the depth image is shown as a 2D image.
Objects with higher values are drawn on top of those with lower values.
std::optional<rerun::components::DepthMeter> rerun::archetypes::DepthImage::meter |
An optional floating point value that specifies how long a meter is in the native depth units.
For instance: with uint16, perhaps meter=1000 which would mean you have millimeter precision and a range of up to ~65 meters (2^16 / 1000).
Note that the only effect on 2D views is the physical depth values shown when hovering the image. In 3D views on the other hand, this affects where the points of the point cloud are placed.
std::optional<rerun::components::Colormap> rerun::archetypes::DepthImage::colormap |
Colormap to use for rendering the depth image.
If not set, the depth image will be rendered using the Turbo colormap.
std::optional<rerun::components::ValueRange> rerun::archetypes::DepthImage::depth_range |
The expected range of depth values.
This is typically the expected range of valid values. Everything outside of the range is clamped to the range for the purpose of colormpaping. Note that point clouds generated from this image will still display all points, regardless of this range.
If not specified, the range will be automatically estimated from the data. Note that the Viewer may try to guess a wider range than the minimum/maximum of values in the contents of the depth image. E.g. if all values are positive, some bigger than 1.0 and all smaller than 255.0, the Viewer will guess that the data likely came from an 8bit image, thus assuming a range of 0-255.
std::optional<rerun::components::FillRatio> rerun::archetypes::DepthImage::point_fill_ratio |
Scale the radii of the points in the point cloud generated from this image.
A fill ratio of 1.0 (the default) means that each point is as big as to touch the center of its neighbor if it is at the same depth, leaving no gaps. A fill ratio of 0.5 means that each point touches the edge of its neighbor if it has the same depth.
TODO(#6744): This applies only to 3D views!
std::optional<rerun::components::DrawOrder> rerun::archetypes::DepthImage::draw_order |
An optional floating point value that specifies the 2D drawing order, used only if the depth image is shown as a 2D image.
Objects with higher values are drawn on top of those with lower values.
|
staticconstexpr |