Struct wgpu_graphics::Texture
source · pub struct Texture { /* private fields */ }Expand description
Represents a texture.
Implementations
sourceimpl Texture
impl Texture
sourcepub fn from_path<'a, P>(
context: &mut TextureContext<'a>,
path: P,
settings: &TextureSettings
) -> Result<Self, TextureError>where
P: AsRef<Path>,
pub fn from_path<'a, P>(
context: &mut TextureContext<'a>,
path: P,
settings: &TextureSettings
) -> Result<Self, TextureError>where
P: AsRef<Path>,
Creates a Texture with image loading from path.
sourcepub fn from_image<'a>(
context: &mut TextureContext<'a>,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureError>
pub fn from_image<'a>(
context: &mut TextureContext<'a>,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureError>
Creates a Texture with img.
Trait Implementations
sourceimpl<'a> CreateTexture<TextureContext<'a>> for Texture
impl<'a> CreateTexture<TextureContext<'a>> for Texture
sourcefn create<S: Into<[u32; 2]>>(
_: &mut TextureContext<'a>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Self, TextureError>
fn create<S: Into<[u32; 2]>>(
_: &mut TextureContext<'a>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Self, TextureError>
Create texture from memory.
sourceimpl<'a> TextureOp<TextureContext<'a>> for Texture
impl<'a> TextureOp<TextureContext<'a>> for Texture
type Error = TextureError
type Error = TextureError
The error when performing an operation.
sourceimpl<'a> UpdateTexture<TextureContext<'a>> for Texture
impl<'a> UpdateTexture<TextureContext<'a>> for Texture
Auto Trait Implementations
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more