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 | with_opacity (rerun::components::Opacity _opacity) && |
Opacity of the image, useful for layering the segmentation image on top of another image. | |
SegmentationImage | with_draw_order (rerun::components::DrawOrder _draw_order) && |
An optional floating point value that specifies the 2D drawing order. | |
Public Attributes | |
rerun::components::ImageBuffer | buffer |
The raw image data. | |
rerun::components::ImageFormat | format |
The format of the image. | |
std::optional< rerun::components::Opacity > | opacity |
Opacity of the image, useful for layering the segmentation image on top of another image. | |
std::optional< rerun::components::DrawOrder > | draw_order |
An optional floating point value that specifies the 2D drawing order. | |
Static Public Attributes | |
static constexpr const char | IndicatorComponentName [] |
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 |
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 |
An optional floating point value that specifies the 2D drawing order.
Objects with higher values are drawn on top of those with lower values.
std::optional<rerun::components::Opacity> 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<rerun::components::DrawOrder> 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 |