[−][src]Struct ffimage::packed::generic::ImageView
Image view parametrized by its pixel type
Implementations
impl<'a, T: Pixel> ImageView<'a, T>
[src]
pub fn new(raw: &'a [T::T], width: u32, height: u32) -> Option<Self>
[src]
Returns an image view with pixel accessors
The backing memory storage must have the same element type as the underlying pixel type of the image.
Arguments
raw
- Raw memory region to interpret as typed imagewidth
- Width in pixelsheight
- Height in pixels
Example
use ffimage::color::rgb::*; use ffimage::packed::generic::ImageView; let mem = vec![0; 3]; let view = ImageView::<Rgb<u8>>::new(&mem, 1, 1).expect("Memory region too small");
pub fn raw(&self) -> &[T::T]
[src]
pub fn stride(&self) -> usize
[src]
Returns the length of one pixel row in bytes
Trait Implementations
impl<'a, T: Pixel, '_> From<&'_ ImageView<'a, T>> for ImageBuffer<T>
[src]
impl<'a, T: Pixel + 'a> GenericImageView<'a> for ImageView<'a, T>
[src]
type T = T
Pixel type
fn width(&self) -> u32
[src]
fn height(&self) -> u32
[src]
fn pixel(&self, x: u32, y: u32) -> Option<Self::T>
[src]
type SubImage = SubImageView<'a, Self>
Type of sub images
fn view(
&'a self,
x: u32,
y: u32,
width: u32,
height: u32
) -> Option<Self::SubImage>
[src]
&'a self,
x: u32,
y: u32,
width: u32,
height: u32
) -> Option<Self::SubImage>
impl<'a, T: Pixel> Index<usize> for ImageView<'a, T>
[src]
type Output = [T]
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a, T: Pixel> IntoIterator for &'a ImageView<'a, T>
[src]
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = PixelIter<'a, ImageView<'a, T>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, SP, DP> TryConvert<ImageBuffer<DP>> for ImageView<'a, SP> where
SP: Pixel,
DP: Pixel,
SP: TryConvertSlice<DP>,
[src]
SP: Pixel,
DP: Pixel,
SP: TryConvertSlice<DP>,
type Error = ()
fn try_convert(&self, output: &mut ImageBuffer<DP>) -> Result<(), Self::Error>
[src]
impl<'a, 'b, SP, DP> TryConvert<ImageViewMut<'b, DP>> for ImageView<'a, SP> where
SP: Pixel,
DP: Pixel,
SP: TryConvertSlice<DP>,
[src]
SP: Pixel,
DP: Pixel,
SP: TryConvertSlice<DP>,
type Error = ()
fn try_convert(
&self,
output: &mut ImageViewMut<'b, DP>
) -> Result<(), Self::Error>
[src]
&self,
output: &mut ImageViewMut<'b, DP>
) -> Result<(), Self::Error>
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, T> RefUnwindSafe for ImageView<'a, T> where
<T as Pixel>::T: RefUnwindSafe,
<T as Pixel>::T: RefUnwindSafe,
impl<'a, T> Send for ImageView<'a, T> where
<T as Pixel>::T: Sync,
<T as Pixel>::T: Sync,
impl<'a, T> Sync for ImageView<'a, T> where
<T as Pixel>::T: Sync,
<T as Pixel>::T: Sync,
impl<'a, T> Unpin for ImageView<'a, T>
impl<'a, T> UnwindSafe for ImageView<'a, T> where
<T as Pixel>::T: RefUnwindSafe,
<T as Pixel>::T: RefUnwindSafe,
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>,