Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<W> Encoder<W> {
/// ## See also
///
/// - [`MipmapOptions::resize_filter`]
#[derive(Debug, Clone, Copy, Default)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum ResizeFilter {
/// Nearest neighbor interpolation (=point filtering).
Nearest,
Expand Down
10 changes: 10 additions & 0 deletions src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,16 @@ impl DataLayout {
DataLayout::TextureArray(texture_array) => texture_array.size(),
}
}
/// The number of mipmaps each texture/volume in this layout has.
///
/// This is guaranteed to be at least 1.
pub fn mipmaps(&self) -> u8 {
match self {
DataLayout::Texture(texture) => texture.mipmaps(),
DataLayout::Volume(volume) => volume.mipmaps(),
DataLayout::TextureArray(texture_array) => texture_array.mipmaps(),
}
}

/// If this layout is a [`DataLayout::Texture`], returns the texture.
pub fn texture(&self) -> Option<Texture> {
Expand Down
Loading