Struct voladdress::VolGrid2dStrided
source · #[repr(transparent)]pub struct VolGrid2dStrided<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> { /* private fields */ }
Expand description
Models having many “frames” of VolGrid2d
within a chunk of memory.
Each frame may or may not overlap, according to the stride specified.
- If the byte stride per frame is less than the byte size of a frame, the frames will have some amount of overlap.
- If the stride bytes equals the frame bytes, then each frame will directly follow the previous one.
- If the stride bytes exceeds the frame bytes, then there will be some amount of gap between frames.
Generic Parameters
T
/R
/W
: These parameters are applied to theVolAddress
type returned when accessing the block in any way (indexing, iteration, etc).WIDTH
/HEIGHT
: the width and height of a given frame.FRAMES
: the number of frames.BYTE_STRIDE
: The number of bytes between the start of each frame.
Safety
- This type stores a base
VolAddress
internally, and so you must follow all of those safety rules. Notably, the base address must never be zero. - The address space must legally contain
WIDTH * HEIGHT * FRAMES
contiguous values of theT
type, starting from the base address. - The memory block must not wrap around past the end of the address space.
Implementations§
source§impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
sourcepub const unsafe fn new(address: usize) -> Self
pub const unsafe fn new(address: usize) -> Self
A VolAddress
with multi-frame access pattern.
Safety
The given address must be a valid for WIDTH * HEIGHT
elements per frame,
at frame indexes 0..FRAMES
, with all non-zero frame indexes being offset
by BYTE_STRIDE
bytes from the previous frame.
Trait Implementations§
source§impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Clone for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T, R, W, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Clone for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§impl<T: Hash, R: Hash, W: Hash, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Hash for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: Hash, R: Hash, W: Hash, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Hash for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§impl<T: Ord, R: Ord, W: Ord, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Ord for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: Ord, R: Ord, W: Ord, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> Ord for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn cmp(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> Ordering
fn cmp( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<T: PartialEq, R: PartialEq, W: PartialEq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialEq<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: PartialEq, R: PartialEq, W: PartialEq, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialEq<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn eq(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> bool
fn eq( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialOrd<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
impl<T: PartialOrd, R: PartialOrd, W: PartialOrd, const WIDTH: usize, const HEIGHT: usize, const FRAMES: usize, const BYTE_STRIDE: usize> PartialOrd<VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>> for VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
source§fn partial_cmp(
&self,
other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE>
) -> Option<Ordering>
fn partial_cmp( &self, other: &VolGrid2dStrided<T, R, W, WIDTH, HEIGHT, FRAMES, BYTE_STRIDE> ) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more