Struct rasterize::ImageRef

source ·
pub struct ImageRef<'a, P> { /* private fields */ }
Expand description

Reference to an image or another reference

Implementations§

source§

impl<'a, P> ImageRef<'a, P>

source

pub fn new(shape: Shape, data: &'a [P]) -> Self

Trait Implementations§

source§

impl<'a, P: Clone> Clone for ImageRef<'a, P>

source§

fn clone(&self) -> ImageRef<'a, P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, P> Debug for ImageRef<'a, P>

source§

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

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

impl<'a, P> Image for ImageRef<'a, P>

§

type Pixel = P

Pixel type
source§

fn shape(&self) -> Shape

Shape of the image
source§

fn data(&self) -> &[Self::Pixel]

Data containing image
source§

fn size(&self) -> Size

Image size
source§

fn width(&self) -> usize

Image width
source§

fn height(&self) -> usize

Image height
source§

fn get(&self, row: usize, col: usize) -> Option<&Self::Pixel>

Get pixel at the specified row and column
source§

fn view( &self, row_min: usize, row_max: usize, col_min: usize, col_max: usize ) -> ImageRef<'_, Self::Pixel>

Create sub-image bounded by constraints, _max values are not inclusive.
source§

fn as_ref(&self) -> ImageRef<'_, Self::Pixel>

Create immutable view to the image of the concrete type of ImageRef
source§

fn iter(&self) -> ImageIter<'_, Self::Pixel>

Iterate over pixels

Auto Trait Implementations§

§

impl<'a, P> Freeze for ImageRef<'a, P>

§

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

§

impl<'a, P> Send for ImageRef<'a, P>
where P: Sync,

§

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

§

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

§

impl<'a, P> UnwindSafe for ImageRef<'a, P>
where P: RefUnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.