Rerun C++ SDK
|
Archetype: An image made up of integer class-ids. 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 | |
SegmentationImage (Collection< datatypes::TensorDimension > shape, datatypes::TensorBuffer buffer) | |
New segmentation image from height/width and tensor buffer. | |
SegmentationImage (components::TensorData data_) | |
New segmentation image from tensor data. | |
template<typename TElement > | |
SegmentationImage (Collection< datatypes::TensorDimension > shape, const TElement *data_) | |
New segmentation image from dimensions and pointer to segmentation image data. | |
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::TensorData | data |
The image data. Should always be a 2-dimensional tensor. | |
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 class-ids.
The shape of the TensorData
must be mappable to an HxW
tensor. Each pixel corresponds to a class-id 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.
Leading and trailing unit-dimensions are ignored, so that 1x640x480x1
is treated as a 640x480
image.
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 |
New segmentation image from height/width and tensor buffer.
shape | Shape of the image. Calls Error::handle() if the tensor is not 2-dimensional Sets the dimension names to "height" and "width" if they are not specified. |
buffer | The tensor buffer containing the segmentation image data. |
|
explicit |
New segmentation image from tensor data.
data_ | The tensor buffer containing the segmentation image data. Sets the dimension names to "height" and "width" if they are not specified. Calls Error::handle() if the tensor is not 2-dimensional |
|
inlineexplicit |
New segmentation image from dimensions and pointer to segmentation image data.
Type must be one of the types supported by rerun::datatypes::TensorData
.
shape | Shape of the image. Calls Error::handle() if the tensor is not 2-dimensional Sets the dimension names to "height", "width" and "channel" if they are not specified. Determines the number of elements expected to be in data . |
data_ | Target of the pointer must outlive the archetype. |
|
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 |