Rerun C++ SDK
|
Archetype: A monochrome or color image. More...
#include <rerun/archetypes/image.hpp>
Public Types | |
using | IndicatorComponent = components::IndicatorComponent< IndicatorComponentName > |
Indicator component, used to identify the archetype when converting to a list of components. | |
Public Member Functions | |
Image (Collection< datatypes::TensorDimension > shape, datatypes::TensorBuffer buffer) | |
New Image from height/width/channel and tensor buffer. | |
Image (rerun::components::TensorData data_) | |
New depth image from tensor data. | |
template<typename TElement > | |
Image (Collection< datatypes::TensorDimension > shape, const TElement *data_) | |
New image from dimensions and pointer to image data. | |
Image (Image &&other)=default | |
Image | with_draw_order (rerun::components::DrawOrder _draw_order) && |
An optional floating point value that specifies the 2D drawing order. | |
size_t | num_instances () const |
Returns the number of primary instances of this archetype. | |
Public Attributes | |
rerun::components::TensorData | data |
The image data. Should always be a rank-2 or rank-3 tensor. | |
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 [] = "rerun.components.ImageIndicator" |
Archetype: A monochrome or color image.
The shape of the TensorData
must be mappable to:
HxW
tensor, treated as a grayscale image.HxWx3
tensor, treated as an RGB image.HxWx4
tensor, treated as an RGBA image.Leading and trailing unit-dimensions are ignored, so that 1x640x480x3x1
is treated as a 640x480x3
RGB 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
.
|
inlineexplicit |
New Image from height/width/channel and tensor buffer.
shape | Shape of the image. Calls Error::handle() if the shape is not rank 2 or 3. Sets the dimension names to "height", "width" and "channel" if they are not specified. |
buffer | The tensor buffer containing the image data. |
|
explicit |
New depth image from tensor data.
data_ | The tensor buffer containing the image data. Sets the dimension names to "height", "width" and "channel" if they are not specified. Calls Error::handle() if the shape is not rank 2 or 3. |
|
inlineexplicit |
New image from dimensions and pointer to image data.
Type must be one of the types supported by rerun::datatypes::TensorData
.
shape | Shape of the image. Calls Error::handle() if the shape is not rank 2 or 3. 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 |
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::DrawOrder> rerun::archetypes::Image::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.