Struct fastfreeimage::FastImageView

source ·
pub struct FastImageView<'a, C, D>
where C: ChanTrait, D: 'static + Copy,
{ /* private fields */ }

Implementations§

source§

impl<'a> FastImageView<'a, Chan1, u8>

source

pub fn view<S: FastImage<D = u8, C = Chan1>>(src: &'a S) -> Self

source

pub fn view_region<S: FastImage<D = u8, C = Chan1>>( src: &'a S, roi: &FastImageRegion ) -> Result<Self>

source

pub fn view_raw( data: &'a [u8], stride: c_int, width_pixels: c_int, height_pixels: c_int ) -> Result<Self>

Trait Implementations§

source§

impl<'a, C, D> Debug for FastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

source§

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

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

impl<'a, C, D> FastImage for &FastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

Pixel data type (e.g. u8 or f32)
§

type C = C

Number of channels (e.g. Chan1)
source§

fn raw_ptr(&self) -> *const Self::D

source§

fn image_slice(&self) -> &[Self::D]

Get the raw data for the entire image, including padding.
source§

fn stride(&self) -> c_int

Get the image stride in number of bytes.
source§

fn size(&self) -> &FastImageSize

Get the image size in number of pixels.
source§

fn width(&self) -> c_int

Get the image width in number of pixels.
source§

fn height(&self) -> c_int

Get the image height in number of pixels.
source§

fn valid_row_iter( &self, size: &FastImageSize ) -> Result<ValidChunksExact<'_, Self::D>>

Iterate over elements in each image row. Returns valid slices.
source§

fn pixel_slice(&self, row: usize, col: usize) -> &[Self::D]

Get the raw data for a pixel.
source§

impl<'a, C, D> FastImage for FastImageView<'a, C, D>
where C: 'static + ChanTrait, D: 'static + Copy + Debug + PartialEq,

§

type D = D

Pixel data type (e.g. u8 or f32)
§

type C = C

Number of channels (e.g. Chan1)
source§

fn raw_ptr(&self) -> *const Self::D

source§

fn image_slice(&self) -> &[Self::D]

Get the raw data for the entire image, including padding.
source§

fn stride(&self) -> c_int

Get the image stride in number of bytes.
source§

fn size(&self) -> &FastImageSize

Get the image size in number of pixels.
source§

fn width(&self) -> c_int

Get the image width in number of pixels.
source§

fn height(&self) -> c_int

Get the image height in number of pixels.
source§

fn valid_row_iter( &self, size: &FastImageSize ) -> Result<ValidChunksExact<'_, Self::D>>

Iterate over elements in each image row. Returns valid slices.
source§

fn pixel_slice(&self, row: usize, col: usize) -> &[Self::D]

Get the raw data for a pixel.

Auto Trait Implementations§

§

impl<'a, C, D> Freeze for FastImageView<'a, C, D>

§

impl<'a, C, D> RefUnwindSafe for FastImageView<'a, C, D>

§

impl<'a, C, D> Send for FastImageView<'a, C, D>
where C: Send, D: Sync,

§

impl<'a, C, D> Sync for FastImageView<'a, C, D>
where C: Sync, D: Sync,

§

impl<'a, C, D> Unpin for FastImageView<'a, C, D>
where C: Unpin,

§

impl<'a, C, D> UnwindSafe for FastImageView<'a, C, D>

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.