Skip to main content

Buffer

Struct Buffer 

Source
pub struct Buffer<'a, S: Sample, L: PixelLayout> { /* private fields */ }

Implementations§

Source§

impl<'a, S: Sample, L: PixelLayout> Buffer<'a, S, L>

Source

pub fn new( data: &'a mut [S], width: usize, height: usize, stride: usize, kind: BufferKind, ) -> Result<Self, BufferError>

Source

pub fn new_typed( data: &'a mut [S], width: usize, height: usize, stride: usize, ) -> Result<Self, BufferError>

Source

pub fn new_packed( data: &'a mut [S], width: usize, height: usize, kind: BufferKind, ) -> Result<Self, BufferError>

Source

pub fn new_packed_typed( data: &'a mut [S], width: usize, height: usize, ) -> Result<Self, BufferError>

Source

pub fn kind(&self) -> Result<BufferKind, BufferError>

Source

pub fn width(&self) -> usize

Source

pub fn height(&self) -> usize

Source

pub fn stride(&self) -> usize

Source

pub fn data(&self) -> &[S]

Source

pub fn data_mut(&mut self) -> &mut [S]

Source

pub fn width_bytes(&self) -> Result<usize, BufferError>

Source

pub fn try_width_bytes(&self) -> Result<usize, BufferError>

Source

pub fn required_len(&self) -> Result<usize, BufferError>

Source

pub fn validate(&self) -> Result<(), BufferError>

Source

pub fn row(&self, y: usize) -> Result<&[S], BufferError>

Source

pub fn try_row(&self, y: usize) -> Result<&[S], BufferError>

Source

pub fn row_mut(&mut self, y: usize) -> Result<&mut [S], BufferError>

Source

pub fn try_row_mut(&mut self, y: usize) -> Result<&mut [S], BufferError>

Source

pub fn pixel_offset(&self, x: usize, y: usize) -> Result<usize, BufferError>

Source

pub fn try_pixel_offset(&self, x: usize, y: usize) -> Result<usize, BufferError>

Source

pub fn pixel(&self, x: usize, y: usize) -> Result<&[S], BufferError>

Source

pub fn pixel_mut(&mut self, x: usize, y: usize) -> Result<&mut [S], BufferError>

Auto Trait Implementations§

§

impl<'a, S, L> Freeze for Buffer<'a, S, L>

§

impl<'a, S, L> RefUnwindSafe for Buffer<'a, S, L>

§

impl<'a, S, L> Send for Buffer<'a, S, L>

§

impl<'a, S, L> Sync for Buffer<'a, S, L>

§

impl<'a, S, L> Unpin for Buffer<'a, S, L>
where L: Unpin,

§

impl<'a, S, L> UnsafeUnpin for Buffer<'a, S, L>

§

impl<'a, S, L> !UnwindSafe for Buffer<'a, S, L>

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.