[][src]Enum nvtt_rs::TextureLayout

pub enum TextureLayout {
    D2 {
        width: usize,
        height: usize,
    },
    D3 {
        width: usize,
        height: usize,
        depth: usize,
    },
    Array {
        width: usize,
        height: usize,
        array_length: usize,
    },
    Cube {
        face_width: usize,
        face_height: usize,
    },
}

Describes the layout of the input texture data.

Variants

D2

The texture is a standard 2D image with a width and a height.

Fields of D2

width: usize

The with of the texture in pixels.

height: usize

The height of the texture in pixels.

D3

The texture is a 3D texture, with a width, height and depth.

Fields of D3

width: usize

The with of the texture in pixels.

height: usize

The height of the texture in pixels.

depth: usize

The depth of the texture in pixels.

Array

The texture is an array of 2D textures.

Fields of Array

width: usize

The width of each texture in pixels.

height: usize

The height of each texture in pixels.

array_length: usize

The total number of textures in the array.

Cube

The texture is a cube texture comprised of 6 2D textures for each face of the cube.

Fields of Cube

face_width: usize

The width of each face of the cube texture in pixels.

face_height: usize

The height of each face of the cube texture in pixels.

Implementations

impl TextureLayout[src]

pub const fn d2(width: usize, height: usize) -> Self[src]

Construct a new TextureLayout::D2 from the given width and height.

pub const fn d3(width: usize, height: usize, depth: usize) -> Self[src]

Construct a new TextureLayout::D3 from the given width, height and depth.

pub const fn array(width: usize, height: usize, array_length: usize) -> Self[src]

Construct a new TextureLayout::Array from the given width, height and array_length.

pub const fn cube(face_width: usize, face_height: usize) -> Self[src]

Construct a new TextureLayout::Cube from the given face_width and face_height.

pub fn texture_type(&self) -> TextureType[src]

Get the TextureType corresponding to this TextureLayout.

Trait Implementations

impl Clone for TextureLayout[src]

impl Copy for TextureLayout[src]

impl Debug for TextureLayout[src]

impl Eq for TextureLayout[src]

impl Hash for TextureLayout[src]

impl PartialEq<TextureLayout> for TextureLayout[src]

impl StructuralEq for TextureLayout[src]

impl StructuralPartialEq for TextureLayout[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.