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 download_into_profiled(
&self,
out: &mut [u8],
stride: usize,
) -> Result<u128, Error>
pub fn download_into_profiled( &self, out: &mut [u8], stride: usize, ) -> Result<u128, Error>
Download the surface and return elapsed host copy time in microseconds.
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§
Source§impl DeviceSurface for Surface
impl DeviceSurface for Surface
Source§fn backend_kind(&self) -> BackendKind
fn backend_kind(&self) -> BackendKind
Source§fn residency(&self) -> SurfaceResidency
fn residency(&self) -> SurfaceResidency
Source§fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
Source§fn pixel_format(&self) -> PixelFormat
fn pixel_format(&self) -> PixelFormat
Source§fn execution_stats(&self) -> ExecutionStats
fn execution_stats(&self) -> ExecutionStats
Source§fn memory_range(&self) -> Option<DeviceMemoryRange>
fn memory_range(&self) -> Option<DeviceMemoryRange>
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