Struct tiny_skia::pixmap::SubPixmapMut
source · pub struct SubPixmapMut<'a> {
pub data: &'a mut [u8],
pub size: IntSize,
pub real_width: usize,
}
Expand description
A PixmapMut
subregion.
Unlike PixmapMut
, contains real_width
which references the parent PixmapMut
width.
This way we can operate on a PixmapMut
subregion without reallocations.
Primarily required because of DrawTiler
.
We cannot implement it in PixmapMut
directly, because it will brake fill
, data_mut
pixels_mut
and other similar methods.
This is because SubPixmapMut.data
references more “data” than it actually allowed to access.
On the other hand, PixmapMut.data
can access all it’s data and it’s stored linearly.
Fields§
§data: &'a mut [u8]
§size: IntSize
§real_width: usize
Implementations§
source§impl<'a> SubPixmapMut<'a>
impl<'a> SubPixmapMut<'a>
pub(crate) fn offset(&self, dx: usize, dy: usize) -> usize
pub(crate) fn slice_at_xy( &mut self, dx: usize, dy: usize, ) -> &mut [PremultipliedColorU8]
pub(crate) fn slice_mask_at_xy(&mut self, dx: usize, dy: usize) -> &mut [u8] ⓘ
pub(crate) fn slice4_at_xy( &mut self, dx: usize, dy: usize, ) -> &mut [PremultipliedColorU8; 8]
pub(crate) fn slice16_at_xy( &mut self, dx: usize, dy: usize, ) -> &mut [PremultipliedColorU8; 16]
pub(crate) fn slice16_mask_at_xy( &mut self, dx: usize, dy: usize, ) -> &mut [u8; 16]
source§impl<'a> SubPixmapMut<'a>
impl<'a> SubPixmapMut<'a>
sourcepub fn pixels_mut(&mut self) -> &mut [PremultipliedColorU8]
pub fn pixels_mut(&mut self) -> &mut [PremultipliedColorU8]
Returns a mutable slice of pixels.
Auto Trait Implementations§
impl<'a> Freeze for SubPixmapMut<'a>
impl<'a> RefUnwindSafe for SubPixmapMut<'a>
impl<'a> Send for SubPixmapMut<'a>
impl<'a> Sync for SubPixmapMut<'a>
impl<'a> Unpin for SubPixmapMut<'a>
impl<'a> !UnwindSafe for SubPixmapMut<'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