pub struct PlaneMatrices<T, const N: usize> { /* private fields */ }Expand description
An array of byte matrices.
This type is optimized for the concrete layout type of matrix planes.
§Examples
use image_texel::image::Image;
use image_texel::layout::{PlaneMatrices, Matrix};
use image_texel::texels::U8;
// Imagine a JPEG with progressive DCT coefficient planes.
let rough = Matrix::from_width_height(U8, 8, 8).unwrap();
let dense = Matrix::from_width_height(U8, 64, 64).unwrap();
// The assembled layout can be used to access the disjoint planes.
let matrices = PlaneMatrices::new(U8, [rough, dense]);
let rough = matrices.plane_ref(0).unwrap();
let dense = matrices.plane_ref(1).unwrap();
let buffer = Image::new(&matrices);
let rough_coeffs = &buffer.as_buf()[rough.texel_range()];
assert_eq!(rough_coeffs.len(), 8 * 8);
let dense_coeffs = &buffer.as_buf()[dense.texel_range()];
assert_eq!(dense_coeffs.len(), 64 * 64);
// The coefficient planes are disjoint and well-ordered.
assert!(rough_coeffs.as_ptr_range().end <= dense_coeffs.as_ptr());Implementations§
Source§impl<T, const N: usize> PlaneMatrices<T, N>
impl<T, const N: usize> PlaneMatrices<T, N>
Trait Implementations§
Source§impl<T: Clone, const N: usize> Clone for PlaneMatrices<T, N>
impl<T: Clone, const N: usize> Clone for PlaneMatrices<T, N>
Source§fn clone(&self) -> PlaneMatrices<T, N>
fn clone(&self) -> PlaneMatrices<T, N>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const N: usize> Decay<PlaneMatrices<T, N>> for PlaneBytes<N>
impl<T, const N: usize> Decay<PlaneMatrices<T, N>> for PlaneBytes<N>
fn decay(from: PlaneMatrices<T, N>) -> PlaneBytes<N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for PlaneMatrices<T, N>
impl<T, const N: usize> RefUnwindSafe for PlaneMatrices<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for PlaneMatrices<T, N>where
T: Send,
impl<T, const N: usize> Sync for PlaneMatrices<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for PlaneMatrices<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for PlaneMatrices<T, N>
impl<T, const N: usize> UnwindSafe for PlaneMatrices<T, N>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more