[−][src]Trait luminance::texture::Dimensionable
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).
Associated Constants
const ZERO_OFFSET: Self::Offset
Zero offset.
Required methods
fn dim() -> Dim
Dimension.
fn width(size: Self::Size) -> u32
Width of the associated Dimensionable::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.
Provided methods
fn height(_: Self::Size) -> u32
Height of the associated Dimensionable::Size
. If it doesn’t have one, set it to 1.
fn depth(_: Self::Size) -> u32
Depth of the associated Dimensionable::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.