pub struct GpuImage { /* private fields */ }Expand description
GPU-resident packed image backed by an rgba8uint 2D texture.
The logical channel count remains 1..=4. Unused texture components are zero, so device storage is a predictable four bytes per pixel on every backend.
Implementations§
Source§impl GpuImage
impl GpuImage
Sourcepub fn upload_u8<const CHANNELS: usize>(
runtime: &WgpuRuntime,
view: ImageView<'_, u8, CHANNELS>,
) -> SpatialResult<Self>
pub fn upload_u8<const CHANNELS: usize>( runtime: &WgpuRuntime, view: ImageView<'_, u8, CHANNELS>, ) -> SpatialResult<Self>
Explicitly uploads a packed or strided u8 image into a texture.
Sourcepub fn readback_u8<const CHANNELS: usize>(
&mut self,
runtime: &WgpuRuntime,
) -> SpatialResult<Image<u8, CHANNELS>>
pub fn readback_u8<const CHANNELS: usize>( &mut self, runtime: &WgpuRuntime, ) -> SpatialResult<Image<u8, CHANNELS>>
Explicitly reads the texture back into an owned packed host image.
Sourcepub const fn metadata(&self) -> ImageMetadata
pub const fn metadata(&self) -> ImageMetadata
Returns retained semantic metadata.
Sourcepub const fn receipt(&self) -> &GpuImageReceipt
pub const fn receipt(&self) -> &GpuImageReceipt
Returns cumulative transfer and device-stage accounting.
Sourcepub fn recycle(self, runtime: &WgpuRuntime)
pub fn recycle(self, runtime: &WgpuRuntime)
Drops texture storage after verifying the runtime ownership contract.
Auto Trait Implementations§
impl Freeze for GpuImage
impl !RefUnwindSafe for GpuImage
impl Send for GpuImage
impl Sync for GpuImage
impl Unpin for GpuImage
impl UnsafeUnpin for GpuImage
impl !UnwindSafe for GpuImage
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
Mutably borrows from an owned value. Read more