pub struct Surface { /* private fields */ }Expand description
Host- or CUDA-backed decoded surface.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn residency(&self) -> SurfaceResidency
pub fn residency(&self) -> SurfaceResidency
Return where the surface’s pixels currently reside.
Sourcepub fn pitch_bytes(&self) -> usize
pub fn pitch_bytes(&self) -> usize
Row pitch in bytes.
Sourcepub fn as_host_bytes(&self) -> Option<&[u8]>
pub fn as_host_bytes(&self) -> Option<&[u8]>
Borrow host bytes when the surface is host-backed.
Sourcepub fn download_into(&self, out: &mut [u8], stride: usize) -> Result<(), Error>
pub fn download_into(&self, out: &mut [u8], stride: usize) -> Result<(), Error>
Download or copy the surface into caller-owned strided output.
Sourcepub fn cuda_surface(&self) -> Option<CudaSurface<'_>>
pub fn cuda_surface(&self) -> Option<CudaSurface<'_>>
Borrow CUDA metadata when the surface is CUDA-backed.
Sourcepub fn download_batch_tight(surfaces: &[Self]) -> Result<Vec<u8>, Error>
pub fn download_batch_tight(surfaces: &[Self]) -> Result<Vec<u8>, Error>
Download a sequence of surfaces into a tightly concatenated output buffer.
CUDA surfaces produced from one contiguous batch allocation are copied with one device-to-host transfer. Other layouts fall back to downloading each surface tightly in order.
Sourcepub fn download_batch_tight_into(
surfaces: &[Self],
out: &mut [u8],
) -> Result<(), Error>
pub fn download_batch_tight_into( surfaces: &[Self], out: &mut [u8], ) -> Result<(), Error>
Download a sequence of surfaces into a tightly concatenated output buffer.
CUDA surfaces produced from one contiguous batch allocation are copied with one device-to-host transfer. Other layouts fall back to downloading each surface tightly in order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Surface
impl RefUnwindSafe for Surface
impl Send for Surface
impl Sync for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
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> 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