[][src]Trait luminance::texture::Dimensionable

pub trait Dimensionable {
    type Size: Copy;
    type Offset: Copy;

    pub const ZERO_OFFSET: Self::Offset;

    pub fn dim() -> Dim;
pub fn width(size: Self::Size) -> u32;
pub fn x_offset(offset: Self::Offset) -> u32;
pub fn count(size: Self::Size) -> usize; pub fn height(_: Self::Size) -> u32 { ... }
pub fn depth(_: Self::Size) -> u32 { ... }
pub fn y_offset(_: Self::Offset) -> u32 { ... }
pub fn z_offset(_: Self::Offset) -> u32 { ... } }

Reify a type into a Dim.

Associated Types

type Size: Copy[src]

Size type of a dimension (used to caracterize dimensions’ areas).

type Offset: Copy[src]

Offset type of a dimension (used to caracterize addition and subtraction of sizes, mostly).

Loading content...

Associated Constants

pub const ZERO_OFFSET: Self::Offset[src]

Zero offset.

Loading content...

Required methods

pub fn dim() -> Dim[src]

Dimension.

pub fn width(size: Self::Size) -> u32[src]

Width of the associated Dimensionable::Size.

pub fn x_offset(offset: Self::Offset) -> u32[src]

X offset.

pub fn count(size: Self::Size) -> usize[src]

Amount of pixels this size represents.

For 2D sizes, it represents the area; for 3D sizes, the volume; etc. For cubemaps, it represents the side length of the cube.

Loading content...

Provided methods

pub fn height(_: Self::Size) -> u32[src]

Height of the associated Dimensionable::Size. If it doesn’t have one, set it to 1.

pub fn depth(_: Self::Size) -> u32[src]

Depth of the associated Dimensionable::Size. If it doesn’t have one, set it to 1.

pub fn y_offset(_: Self::Offset) -> u32[src]

Y offset. If it doesn’t have one, set it to 0.

pub fn z_offset(_: Self::Offset) -> u32[src]

Z offset. If it doesn’t have one, set it to 0.

Loading content...

Implementors

impl Dimensionable for Cubemap[src]

type Offset = ([u32; 2], CubeFace)

type Size = u32

impl Dimensionable for Dim1[src]

type Offset = u32

type Size = u32

impl Dimensionable for Dim1Array[src]

type Offset = (u32, u32)

type Size = (u32, u32)

impl Dimensionable for Dim2[src]

type Offset = [u32; 2]

type Size = [u32; 2]

impl Dimensionable for Dim2Array[src]

type Offset = ([u32; 2], u32)

type Size = ([u32; 2], u32)

impl Dimensionable for Dim3[src]

type Offset = [u32; 3]

type Size = [u32; 3]

Loading content...