[−][src]Enum vulkano::image::ImageDimensions
Variants
Implementations
impl ImageDimensions
[src]
pub fn width(&self) -> u32
[src]
pub fn height(&self) -> u32
[src]
pub fn width_height(&self) -> [u32; 2]
[src]
pub fn depth(&self) -> u32
[src]
pub fn width_height_depth(&self) -> [u32; 3]
[src]
pub fn array_layers(&self) -> u32
[src]
pub fn num_texels(&self) -> u32
[src]
Returns the total number of texels for an image of these dimensions.
pub fn max_mipmaps(&self) -> u32
[src]
Returns the maximum number of mipmaps for these image dimensions.
The returned value is always at least superior or equal to 1.
Example
use vulkano::image::ImageDimensions; let dims = ImageDimensions::Dim2d { width: 32, height: 50, cubemap_compatible: false, array_layers: 1, }; assert_eq!(dims.max_mipmaps(), 6);
pub fn mipmap_dimensions(&self, level: u32) -> Option<ImageDimensions>
[src]
Returns the dimensions of the level
th mipmap level. If level
is 0, then the dimensions
are left unchanged.
Returns None
if level
is superior or equal to max_mipmaps()
.
Example
use vulkano::image::ImageDimensions; let dims = ImageDimensions::Dim2d { width: 963, height: 256, cubemap_compatible: false, array_layers: 1, }; assert_eq!(dims.mipmap_dimensions(0), Some(dims)); assert_eq!(dims.mipmap_dimensions(1), Some(ImageDimensions::Dim2d { width: 481, height: 128, cubemap_compatible: false, array_layers: 1, })); assert_eq!(dims.mipmap_dimensions(6), Some(ImageDimensions::Dim2d { width: 15, height: 4, cubemap_compatible: false, array_layers: 1, })); assert_eq!(dims.mipmap_dimensions(9), Some(ImageDimensions::Dim2d { width: 1, height: 1, cubemap_compatible: false, array_layers: 1, })); assert_eq!(dims.mipmap_dimensions(11), None);
Panic
In debug mode, Panics if width
, height
or depth
is equal to 0. In release, returns
an unspecified value.
Trait Implementations
impl Clone for ImageDimensions
[src]
fn clone(&self) -> ImageDimensions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ImageDimensions
[src]
impl Debug for ImageDimensions
[src]
impl Eq for ImageDimensions
[src]
impl PartialEq<ImageDimensions> for ImageDimensions
[src]
fn eq(&self, other: &ImageDimensions) -> bool
[src]
fn ne(&self, other: &ImageDimensions) -> bool
[src]
impl StructuralEq for ImageDimensions
[src]
impl StructuralPartialEq for ImageDimensions
[src]
Auto Trait Implementations
impl RefUnwindSafe for ImageDimensions
impl Send for ImageDimensions
impl Sync for ImageDimensions
impl Unpin for ImageDimensions
impl UnwindSafe for ImageDimensions
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,