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§
§impl TextureOptions
impl TextureOptions
pub const LINEAR: TextureOptions = _
pub const LINEAR: TextureOptions = _
Linear magnification and minification.
pub const NEAREST: TextureOptions = _
pub const NEAREST: TextureOptions = _
Nearest magnification and minification.
pub const LINEAR_REPEAT: TextureOptions = _
pub const LINEAR_REPEAT: TextureOptions = _
Linear magnification and minification, but with the texture repeated.
pub const LINEAR_MIRRORED_REPEAT: TextureOptions = _
pub const LINEAR_MIRRORED_REPEAT: TextureOptions = _
Linear magnification and minification, but with the texture mirrored and repeated.
pub const NEAREST_REPEAT: TextureOptions = _
pub const NEAREST_REPEAT: TextureOptions = _
Nearest magnification and minification, but with the texture repeated.
pub const NEAREST_MIRRORED_REPEAT: TextureOptions = _
pub const NEAREST_MIRRORED_REPEAT: TextureOptions = _
Nearest magnification and minification, but with the texture mirrored and repeated.
pub const fn with_mipmap_mode( self, mipmap_mode: Option<TextureFilter> ) -> TextureOptions
Trait Implementations§
§impl Clone for TextureOptions
impl Clone for TextureOptions
§fn clone(&self) -> TextureOptions
fn clone(&self) -> TextureOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for TextureOptions
impl Debug for TextureOptions
§impl Default for TextureOptions
impl Default for TextureOptions
§fn default() -> TextureOptions
fn default() -> TextureOptions
The default is linear for both magnification and minification.
§impl<'de> Deserialize<'de> for TextureOptions
impl<'de> Deserialize<'de> for TextureOptions
§fn deserialize<__D>(
__deserializer: __D
) -> Result<TextureOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TextureOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for TextureOptions
impl Hash for TextureOptions
§impl PartialEq for TextureOptions
impl PartialEq for TextureOptions
§fn eq(&self, other: &TextureOptions) -> bool
fn eq(&self, other: &TextureOptions) -> bool
self
and other
values to be equal, and is used
by ==
.§impl Serialize for TextureOptions
impl Serialize for TextureOptions
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
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> ⓘ
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request