Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::EncodedDepthImage Struct Reference

Archetype: A depth image encoded with a codec (e.g. More...

#include <rerun/archetypes/encoded_depth_image.hpp>

Public Member Functions

 EncodedDepthImage (EncodedDepthImage &&other)=default
 
 EncodedDepthImage (const EncodedDepthImage &other)=default
 
EncodedDepthImageoperator= (const EncodedDepthImage &other)=default
 
EncodedDepthImageoperator= (EncodedDepthImage &&other)=default
 
 EncodedDepthImage (rerun::components::Blob _blob)
 
EncodedDepthImage with_blob (const rerun::components::Blob &_blob) &&
 The encoded depth payload.
 
EncodedDepthImage with_many_blob (const Collection< rerun::components::Blob > &_blob) &&
 This method makes it possible to pack multiple blob in a single component batch.
 
EncodedDepthImage with_media_type (const rerun::components::MediaType &_media_type) &&
 Media type of the blob, e.g.:
 
EncodedDepthImage with_many_media_type (const Collection< rerun::components::MediaType > &_media_type) &&
 This method makes it possible to pack multiple media_type in a single component batch.
 
EncodedDepthImage with_meter (const rerun::components::DepthMeter &_meter) &&
 Conversion from native units to meters (e.g.
 
EncodedDepthImage with_many_meter (const Collection< rerun::components::DepthMeter > &_meter) &&
 This method makes it possible to pack multiple meter in a single component batch.
 
EncodedDepthImage with_colormap (const rerun::components::Colormap &_colormap) &&
 Optional colormap for visualization of decoded depth.
 
EncodedDepthImage with_many_colormap (const Collection< rerun::components::Colormap > &_colormap) &&
 This method makes it possible to pack multiple colormap in a single component batch.
 
EncodedDepthImage with_depth_range (const rerun::components::ValueRange &_depth_range) &&
 Optional visualization range for depth values.
 
EncodedDepthImage with_many_depth_range (const Collection< rerun::components::ValueRange > &_depth_range) &&
 This method makes it possible to pack multiple depth_range in a single component batch.
 
EncodedDepthImage with_point_fill_ratio (const rerun::components::FillRatio &_point_fill_ratio) &&
 Optional point fill ratio for point-cloud projection.
 
EncodedDepthImage with_many_point_fill_ratio (const Collection< rerun::components::FillRatio > &_point_fill_ratio) &&
 This method makes it possible to pack multiple point_fill_ratio in a single component batch.
 
EncodedDepthImage with_draw_order (const rerun::components::DrawOrder &_draw_order) &&
 Optional 2D draw order.
 
EncodedDepthImage with_many_draw_order (const Collection< rerun::components::DrawOrder > &_draw_order) &&
 This method makes it possible to pack multiple draw_order in a single component batch.
 
Collection< ComponentColumncolumns (const Collection< uint32_t > &lengths_)
 Partitions the component data into multiple sub-batches.
 
Collection< ComponentColumncolumns ()
 Partitions the component data into unit-length sub-batches.
 

Static Public Member Functions

static EncodedDepthImage update_fields ()
 Update only some specific fields of a EncodedDepthImage.
 
static EncodedDepthImage clear_fields ()
 Clear all the fields of a EncodedDepthImage.
 

Public Attributes

std::optional< ComponentBatchblob
 The encoded depth payload.
 
std::optional< ComponentBatchmedia_type
 Media type of the blob, e.g.:
 
std::optional< ComponentBatchmeter
 Conversion from native units to meters (e.g.
 
std::optional< ComponentBatchcolormap
 Optional colormap for visualization of decoded depth.
 
std::optional< ComponentBatchdepth_range
 Optional visualization range for depth values.
 
std::optional< ComponentBatchpoint_fill_ratio
 Optional point fill ratio for point-cloud projection.
 
std::optional< ComponentBatchdraw_order
 Optional 2D draw order.
 

Static Public Attributes

static constexpr const char ArchetypeName [] = "rerun.archetypes.EncodedDepthImage"
 The name of the archetype as used in ComponentDescriptors.
 
static constexpr auto Descriptor_blob
 ComponentDescriptor for the blob field.
 
static constexpr auto Descriptor_media_type
 ComponentDescriptor for the media_type field.
 
static constexpr auto Descriptor_meter
 ComponentDescriptor for the meter field.
 
static constexpr auto Descriptor_colormap
 ComponentDescriptor for the colormap field.
 
static constexpr auto Descriptor_depth_range
 ComponentDescriptor for the depth_range field.
 
static constexpr auto Descriptor_point_fill_ratio
 ComponentDescriptor for the point_fill_ratio field.
 
static constexpr auto Descriptor_draw_order
 ComponentDescriptor for the draw_order field.
 

Detailed Description

Archetype: A depth image encoded with a codec (e.g.

RVL or PNG).

Rerun also supports uncompressed depth images with the archetypes.DepthImage.

Example

Encoded depth image

image

#include <rerun.hpp>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <vector>
namespace fs = std::filesystem;
int main(int argc, char* argv[]) {
if (argc <2) {
std::cerr <<"Usage: " <<argv[0] <<" <path_to_depth_image.[png|rvl]>" <<std::endl;
return 1;
}
const auto rec = rerun::RecordingStream("rerun_example_encoded_depth_image");
rec.spawn().exit_on_failure();
const auto depth_path = fs::path(argv[1]);
std::ifstream file(depth_path, std::ios::binary);
if (!file) {
std::cerr <<"Failed to open encoded depth image: " <<depth_path <<std::endl;
return 1;
}
std::vector<uint8_t> bytes{
std::istreambuf_iterator<char>(file),
std::istreambuf_iterator<char>()};
// Determine media type based on file extension
if (depth_path.extension() == ".png") {
} else {
}
rec.log(
"depth/encoded",
))
.with_meter(0.001f)
);
}
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:73
Archetype: A depth image encoded with a codec (e.g.
Definition encoded_depth_image.hpp:84
EncodedDepthImage with_blob(const rerun::components::Blob &_blob) &&
The encoded depth payload.
Definition encoded_depth_image.hpp:179
std::optional< ComponentBatch > media_type
Media type of the blob, e.g.:
Definition encoded_depth_image.hpp:96
EncodedDepthImage with_meter(const rerun::components::DepthMeter &_meter) &&
Conversion from native units to meters (e.g.
Definition encoded_depth_image.hpp:218
EncodedDepthImage with_media_type(const rerun::components::MediaType &_media_type) &&
Media type of the blob, e.g.:
Definition encoded_depth_image.hpp:197
Component: A binary blob of data.
Definition blob.hpp:16
Component: A standardized media type (RFC2046, formerly known as MIME types), encoded as a string.
Definition media_type.hpp:20
static MediaType rvl()
RVL compressed depth: application/rvl.
Definition media_type.hpp:96
static MediaType png()
PNG image: image/png.
Definition media_type.hpp:53

This type is unstable and may change significantly in a way that the data won't be backwards compatible.

Member Function Documentation

◆ with_blob()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_blob ( const rerun::components::Blob _blob) &&
inline

The encoded depth payload.

Supported are:

◆ with_many_blob()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_blob ( const Collection< rerun::components::Blob > &  _blob) &&
inline

This method makes it possible to pack multiple blob in a single component batch.

This only makes sense when used in conjunction with columns. with_blob should be used when logging a single row's worth of data.

◆ with_media_type()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_media_type ( const rerun::components::MediaType _media_type) &&
inline

Media type of the blob, e.g.:

  • application/rvl (RVL-compressed 16-bit)
  • image/png

◆ with_many_media_type()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_media_type ( const Collection< rerun::components::MediaType > &  _media_type) &&
inline

This method makes it possible to pack multiple media_type in a single component batch.

This only makes sense when used in conjunction with columns. with_media_type should be used when logging a single row's worth of data.

◆ with_meter()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_meter ( const rerun::components::DepthMeter _meter) &&
inline

Conversion from native units to meters (e.g.

0.001 for millimeters).

If omitted, the Viewer defaults to 1.0 for floating-point depth formats and 1000.0 for integer formats (millimeters).

◆ with_many_meter()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_meter ( const Collection< rerun::components::DepthMeter > &  _meter) &&
inline

This method makes it possible to pack multiple meter in a single component batch.

This only makes sense when used in conjunction with columns. with_meter should be used when logging a single row's worth of data.

◆ with_many_colormap()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_colormap ( const Collection< rerun::components::Colormap > &  _colormap) &&
inline

This method makes it possible to pack multiple colormap in a single component batch.

This only makes sense when used in conjunction with columns. with_colormap should be used when logging a single row's worth of data.

◆ with_many_depth_range()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_depth_range ( const Collection< rerun::components::ValueRange > &  _depth_range) &&
inline

This method makes it possible to pack multiple depth_range in a single component batch.

This only makes sense when used in conjunction with columns. with_depth_range should be used when logging a single row's worth of data.

◆ with_many_point_fill_ratio()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_point_fill_ratio ( const Collection< rerun::components::FillRatio > &  _point_fill_ratio) &&
inline

This method makes it possible to pack multiple point_fill_ratio in a single component batch.

This only makes sense when used in conjunction with columns. with_point_fill_ratio should be used when logging a single row's worth of data.

◆ with_many_draw_order()

EncodedDepthImage rerun::archetypes::EncodedDepthImage::with_many_draw_order ( const Collection< rerun::components::DrawOrder > &  _draw_order) &&
inline

This method makes it possible to pack multiple draw_order in a single component batch.

This only makes sense when used in conjunction with columns. with_draw_order should be used when logging a single row's worth of data.

◆ columns() [1/2]

Collection< ComponentColumn > rerun::archetypes::EncodedDepthImage::columns ( const Collection< uint32_t > &  lengths_)

Partitions the component data into multiple sub-batches.

Specifically, this transforms the existing ComponentBatch data into ComponentColumns instead, via ComponentBatch::partitioned.

This makes it possible to use RecordingStream::send_columns to send columnar data directly into Rerun.

The specified lengths must sum to the total length of the component batch.

◆ columns() [2/2]

Collection< ComponentColumn > rerun::archetypes::EncodedDepthImage::columns ( )

Partitions the component data into unit-length sub-batches.

This is semantically similar to calling columns with std::vector<uint32_t>(n, 1), where n is automatically guessed.

Member Data Documentation

◆ blob

std::optional<ComponentBatch> rerun::archetypes::EncodedDepthImage::blob

The encoded depth payload.

Supported are:

◆ media_type

std::optional<ComponentBatch> rerun::archetypes::EncodedDepthImage::media_type

Media type of the blob, e.g.:

  • application/rvl (RVL-compressed 16-bit)
  • image/png

◆ meter

std::optional<ComponentBatch> rerun::archetypes::EncodedDepthImage::meter

Conversion from native units to meters (e.g.

0.001 for millimeters).

If omitted, the Viewer defaults to 1.0 for floating-point depth formats and 1000.0 for integer formats (millimeters).

◆ Descriptor_blob

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_blob
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:blob",
Loggable<rerun::components::Blob>::ComponentType
)
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition encoded_depth_image.hpp:117

ComponentDescriptor for the blob field.

◆ Descriptor_media_type

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_media_type
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:media_type",
Loggable<rerun::components::MediaType>::ComponentType
)

ComponentDescriptor for the media_type field.

◆ Descriptor_meter

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_meter
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:meter",
Loggable<rerun::components::DepthMeter>::ComponentType
)

ComponentDescriptor for the meter field.

◆ Descriptor_colormap

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_colormap
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:colormap",
Loggable<rerun::components::Colormap>::ComponentType
)

ComponentDescriptor for the colormap field.

◆ Descriptor_depth_range

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_depth_range
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:depth_range",
Loggable<rerun::components::ValueRange>::ComponentType
)

ComponentDescriptor for the depth_range field.

◆ Descriptor_point_fill_ratio

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_point_fill_ratio
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:point_fill_ratio",
Loggable<rerun::components::FillRatio>::ComponentType
)

ComponentDescriptor for the point_fill_ratio field.

◆ Descriptor_draw_order

constexpr auto rerun::archetypes::EncodedDepthImage::Descriptor_draw_order
staticconstexpr
Initial value:
= ComponentDescriptor(
ArchetypeName, "EncodedDepthImage:draw_order",
Loggable<rerun::components::DrawOrder>::ComponentType
)

ComponentDescriptor for the draw_order field.


The documentation for this struct was generated from the following file: