pub struct RowAccessor { /* private fields */ }Expand description
Row accessor that computes row pointers via base + y * stride.
Port of C++ agg::row_accessor<int8u>.
Implementations§
Source§impl RowAccessor
impl RowAccessor
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 accessor.
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(&self, y: u32) -> &[u8] ⓘ
pub fn row_slice(&self, y: u32) -> &[u8] ⓘ
Get a safe immutable slice for row y.
Returns the full row of stride_abs() bytes.
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 (min of both dimensions).
Trait Implementations§
Source§impl Default for RowAccessor
impl Default for RowAccessor
Auto Trait Implementations§
impl Freeze for RowAccessor
impl RefUnwindSafe for RowAccessor
impl !Send for RowAccessor
impl !Sync for RowAccessor
impl Unpin for RowAccessor
impl UnsafeUnpin for RowAccessor
impl UnwindSafe for RowAccessor
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