Skip to main content

ImageAccessorClip

Struct ImageAccessorClip 

Source
pub struct ImageAccessorClip<'a, const PIX_WIDTH: usize> { /* private fields */ }
Expand description

Image accessor with clipping: returns a background color for out-of-bounds pixels.

Port of C++ image_accessor_clip<PixFmt>.

Implementations§

Source§

impl<'a, const PIX_WIDTH: usize> ImageAccessorClip<'a, PIX_WIDTH>

Source

pub fn new(rbuf: &'a RowAccessor, bk_color: &[u8]) -> Self

Source

pub fn set_background(&mut self, bk_color: &[u8])

Source

pub fn span(&mut self, x: i32, y: i32, len: u32) -> &[u8]

Source

pub fn next_x(&mut self) -> &[u8]

Source

pub fn next_y(&mut self) -> &[u8]

Trait Implementations§

Source§

impl<const PIX_WIDTH: usize> ImageSource for ImageAccessorClip<'_, PIX_WIDTH>

Source§

fn span(&mut self, x: i32, y: i32, len: u32) -> &[u8]

Begin reading a span at (x, y) with len pixels. Returns first pixel.
Source§

fn next_x(&mut self) -> &[u8]

Advance to the next pixel in the x direction.
Source§

fn next_y(&mut self) -> &[u8]

Advance to the next row (y+1), resetting x to the span start.

Auto Trait Implementations§

§

impl<'a, const PIX_WIDTH: usize> Freeze for ImageAccessorClip<'a, PIX_WIDTH>

§

impl<'a, const PIX_WIDTH: usize> RefUnwindSafe for ImageAccessorClip<'a, PIX_WIDTH>

§

impl<'a, const PIX_WIDTH: usize> !Send for ImageAccessorClip<'a, PIX_WIDTH>

§

impl<'a, const PIX_WIDTH: usize> !Sync for ImageAccessorClip<'a, PIX_WIDTH>

§

impl<'a, const PIX_WIDTH: usize> Unpin for ImageAccessorClip<'a, PIX_WIDTH>

§

impl<'a, const PIX_WIDTH: usize> UnwindSafe for ImageAccessorClip<'a, PIX_WIDTH>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.