pub struct Image { /* private fields */ }Expand description
Image is a cheap-to-clone handle to an immutable GPU image.
Display lists retain cloned handles, and the texture is released after the last handle and in-flight GPU use are gone.
Implementations§
Source§impl Image
impl Image
Sourcepub fn from_texture(texture: Texture, size: [u32; 2], mip_levels: u32) -> Self
pub fn from_texture(texture: Texture, size: [u32; 2], mip_levels: u32) -> Self
from_texture creates an image from an existing texture.
Prefer Context::import_image through the valo facade unless managing
renderer resources directly.
Sourcepub fn view(&self) -> &TextureView
pub fn view(&self) -> &TextureView
view returns the texture view used for sampling.
Sourcepub fn mip_levels(&self) -> u32
pub fn mip_levels(&self) -> u32
mip_levels returns the number of available mip levels.
Sourcepub fn downgrade(&self) -> Weak<ImageInner>
pub fn downgrade(&self) -> Weak<ImageInner>
downgrade returns a non-owning handle to this image’s resources.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Image
impl !UnwindSafe for Image
impl Freeze for Image
impl Send for Image
impl Sync for Image
impl Unpin for Image
impl UnsafeUnpin for Image
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