pub struct WriteOptions {
pub generate_mipmaps: bool,
pub resize_straight_alpha: bool,
pub resize_filter: ResizeFilter,
}
Fields§
§generate_mipmaps: bool
Whether to generate mipmaps for the texture.
Since the encoder knows exactly how many mipmaps are needed, it will generate all mipmaps until the next level 0 object or EOF.
Note: Generating mipmaps for volume depth slices is not supported. This will NOT result in an error and instead the encoder will silently ignore the option.
Default: false
resize_straight_alpha: bool
Whether the alpha channel (if any) is straight alpha.
This is important when generating mipmaps. Resizing RGBA with straight alpha requires that the alpha channel is premultiplied into the color channels before resizing and then unpremultiplied after resizing. This is necessary to avoid color bleeding.
If the alpha channel is premultiplied alpha or custom (e.g. like in
channel-packed textures), this option should be set to false
.
If this option is set to false
, all channels will be resized
independently of each other.
Default: true
resize_filter: ResizeFilter
The filter to use when resizing the texture to generate mipmaps.
Default: ResizeFilter::Box
Trait Implementations§
Source§impl Clone for WriteOptions
impl Clone for WriteOptions
Source§fn clone(&self) -> WriteOptions
fn clone(&self) -> WriteOptions
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WriteOptions
impl Debug for WriteOptions
Source§impl Default for WriteOptions
impl Default for WriteOptions
impl Copy for WriteOptions
Auto Trait Implementations§
impl Freeze for WriteOptions
impl RefUnwindSafe for WriteOptions
impl Send for WriteOptions
impl Sync for WriteOptions
impl Unpin for WriteOptions
impl UnwindSafe for WriteOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more