pub struct Texture { /* private fields */ }
Expand description
Represents a texture.
Implementations§
Source§impl Texture
impl Texture
Sourcepub fn from_path<'a, P>(
context: &mut TextureContext<'a>,
path: P,
settings: &TextureSettings,
) -> Result<Self, TextureError>
pub fn from_path<'a, P>( context: &mut TextureContext<'a>, path: P, settings: &TextureSettings, ) -> Result<Self, TextureError>
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§
Source§impl<'a> CreateTexture<TextureContext<'a>> for Texture
impl<'a> CreateTexture<TextureContext<'a>> for Texture
Source§fn 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.
Source§impl<'a> TextureOp<TextureContext<'a>> for Texture
impl<'a> TextureOp<TextureContext<'a>> for Texture
Source§type Error = TextureError
type Error = TextureError
The error when performing an operation.
Auto Trait Implementations§
impl Freeze for Texture
impl !RefUnwindSafe for Texture
impl Send for Texture
impl Sync for Texture
impl Unpin for Texture
impl !UnwindSafe for Texture
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
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>
Converts
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>
Converts
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