Rerun C++ SDK
|
Archetype: An N-dimensional array of numbers. More...
#include <rerun/archetypes/tensor.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 | |
Tensor (Collection< datatypes::TensorDimension > shape, datatypes::TensorBuffer buffer) | |
New Tensor from dimensions and tensor buffer. | |
template<typename TElement > | |
Tensor (Collection< datatypes::TensorDimension > shape, const TElement *data_) | |
New tensor from dimensions and pointer to tensor data. | |
Tensor | with_dim_names (Collection< std::string > names) && |
Update the names of the contained TensorData dimensions. | |
Tensor (Tensor &&other)=default | |
Tensor (rerun::components::TensorData _data) | |
Tensor | with_value_range (rerun::components::ValueRange _value_range) && |
The expected range of values. | |
Public Attributes | |
rerun::components::TensorData | data |
The tensor data. | |
std::optional< rerun::components::ValueRange > | value_range |
The expected range of values. | |
Static Public Attributes | |
static constexpr const char | IndicatorComponentName [] = "rerun.components.TensorIndicator" |
Archetype: An N-dimensional array of numbers.
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 tensor from dimensions and pointer to tensor data.
Type must be one of the types supported by rerun::datatypes::TensorData
.
shape | Shape of the image. Determines the number of elements expected to be in data . |
data_ | Target of the pointer must outlive the archetype. |
Tensor rerun::archetypes::Tensor::with_dim_names | ( | Collection< std::string > | names | ) | && |
Update the names
of the contained TensorData
dimensions.
Any existing Dimension names will be overwritten.
If too many, or too few names are provided, this function will call Error::handle and then proceed to only update the subset of names that it can.
|
inline |
The expected range of values.
This is typically the expected range of valid values. Everything outside of the range is clamped to the range for the purpose of colormpaping. Any colormap applied for display, will map this range.
If not specified, the range will be automatically estimated from the data. Note that the Viewer may try to guess a wider range than the minimum/maximum of values in the contents of the tensor. E.g. if all values are positive, some bigger than 1.0 and all smaller than 255.0, the Viewer will guess that the data likely came from an 8bit image, thus assuming a range of 0-255.
std::optional<rerun::components::ValueRange> rerun::archetypes::Tensor::value_range |
The expected range of values.
This is typically the expected range of valid values. Everything outside of the range is clamped to the range for the purpose of colormpaping. Any colormap applied for display, will map this range.
If not specified, the range will be automatically estimated from the data. Note that the Viewer may try to guess a wider range than the minimum/maximum of values in the contents of the tensor. E.g. if all values are positive, some bigger than 1.0 and all smaller than 255.0, the Viewer will guess that the data likely came from an 8bit image, thus assuming a range of 0-255.