pub struct ImageViewMut<'a, P>
where P: PixelExt,
{ /* private fields */ }
Expand description

Generic mutable image view.

Implementations§

source§

impl<'a, P> ImageViewMut<'a, P>
where P: PixelExt,

source

pub fn new( width: NonZeroU32, height: NonZeroU32, rows: Vec<&'a mut [P]> ) -> Result<Self, ImageRowsError>

source

pub fn from_buffer( width: NonZeroU32, height: NonZeroU32, buffer: &'a mut [u8] ) -> Result<Self, ImageBufferError>

source

pub fn from_pixels( width: NonZeroU32, height: NonZeroU32, pixels: &'a mut [P] ) -> Result<Self, ImageBufferError>

source

pub fn pixel_type(&self) -> PixelType

source

pub fn width(&self) -> NonZeroU32

source

pub fn height(&self) -> NonZeroU32

source

pub fn crop( self, left: u32, top: u32, width: NonZeroU32, height: NonZeroU32 ) -> Result<Self, CropBoxError>

Create cropped version of the view.

Trait Implementations§

source§

impl<'a, P> Debug for ImageViewMut<'a, P>
where P: PixelExt + Debug,

source§

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

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

impl<'a, P> From<ImageViewMut<'a, P>> for ImageView<'a, P>
where P: PixelExt,

source§

fn from(view: ImageViewMut<'a, P>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<[u16; 2], u16, 2>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U16x2>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<[u16; 3], u16, 3>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U16x3>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<[u16; 4], u16, 4>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U16x4>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<[u8; 3], u8, 3>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U8x3>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<[u8; 4], u8, 4>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U8x4>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<f32, f32, 1>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, F32>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<i32, i32, 1>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, I32>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<u16, u16, 1>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U16>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<u16, u8, 2>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U8x2>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<ImageViewMut<'a, Pixel<u8, u8, 1>>> for DynamicImageViewMut<'a>

source§

fn from(view: ImageViewMut<'a, U8>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, P> RefUnwindSafe for ImageViewMut<'a, P>
where P: RefUnwindSafe,

§

impl<'a, P> Send for ImageViewMut<'a, P>
where P: Send,

§

impl<'a, P> Sync for ImageViewMut<'a, P>
where P: Sync,

§

impl<'a, P> Unpin for ImageViewMut<'a, P>

§

impl<'a, P> !UnwindSafe for ImageViewMut<'a, P>

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>,

§

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>,

§

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.