pub struct Tile<'a> { /* private fields */ }Expand description
An immutable strided view over a region of pixels.
Implementations§
Source§impl<'a> Tile<'a>
impl<'a> Tile<'a>
Sourcepub fn new(
region: Region,
pixel: PixelFormat,
stride: usize,
data: &'a [u8],
) -> Result<Self>
pub fn new( region: Region, pixel: PixelFormat, stride: usize, data: &'a [u8], ) -> Result<Self>
Wrap data as a tile covering region.
stride is the distance in bytes between the starts of consecutive
rows, and must be at least region.width * pixel.bytes_per_pixel().
§Errors
Returns PixelsError::InvalidArgument if stride is shorter than one
packed row, or if data is too small to cover region at stride.
Sourcepub const fn pixel(&self) -> PixelFormat
pub const fn pixel(&self) -> PixelFormat
The pixel format of the samples in this tile.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Tile<'a>
impl<'a> RefUnwindSafe for Tile<'a>
impl<'a> Send for Tile<'a>
impl<'a> Sync for Tile<'a>
impl<'a> Unpin for Tile<'a>
impl<'a> UnsafeUnpin for Tile<'a>
impl<'a> UnwindSafe for Tile<'a>
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