PixelBufferCursorExt

Trait PixelBufferCursorExt 

Source
pub trait PixelBufferCursorExt {
    // Required methods
    fn seek_to_pixel(
        &mut self,
        x: usize,
        y: usize,
        bytes_per_row: usize,
    ) -> Result<u64>;
    fn read_pixel(&mut self) -> Result<[u8; 4]>;
}
Expand description

Extension trait for io::Cursor to add pixel buffer specific operations

Required Methods§

Source

fn seek_to_pixel( &mut self, x: usize, y: usize, bytes_per_row: usize, ) -> Result<u64>

Seek to a specific pixel coordinate (x, y)

Assumes 4 bytes per pixel (BGRA format).

§Errors

Returns an I/O error if the seek operation fails.

Source

fn read_pixel(&mut self) -> Result<[u8; 4]>

Read a single pixel (4 bytes: BGRA)

§Errors

Returns an I/O error if the read operation fails.

Implementations on Foreign Types§

Source§

impl<T: AsRef<[u8]>> PixelBufferCursorExt for Cursor<T>

Source§

fn seek_to_pixel( &mut self, x: usize, y: usize, bytes_per_row: usize, ) -> Result<u64>

Source§

fn read_pixel(&mut self) -> Result<[u8; 4]>

Implementors§