Rerun C++ SDK
Loading...
Searching...
No Matches
tensor_view_fit.hpp
1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/archetypes/tensor_view_fit.fbs".
3
4#pragma once
5
6#include "../../blueprint/components/view_fit.hpp"
7#include "../../collection.hpp"
8#include "../../component_batch.hpp"
9#include "../../component_column.hpp"
10#include "../../result.hpp"
11
12#include <cstdint>
13#include <optional>
14#include <utility>
15#include <vector>
16
17namespace rerun::blueprint::archetypes {
18 /// **Archetype**: Configures how a selected tensor slice is shown on screen.
19 ///
20 /// ⚠ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
21 ///
23 /// How the image is scaled to fit the view.
24 std::optional<ComponentBatch> scaling;
25
26 public:
27 /// The name of the archetype as used in `ComponentDescriptor`s.
28 static constexpr const char ArchetypeName[] = "rerun.blueprint.archetypes.TensorViewFit";
29
30 /// `ComponentDescriptor` for the `scaling` field.
31 static constexpr auto Descriptor_scaling = ComponentDescriptor(
32 ArchetypeName, "TensorViewFit:scaling",
34 );
35
36 public:
37 TensorViewFit() = default;
38 TensorViewFit(TensorViewFit&& other) = default;
39 TensorViewFit(const TensorViewFit& other) = default;
40 TensorViewFit& operator=(const TensorViewFit& other) = default;
41 TensorViewFit& operator=(TensorViewFit&& other) = default;
42
43 /// Update only some specific fields of a `TensorViewFit`.
45 return TensorViewFit();
46 }
47
48 /// Clear all the fields of a `TensorViewFit`.
50
51 /// How the image is scaled to fit the view.
52 TensorViewFit with_scaling(const rerun::blueprint::components::ViewFit& _scaling) && {
53 scaling = ComponentBatch::from_loggable(_scaling, Descriptor_scaling).value_or_throw();
54 return std::move(*this);
55 }
56
57 /// Partitions the component data into multiple sub-batches.
58 ///
59 /// Specifically, this transforms the existing `ComponentBatch` data into `ComponentColumn`s
60 /// instead, via `ComponentBatch::partitioned`.
61 ///
62 /// This makes it possible to use `RecordingStream::send_columns` to send columnar data directly into Rerun.
63 ///
64 /// The specified `lengths` must sum to the total length of the component batch.
66
67 /// Partitions the component data into unit-length sub-batches.
68 ///
69 /// This is semantically similar to calling `columns` with `std::vector<uint32_t>(n, 1)`,
70 /// where `n` is automatically guessed.
72 };
73
74} // namespace rerun::blueprint::archetypes
75
76namespace rerun {
77 /// \private
78 template <typename T>
79 struct AsComponents;
80
81 /// \private
82 template <>
83 struct AsComponents<blueprint::archetypes::TensorViewFit> {
84 /// Serialize all set component batches.
85 static Result<Collection<ComponentBatch>> as_batches(
87 );
88 };
89} // namespace rerun
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:23
static Result< ComponentBatch > from_loggable(const rerun::Collection< T > &components, const ComponentDescriptor &descriptor)
Creates a new component batch from a collection of component instances.
Definition component_batch.hpp:46
A ComponentDescriptor fully describes the semantics of a column of data.
Definition component_descriptor.hpp:16
The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a colle...
Definition loggable.hpp:11
Archetype: Configures how a selected tensor slice is shown on screen.
Definition tensor_view_fit.hpp:22
Collection< ComponentColumn > columns()
Partitions the component data into unit-length sub-batches.
static constexpr const char ArchetypeName[]
The name of the archetype as used in ComponentDescriptors.
Definition tensor_view_fit.hpp:28
static constexpr auto Descriptor_scaling
ComponentDescriptor for the scaling field.
Definition tensor_view_fit.hpp:31
static TensorViewFit update_fields()
Update only some specific fields of a TensorViewFit.
Definition tensor_view_fit.hpp:44
Collection< ComponentColumn > columns(const Collection< uint32_t > &lengths_)
Partitions the component data into multiple sub-batches.
static TensorViewFit clear_fields()
Clear all the fields of a TensorViewFit.
std::optional< ComponentBatch > scaling
How the image is scaled to fit the view.
Definition tensor_view_fit.hpp:24
TensorViewFit with_scaling(const rerun::blueprint::components::ViewFit &_scaling) &&
How the image is scaled to fit the view.
Definition tensor_view_fit.hpp:52