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

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

    const ZERO_OFFSET: Self::Offset;

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

Reify a type into a Dim.

Associated Types

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

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

Associated Constants

Zero offset.

Required methods

Dimension.

Width of the associated Dimensionable::Size.

X offset.

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.

Provided methods

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

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

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

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

Implementors