Struct fast_image_resize::Image
source · pub struct Image<'a> { /* private fields */ }Expand description
Simple container of image data.
Implementations§
source§impl<'a> Image<'a>
impl<'a> Image<'a>
sourcepub fn new(width: NonZeroU32, height: NonZeroU32, pixel_type: PixelType) -> Self
pub fn new(width: NonZeroU32, height: NonZeroU32, pixel_type: PixelType) -> Self
Create empty image with given dimensions and pixel type.
pub fn from_vec_u8( width: NonZeroU32, height: NonZeroU32, buffer: Vec<u8>, pixel_type: PixelType ) -> Result<Self, ImageBufferError>
pub fn from_slice_u8( width: NonZeroU32, height: NonZeroU32, buffer: &'a mut [u8], pixel_type: PixelType ) -> Result<Self, ImageBufferError>
pub fn pixel_type(&self) -> PixelType
pub fn width(&self) -> NonZeroU32
pub fn height(&self) -> NonZeroU32
sourcepub fn buffer_mut(&mut self) -> &mut [u8] ⓘ
pub fn buffer_mut(&mut self) -> &mut [u8] ⓘ
Mutable buffer with image pixels.
pub fn into_vec(self) -> Vec<u8>
pub fn view(&self) -> DynamicImageView<'_>
pub fn view_mut(&mut self) -> DynamicImageViewMut<'_>
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Image<'a>
impl<'a> Send for Image<'a>
impl<'a> Sync for Image<'a>
impl<'a> Unpin for Image<'a>
impl<'a> !UnwindSafe for Image<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more