Struct ImageRefMut

Source
pub struct ImageRefMut<'a, FMT: PixelFormat> { /* private fields */ }
Expand description

A view of mutable image to have pixel format FMT.

Implementations§

Source§

impl<'a, FMT: PixelFormat> ImageRefMut<'a, FMT>

Source

pub fn new( width: u32, height: u32, stride: usize, buf: &'a mut [u8], ) -> Option<Self>

Use a &mut [u8] slice as the backing store for an ImageRefMut.

Returns None if the buffer is not large enough to store an image of the desired properties.

Trait Implementations§

Source§

impl<F: PixelFormat> Debug for ImageRefMut<'_, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<FMT: PixelFormat> ImageData<FMT> for ImageRefMut<'_, FMT>

Source§

fn width(&self) -> u32

Number of pixel columns in the image. Note: this is not the stride.
Source§

fn height(&self) -> u32

Number of pixel rows in the image.
Source§

fn buffer_ref(&self) -> ImageBufferRef<'_, FMT>

Returns the image buffer specified by pixel format F. Read more
Source§

fn buffer(self) -> ImageBuffer<FMT>

Returns the image buffer specified by pixel format F. Read more
Source§

fn image_data(&self) -> &[u8]

Returns the raw image data as specified by pixel format F. Read more
Source§

impl<FMT: PixelFormat> ImageMutData<FMT> for ImageRefMut<'_, FMT>

Source§

fn buffer_mut_ref(&mut self) -> ImageBufferMutRef<'_, FMT>

Returns the image mutable buffer specified by pixel format F. Read more
Source§

impl<FMT: PixelFormat> Stride for ImageRefMut<'_, FMT>

Source§

fn stride(&self) -> usize

the width (in bytes) of each row of image data Read more

Auto Trait Implementations§

§

impl<'a, FMT> Freeze for ImageRefMut<'a, FMT>

§

impl<'a, FMT> RefUnwindSafe for ImageRefMut<'a, FMT>
where FMT: RefUnwindSafe,

§

impl<'a, FMT> Send for ImageRefMut<'a, FMT>
where FMT: Send,

§

impl<'a, FMT> Sync for ImageRefMut<'a, FMT>
where FMT: Sync,

§

impl<'a, FMT> Unpin for ImageRefMut<'a, FMT>
where FMT: Unpin,

§

impl<'a, FMT> !UnwindSafe for ImageRefMut<'a, FMT>

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<S, F> AsImageData<F> for S
where S: ImageData<F>,

Source§

fn as_image_data(&self) -> &dyn ImageData<F>

Source§

impl<S, F> AsImageMutStride<F> for S
where S: ImageMutStride<F>,

Source§

impl<S, F> AsImageStride<F> for S
where S: ImageStride<F>,

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<S, F> HasRowChunksExact<F> for S
where S: ImageStride<F>, F: PixelFormat,

Source§

impl<S, F> HasRowChunksExactMut<F> for S
where S: ImageMutStride<F>, F: PixelFormat,

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.
Source§

impl<S, F> ImageMutStride<F> for S
where S: ImageMutData<F> + Stride,

Source§

impl<S, F> ImageStride<F> for S
where S: ImageData<F> + Stride,