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

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 { ... } }

Reify a type into a Dim.

Associated Types

type Size: Copy

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

type Offset: Copy

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

Loading content...

Associated Constants

const ZERO_OFFSET: Self::Offset

Zero offset.

Loading content...

Required methods

fn dim() -> Dim

Dimension.

fn width(size: Self::Size) -> u32

Width of the associated Size.

fn x_offset(offset: Self::Offset) -> u32

X offset.

fn count(size: Self::Size) -> usize

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

fn height(_: Self::Size) -> u32

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

fn depth(_: Self::Size) -> u32

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

fn y_offset(_: Self::Offset) -> u32

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

fn z_offset(_: Self::Offset) -> u32

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 Dim2[src]

type Offset = [u32; 2]

type Size = [u32; 2]

impl Dimensionable for Dim3[src]

type Offset = [u32; 3]

type Size = [u32; 3]

Loading content...