re_types/components/
depth_meter.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/components/depth_meter.fbs".
3
4#![allow(unused_braces)]
5#![allow(unused_imports)]
6#![allow(unused_parens)]
7#![allow(clippy::allow_attributes)]
8#![allow(clippy::clone_on_copy)]
9#![allow(clippy::cloned_instead_of_copied)]
10#![allow(clippy::map_flatten)]
11#![allow(clippy::needless_question_mark)]
12#![allow(clippy::new_without_default)]
13#![allow(clippy::redundant_closure)]
14#![allow(clippy::too_many_arguments)]
15#![allow(clippy::too_many_lines)]
16#![allow(clippy::wildcard_imports)]
17
18use ::re_types_core::SerializationResult;
19use ::re_types_core::try_serialize_field;
20use ::re_types_core::{ComponentBatch as _, SerializedComponentBatch};
21use ::re_types_core::{ComponentDescriptor, ComponentType};
22use ::re_types_core::{DeserializationError, DeserializationResult};
23
24/// **Component**: The world->depth map scaling factor.
25///
26/// This measures how many depth map units are in a world unit.
27/// For instance, if a depth map uses millimeters and the world uses meters,
28/// this value would be `1000`.
29///
30/// Note that the only effect on 2D views is the physical depth values shown when hovering the image.
31/// In 3D views on the other hand, this affects where the points of the point cloud are placed.
32///
33/// ⚠️ **This type is _unstable_ and may change significantly in a way that the data won't be backwards compatible.**
34#[derive(Clone, Debug, Copy, PartialEq, PartialOrd, bytemuck::Pod, bytemuck::Zeroable)]
35#[repr(transparent)]
36pub struct DepthMeter(pub crate::datatypes::Float32);
37
38impl ::re_types_core::WrapperComponent for DepthMeter {
39    type Datatype = crate::datatypes::Float32;
40
41    #[inline]
42    fn name() -> ComponentType {
43        "rerun.components.DepthMeter".into()
44    }
45
46    #[inline]
47    fn into_inner(self) -> Self::Datatype {
48        self.0
49    }
50}
51
52::re_types_core::macros::impl_into_cow!(DepthMeter);
53
54impl<T: Into<crate::datatypes::Float32>> From<T> for DepthMeter {
55    fn from(v: T) -> Self {
56        Self(v.into())
57    }
58}
59
60impl std::borrow::Borrow<crate::datatypes::Float32> for DepthMeter {
61    #[inline]
62    fn borrow(&self) -> &crate::datatypes::Float32 {
63        &self.0
64    }
65}
66
67impl std::ops::Deref for DepthMeter {
68    type Target = crate::datatypes::Float32;
69
70    #[inline]
71    fn deref(&self) -> &crate::datatypes::Float32 {
72        &self.0
73    }
74}
75
76impl std::ops::DerefMut for DepthMeter {
77    #[inline]
78    fn deref_mut(&mut self) -> &mut crate::datatypes::Float32 {
79        &mut self.0
80    }
81}
82
83impl ::re_byte_size::SizeBytes for DepthMeter {
84    #[inline]
85    fn heap_size_bytes(&self) -> u64 {
86        self.0.heap_size_bytes()
87    }
88
89    #[inline]
90    fn is_pod() -> bool {
91        <crate::datatypes::Float32>::is_pod()
92    }
93}