pub struct TextureOptions {
pub magnification: TextureFilter,
pub minification: TextureFilter,
pub wrap_mode: TextureWrapMode,
pub mipmap_mode: Option<TextureFilter>,
}
Expand description
How the texture texels are filtered.
Fields§
§magnification: TextureFilter
How to filter when magnifying (when texels are larger than pixels).
minification: TextureFilter
How to filter when minifying (when texels are smaller than pixels).
wrap_mode: TextureWrapMode
How to wrap the texture when the texture coordinates are outside the [0, 1] range.
mipmap_mode: Option<TextureFilter>
How to filter between texture mipmaps.
Mipmaps ensures textures look smooth even when the texture is very small and pixels are much larger than individual texels.
§Notes
- This may not be available on all backends (currently only
egui_glow
).
Implementations§
Source§impl TextureOptions
impl TextureOptions
Sourcepub const LINEAR_REPEAT: Self = _
pub const LINEAR_REPEAT: Self = _
Linear magnification and minification, but with the texture repeated.
Sourcepub const LINEAR_MIRRORED_REPEAT: Self = _
pub const LINEAR_MIRRORED_REPEAT: Self = _
Linear magnification and minification, but with the texture mirrored and repeated.
Sourcepub const NEAREST_REPEAT: Self = _
pub const NEAREST_REPEAT: Self = _
Nearest magnification and minification, but with the texture repeated.
Sourcepub const NEAREST_MIRRORED_REPEAT: Self = _
pub const NEAREST_MIRRORED_REPEAT: Self = _
Nearest magnification and minification, but with the texture mirrored and repeated.
pub const fn with_mipmap_mode(self, mipmap_mode: Option<TextureFilter>) -> Self
Trait Implementations§
Source§impl Clone for TextureOptions
impl Clone for TextureOptions
Source§fn clone(&self) -> TextureOptions
fn clone(&self) -> TextureOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TextureOptions
impl Debug for TextureOptions
Source§impl Default for TextureOptions
impl Default for TextureOptions
Source§impl<'de> Deserialize<'de> for TextureOptions
impl<'de> Deserialize<'de> for TextureOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for TextureOptions
impl Hash for TextureOptions
Source§impl PartialEq for TextureOptions
impl PartialEq for TextureOptions
Source§impl Serialize for TextureOptions
impl Serialize for TextureOptions
impl Copy for TextureOptions
impl Eq for TextureOptions
impl StructuralPartialEq for TextureOptions
Auto Trait Implementations§
impl Freeze for TextureOptions
impl RefUnwindSafe for TextureOptions
impl Send for TextureOptions
impl Sync for TextureOptions
impl Unpin for TextureOptions
impl UnwindSafe for TextureOptions
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