Trait luminance_front::texture::Dimensionable
source · [−]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
Class of Texture
dimensions.
This trait provides a simple mapping between the implementor and the Dim
type, which represents a Texture
dimension. This allows to heavily type Texture
so that their dimension is indexed-tracked in the type-system.
This trait is then used to reify the implementors into Dim
so that the runtime can work with them.
Associated Types
Associated Constants
const ZERO_OFFSET: Self::Offset
const ZERO_OFFSET: Self::Offset
Zero offset.
Any size added with ZERO_OFFSET
must remain the size itself.
Required methods
Width of the associated Dimensionable::Size
.
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.