pub struct CuDepthMap<A, E = CuDepthLength>{
pub format: CuDepthMapFormat,
pub buffer_handle: CuHandle<A>,
/* private fields */
}Expand description
Standard depth-map payload backed by a Copper handle.
The default encoding stores Length directly. Alternate encodings can
retain a sensor’s compact native representation without a producer-side
conversion or copy.
Fields§
§format: CuDepthMapFormat§buffer_handle: CuHandle<A>Implementations§
Source§impl<A, E> CuDepthMap<A, E>
impl<A, E> CuDepthMap<A, E>
pub const fn encoding_descriptor() -> CuDepthEncodingDescriptor
pub fn new_encoded(format: CuDepthMapFormat, buffer_handle: CuHandle<A>) -> Self
Sourcepub fn get_raw(&self, x: u32, y: u32) -> Option<E::Sample>
pub fn get_raw(&self, x: u32, y: u32) -> Option<E::Sample>
Returns the native encoded sample at (x, y).
Sourcepub fn decode_sample(sample: E::Sample) -> Option<Length>
pub fn decode_sample(sample: E::Sample) -> Option<Length>
Converts a native sample into a physical length.
Sourcepub fn get(&self, x: u32, y: u32) -> Option<Length>
pub fn get(&self, x: u32, y: u32) -> Option<Length>
Returns the physical depth sample at (x, y).
Returns None for out-of-bounds coordinates and encoded invalid values.
Sourcepub fn get_meters(&self, x: u32, y: u32) -> Option<f32>
pub fn get_meters(&self, x: u32, y: u32) -> Option<f32>
Returns the sample at (x, y) converted to meters.
Sourcepub fn convert_into<B, F>(&self, target: &mut CuDepthMap<B, F>) -> CuResult<()>
pub fn convert_into<B, F>(&self, target: &mut CuDepthMap<B, F>) -> CuResult<()>
Converts this map into a caller-provided target map.
Only logical pixels are written; target row padding is left untouched. This performs one source lock, one target lock, and no allocation.
Sourcepub fn with_samples<R>(
&self,
f: impl FnOnce(&[E::Sample], CuDepthMapFormat) -> R,
) -> R
pub fn with_samples<R>( &self, f: impl FnOnce(&[E::Sample], CuDepthMapFormat) -> R, ) -> R
Accesses all samples under a single buffer lock.
The slice covers exactly CuDepthMapFormat::required_elements, including
any row padding described by CuDepthMapFormat::stride.
Sourcepub fn with_samples_mut<R>(
&mut self,
f: impl FnOnce(&mut [E::Sample], CuDepthMapFormat) -> R,
) -> R
pub fn with_samples_mut<R>( &mut self, f: impl FnOnce(&mut [E::Sample], CuDepthMapFormat) -> R, ) -> R
Mutably accesses all samples under a single buffer lock.
The slice covers exactly CuDepthMapFormat::required_elements, including
any row padding described by CuDepthMapFormat::stride.
pub fn payload_should_log(&self) -> bool
pub fn apply_handle_content_policy(&self, mode: HandleContent)
pub fn mark_touched(&self)
Source§impl<A> CuDepthMap<A, CuDepthLength>
impl<A> CuDepthMap<A, CuDepthLength>
pub fn new(format: CuDepthMapFormat, buffer_handle: CuHandle<A>) -> Self
Source§impl<A, T, S> CuDepthMap<A, CuDepthInteger<T, S>>
impl<A, T, S> CuDepthMap<A, CuDepthInteger<T, S>>
pub fn from_integer( format: CuDepthMapFormat, buffer_handle: CuHandle<A>, ) -> Self
Trait Implementations§
Source§impl<A, E> Clone for CuDepthMap<A, E>
impl<A, E> Clone for CuDepthMap<A, E>
Source§fn clone(&self) -> CuDepthMap<A, E>
fn clone(&self) -> CuDepthMap<A, E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<A, E> Debug for CuDepthMap<A, E>
impl<A, E> Debug for CuDepthMap<A, E>
Source§impl<A, E> Decode<()> for CuDepthMap<A, E>
impl<A, E> Decode<()> for CuDepthMap<A, E>
Source§impl<A, E> Default for CuDepthMap<A, E>
impl<A, E> Default for CuDepthMap<A, E>
Source§fn default() -> CuDepthMap<A, E>
fn default() -> CuDepthMap<A, E>
Source§impl<'de, A, E> Deserialize<'de> for CuDepthMap<A, E>where
E: CuDepthEncoding,
A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,
CuHandle<A>: Deserialize<'de>,
impl<'de, A, E> Deserialize<'de> for CuDepthMap<A, E>where
E: CuDepthEncoding,
A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,
CuHandle<A>: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl<A, E> Encode for CuDepthMap<A, E>
impl<A, E> Encode for CuDepthMap<A, E>
impl<A, E> HandleContentAware for CuDepthMap<A, E>
Source§impl<A, E> Serialize for CuDepthMap<A, E>
impl<A, E> Serialize for CuDepthMap<A, E>
Source§impl<A, E> TypePath for CuDepthMap<A, E>
impl<A, E> TypePath for CuDepthMap<A, E>
Auto Trait Implementations§
impl<A, E> Freeze for CuDepthMap<A, E>
impl<A, E> RefUnwindSafe for CuDepthMap<A, E>where
E: RefUnwindSafe,
impl<A, E> Send for CuDepthMap<A, E>
impl<A, E> Sync for CuDepthMap<A, E>
impl<A, E> Unpin for CuDepthMap<A, E>where
E: Unpin,
impl<A, E> UnsafeUnpin for CuDepthMap<A, E>
impl<A, E> UnwindSafe for CuDepthMap<A, E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CuMsgPayload for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> GetTypeRegistration for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more