Rerun C++ SDK
|
Archetype: An image made up of integer components::ClassId
s.
More...
#include <rerun/archetypes/segmentation_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 > | |
SegmentationImage (const TElement *pixels, WidthHeight resolution) | |
Constructs image from pointer + resolution, inferring the datatype from the pointer type. | |
template<typename TElement > | |
SegmentationImage (Collection< TElement > pixels, WidthHeight resolution) | |
Constructs image from pixel data + resolution with datatype inferred from the passed collection. | |
SegmentationImage (const void *bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype) | |
Constructs image from pixel data + resolution with explicit datatype. | |
SegmentationImage (Collection< uint8_t > bytes, WidthHeight resolution, datatypes::ChannelDatatype datatype) | |
Constructs image from pixel data + resolution + datatype. | |
SegmentationImage (SegmentationImage &&other)=default | |
SegmentationImage (const SegmentationImage &other)=default | |
SegmentationImage & | operator= (const SegmentationImage &other)=default |
SegmentationImage & | operator= (SegmentationImage &&other)=default |
SegmentationImage | with_buffer (const rerun::components::ImageBuffer &_buffer) && |
The raw image data. | |
SegmentationImage | with_many_buffer (const Collection< rerun::components::ImageBuffer > &_buffer) && |
This method makes it possible to pack multiple buffer in a single component batch. | |
SegmentationImage | with_format (const rerun::components::ImageFormat &_format) && |
The format of the image. | |
SegmentationImage | with_many_format (const Collection< rerun::components::ImageFormat > &_format) && |
This method makes it possible to pack multiple format in a single component batch. | |
SegmentationImage | with_opacity (const rerun::components::Opacity &_opacity) && |
Opacity of the image, useful for layering the segmentation image on top of another image. | |
SegmentationImage | with_many_opacity (const Collection< rerun::components::Opacity > &_opacity) && |
This method makes it possible to pack multiple opacity in a single component batch. | |
SegmentationImage | with_draw_order (const rerun::components::DrawOrder &_draw_order) && |
An optional floating point value that specifies the 2D drawing order. | |
SegmentationImage | 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< ComponentColumn > | columns (const Collection< uint32_t > &lengths_) |
Partitions the component data into multiple sub-batches. | |
Collection< ComponentColumn > | columns () |
Partitions the component data into unit-length sub-batches. | |
Static Public Member Functions | |
static SegmentationImage | update_fields () |
Update only some specific fields of a SegmentationImage . | |
static SegmentationImage | clear_fields () |
Clear all the fields of a SegmentationImage . | |
Public Attributes | |
std::optional< ComponentBatch > | buffer |
The raw image data. | |
std::optional< ComponentBatch > | format |
The format of the image. | |
std::optional< ComponentBatch > | opacity |
Opacity of the image, useful for layering the segmentation image on top of another image. | |
std::optional< ComponentBatch > | draw_order |
An optional floating point value that specifies the 2D drawing order. | |
Static Public Attributes | |
static constexpr const char | IndicatorComponentName [] |
static constexpr const char | ArchetypeName [] = "rerun.archetypes.SegmentationImage" |
The name of the archetype as used in ComponentDescriptor s. | |
static constexpr auto | Descriptor_buffer |
ComponentDescriptor for the buffer field. | |
static constexpr auto | Descriptor_format |
ComponentDescriptor for the format field. | |
static constexpr auto | Descriptor_opacity |
ComponentDescriptor for the opacity field. | |
static constexpr auto | Descriptor_draw_order |
ComponentDescriptor for the draw_order field. | |
Archetype: An image made up of integer components::ClassId
s.
Each pixel corresponds to a components::ClassId
that will be mapped to a color based on annotation context.
In the case of floating point images, the label will be looked up based on rounding to the nearest integer value.
See also archetypes::AnnotationContext
to associate each class with a color and a label.
Since the underlying rerun::datatypes::TensorData
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 |
This method makes it possible to pack multiple buffer
in a single component batch.
This only makes sense when used in conjunction with columns
. with_buffer
should be used when logging a single row's worth of data.
|
inline |
This method makes it possible to pack multiple format
in a single component batch.
This only makes sense when used in conjunction with columns
. with_format
should be used when logging a single row's worth of data.
|
inline |
Opacity of the image, useful for layering the segmentation image on top of another image.
Defaults to 0.5 if there's any other images in the scene, otherwise 1.0.
|
inline |
This method makes it possible to pack multiple opacity
in a single component batch.
This only makes sense when used in conjunction with columns
. with_opacity
should be used when logging a single row's worth of data.
|
inline |
An optional floating point value that specifies the 2D drawing order.
Objects with higher values are drawn on top of those with lower values.
|
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.
Collection< ComponentColumn > rerun::archetypes::SegmentationImage::columns | ( | const Collection< uint32_t > & | lengths_ | ) |
Partitions the component data into multiple sub-batches.
Specifically, this transforms the existing ComponentBatch
data into ComponentColumn
s 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.
Collection< ComponentColumn > rerun::archetypes::SegmentationImage::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.
std::optional<ComponentBatch> rerun::archetypes::SegmentationImage::opacity |
Opacity of the image, useful for layering the segmentation image on top of another image.
Defaults to 0.5 if there's any other images in the scene, otherwise 1.0.
std::optional<ComponentBatch> rerun::archetypes::SegmentationImage::draw_order |
An optional floating point value that specifies the 2D drawing order.
Objects with higher values are drawn on top of those with lower values.
|
staticconstexpr |
|
staticconstexpr |
ComponentDescriptor
for the buffer
field.
|
staticconstexpr |
ComponentDescriptor
for the format
field.
|
staticconstexpr |
ComponentDescriptor
for the opacity
field.
|
staticconstexpr |
ComponentDescriptor
for the draw_order
field.