[−][src]Struct ffimage::packed::dynamic::ImageView
Image view parametrized by its pixel type
Implementations
impl<'a> ImageView<'a>
[src]
pub fn new<T: 'static>(raw: &'a [T], width: u32, height: u32) -> Option<Self>
[src]
Returns an image view with unknown pixel type
Arguments
raw
- Raw memory region to interpret as typed imagewidth
- Width in pixelsheight
- Height in pixels
Example
use ffimage::packed::dynamic::ImageView; let mem = vec![0; 12]; let view = ImageView::new(&mem, 2, 2);
pub fn with_stride<T: 'static>(
raw: &'a [T],
width: u32,
height: u32,
stride: usize
) -> Option<Self>
[src]
raw: &'a [T],
width: u32,
height: u32,
stride: usize
) -> Option<Self>
Returns an image view with unknown pixel type
Arguments
raw
- Raw memory region to interpret as typed imagewidth
- Width in pixelsheight
- Height in pixelsstride
- Length of a pixel row in bytes
Example
use ffimage::packed::dynamic::ImageView; let mem: Vec<u8> = vec![0; 12]; let view = ImageView::with_stride(&mem, 2, 2, 6) .expect("Memory region too small");
pub fn raw(&self) -> &MemoryView
[src]
Returns the raw memory
pub fn width(&self) -> u32
[src]
Returns the width in pixels
pub fn height(&self) -> u32
[src]
Returns the height in pixels
pub fn stride(&self) -> usize
[src]
Returns the length of one image row in bytes
Trait Implementations
impl<'a, '_> From<&'_ ImageView<'a>> for ImageBuffer
[src]
impl<'a, T, '_> TryFrom<&'_ ImageView<'a>> for GenericImageView<'a, T> where
T: Pixel<T = u8>,
[src]
T: Pixel<T = u8>,
Auto Trait Implementations
impl<'a> RefUnwindSafe for ImageView<'a>
impl<'a> Send for ImageView<'a>
impl<'a> Sync for ImageView<'a>
impl<'a> Unpin for ImageView<'a>
impl<'a> UnwindSafe for ImageView<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,