Enum vulkano::image::ImageDimensions [−][src]
pub enum ImageDimensions { Dim1d { width: u32, array_layers: u32, }, Dim2d { width: u32, height: u32, array_layers: u32, }, Dim3d { width: u32, height: u32, depth: u32, }, }
The dimensions of an image.
Variants
Implementations
impl ImageDimensions
[src]
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]
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]
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, array_layers: 1, }; assert_eq!(dims.max_mipmaps(), 6);
pub fn mipmap_dimensions(&self, level: u32) -> Option<ImageDimensions>
[src]
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, array_layers: 1, }; assert_eq!(dims.mipmap_dimensions(0), Some(dims)); assert_eq!(dims.mipmap_dimensions(1), Some(ImageDimensions::Dim2d { width: 481, height: 128, array_layers: 1, })); assert_eq!(dims.mipmap_dimensions(6), Some(ImageDimensions::Dim2d { width: 15, height: 4, array_layers: 1, })); assert_eq!(dims.mipmap_dimensions(9), Some(ImageDimensions::Dim2d { width: 1, height: 1, 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]
impl Clone for ImageDimensions
[src]fn clone(&self) -> ImageDimensions
[src]
fn clone(&self) -> ImageDimensions
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for ImageDimensions
[src]
impl Debug for ImageDimensions
[src]impl PartialEq<ImageDimensions> for ImageDimensions
[src]
impl PartialEq<ImageDimensions> for ImageDimensions
[src]fn eq(&self, other: &ImageDimensions) -> bool
[src]
fn eq(&self, other: &ImageDimensions) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &ImageDimensions) -> bool
[src]
fn ne(&self, other: &ImageDimensions) -> bool
[src]This method tests for !=
.
impl Copy for ImageDimensions
[src]
impl Eq for ImageDimensions
[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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]Builds a pointer to this type from a raw pointer.
pub fn is_size_suitable(usize) -> bool
[src]
pub fn is_size_suitable(usize) -> bool
[src]Returns true if the size is suitable to store a type like this.
pub fn indiv_size() -> usize
[src]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more