Skip to main content

CuDepthMap

Struct CuDepthMap 

Source
pub struct CuDepthMap<A, E = CuDepthLength>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,
{ 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>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,

Source

pub const fn encoding_descriptor() -> CuDepthEncodingDescriptor

Source

pub fn new_encoded(format: CuDepthMapFormat, buffer_handle: CuHandle<A>) -> Self

Source

pub fn get_raw(&self, x: u32, y: u32) -> Option<E::Sample>

Returns the native encoded sample at (x, y).

Source

pub fn decode_sample(sample: E::Sample) -> Option<Length>

Converts a native sample into a physical length.

Source

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.

Source

pub fn get_meters(&self, x: u32, y: u32) -> Option<f32>

Returns the sample at (x, y) converted to meters.

Source

pub fn convert_into<B, F>(&self, target: &mut CuDepthMap<B, F>) -> CuResult<()>
where F: CuDepthEncoding, B: ArrayLike<Element = F::Sample> + Send + Sync + 'static,

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.

Source

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.

Source

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.

Source

pub fn payload_should_log(&self) -> bool

Source

pub fn apply_handle_content_policy(&self, mode: HandleContent)

Source

pub fn mark_touched(&self)

Source§

impl<A> CuDepthMap<A, CuDepthLength>
where A: ArrayLike<Element = Length> + Send + Sync + 'static,

Source

pub fn new(format: CuDepthMapFormat, buffer_handle: CuHandle<A>) -> Self

Source§

impl<A, T, S> CuDepthMap<A, CuDepthInteger<T, S>>
where T: CuDepthIntegerSample, S: CuDepthScale, A: ArrayLike<Element = T> + Send + Sync + 'static,

Source

pub fn from_integer( format: CuDepthMapFormat, buffer_handle: CuHandle<A>, ) -> Self

Trait Implementations§

Source§

impl<A, E> Clone for CuDepthMap<A, E>
where E: CuDepthEncoding + Clone, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static + Clone,

Source§

fn clone(&self) -> CuDepthMap<A, E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A, E> Debug for CuDepthMap<A, E>
where E: CuDepthEncoding + Debug, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A, E> Decode<()> for CuDepthMap<A, E>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static, CuHandle<A>: Decode<()>,

Source§

fn decode<D: Decoder<Context = ()>>( decoder: &mut D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl<A, E> Default for CuDepthMap<A, E>
where E: CuDepthEncoding + Default, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static + Default,

Source§

fn default() -> CuDepthMap<A, E>

Returns the “default value” for a type. Read more
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>,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<A, E> Encode for CuDepthMap<A, E>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static, CuHandle<A>: Encode,

Source§

fn encode<Enc: Encoder>(&self, encoder: &mut Enc) -> Result<(), EncodeError>

Encode a given type.
Source§

impl<A, E> HandleContentAware for CuDepthMap<A, E>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,

Source§

impl<A, E> Serialize for CuDepthMap<A, E>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static, CuHandle<A>: Serialize,

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<A, E> TypePath for CuDepthMap<A, E>
where E: CuDepthEncoding, A: ArrayLike<Element = E::Sample> + Send + Sync + 'static,

Source§

fn type_path() -> &'static str

Source§

fn short_type_path() -> &'static str

Source§

fn type_ident() -> Option<&'static str>

Source§

fn crate_name() -> Option<&'static str>

Source§

fn module_path() -> Option<&'static str>

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CuMsgPayload for T

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetTypeRegistration for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PayloadDefaultHandlePolicyApply for T
where T: ?Sized,

Source§

impl<T> PayloadDefaultLoggingPolicy for T
where T: ?Sized,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Reflect for T
where T: 'static,

Source§

impl<T> ReflectTypePath for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.