re_types/blueprint/views/
tensor_view.rs

1// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/rust/api.rs
2// Based on "crates/store/re_types/definitions/rerun/blueprint/views/tensor.fbs".
3
4#![allow(unused_braces)]
5#![allow(unused_imports)]
6#![allow(unused_parens)]
7#![allow(clippy::clone_on_copy)]
8#![allow(clippy::cloned_instead_of_copied)]
9#![allow(clippy::map_flatten)]
10#![allow(clippy::needless_question_mark)]
11#![allow(clippy::new_without_default)]
12#![allow(clippy::redundant_closure)]
13#![allow(clippy::too_many_arguments)]
14#![allow(clippy::too_many_lines)]
15
16use ::re_types_core::try_serialize_field;
17use ::re_types_core::SerializationResult;
18use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
19use ::re_types_core::{ComponentDescriptor, ComponentType};
20use ::re_types_core::{DeserializationError, DeserializationResult};
21
22/// **View**: A view on a tensor of any dimensionality.
23///
24/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
25#[derive(Clone, Debug)]
26pub struct TensorView {
27    /// How to select the slice of the tensor to show.
28    pub slice_selection: crate::blueprint::archetypes::TensorSliceSelection,
29
30    /// Configures how scalars are mapped to color.
31    pub scalar_mapping: crate::blueprint::archetypes::TensorScalarMapping,
32
33    /// Configures how the selected slice should fit into the view.
34    pub view_fit: crate::blueprint::archetypes::TensorViewFit,
35}
36
37impl ::re_types_core::View for TensorView {
38    #[inline]
39    fn identifier() -> ::re_types_core::ViewClassIdentifier {
40        "Tensor".into()
41    }
42}
43
44impl ::re_byte_size::SizeBytes for TensorView {
45    #[inline]
46    fn heap_size_bytes(&self) -> u64 {
47        self.slice_selection.heap_size_bytes()
48            + self.scalar_mapping.heap_size_bytes()
49            + self.view_fit.heap_size_bytes()
50    }
51
52    #[inline]
53    fn is_pod() -> bool {
54        <crate::blueprint::archetypes::TensorSliceSelection>::is_pod()
55            && <crate::blueprint::archetypes::TensorScalarMapping>::is_pod()
56            && <crate::blueprint::archetypes::TensorViewFit>::is_pod()
57    }
58}