pub struct RowPtrCache { /* private fields */ }Expand description
Row pointer cache that pre-computes pointers for O(1) row access.
Port of C++ agg::row_ptr_cache<int8u>.
Implementations§
Source§impl RowPtrCache
impl RowPtrCache
Sourcepub unsafe fn new_with_buf(
buf: *mut u8,
width: u32,
height: u32,
stride: i32,
) -> Self
pub unsafe fn new_with_buf( buf: *mut u8, width: u32, height: u32, stride: i32, ) -> Self
Create and attach to a buffer.
§Safety
buf must point to a valid buffer of at least height * stride.abs() bytes.
The buffer must remain valid for the lifetime of this cache.
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn stride(&self) -> i32
pub fn stride_abs(&self) -> u32
Sourcepub fn row_slice_mut(&mut self, y: u32) -> &mut [u8] ⓘ
pub fn row_slice_mut(&mut self, y: u32) -> &mut [u8] ⓘ
Get a safe mutable slice for row y.
Sourcepub fn copy_from<T: RenderingBufferAccess>(&mut self, src: &T)
pub fn copy_from<T: RenderingBufferAccess>(&mut self, src: &T)
Copy pixel data from another buffer.
Trait Implementations§
Source§impl Default for RowPtrCache
impl Default for RowPtrCache
Auto Trait Implementations§
impl Freeze for RowPtrCache
impl RefUnwindSafe for RowPtrCache
impl !Send for RowPtrCache
impl !Sync for RowPtrCache
impl Unpin for RowPtrCache
impl UnsafeUnpin for RowPtrCache
impl UnwindSafe for RowPtrCache
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