Rerun C++ SDK
|
Archetype: A monochrome or color image. More...
#include <rerun/archetypes/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 | |
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_opacity (rerun::components::Opacity _opacity) && |
Opacity of the image, useful for layering several images. | |
Image | 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- or 3-dimensional tensor. | |
std::optional< rerun::components::Opacity > | opacity |
Opacity of the image, useful for layering several images. | |
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 order of dimensions in the underlying TensorData
follows the typical row-major, interleaved-pixel image format. Additionally, Rerun orders the TensorDimension
s within the shape description from outer-most to inner-most.
As such, 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 1x480x640x3x1
is treated as a 480x640x3
RGB image.
Rerun also supports compressed image encoded as JPEG, N12, and YUY2. Using these formats can save a lot of bandwidth and memory. See [rerun::datatypes::TensorBuffer
] for more.
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 tensor is not 2- or 3-dimensional. 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 tensor is not 2- or 3-dimensional. |
|
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 tensor is not 2- or 3-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 several images.
Defaults to 1.0 (fully opaque).
|
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::Image::opacity |
Opacity of the image, useful for layering several images.
Defaults to 1.0 (fully opaque).
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.