Struct image2::Data[][src]

pub struct Data<'a, T: 'a + Type, C: 'a + Color>(_, _);
Expand description

Wraps image data slices, tagging them with a Color type

Implementations

impl<'a, T: Type, C: Color> Data<'a, T, C>[src]

pub fn len(&self) -> usize[src]

Number of elements

pub fn is_empty(&self) -> bool[src]

Returns true when the inner slice is empty

pub fn num_pixels(&self) -> usize[src]

Get the number of pixels available

pub fn channels(&self) -> usize[src]

Get the number of channels

pub fn meta(&self) -> Meta<T, C>[src]

Get information about data

pub fn to_pixel(&self) -> Pixel<C>[src]

Convert to pixel

pub fn as_slice(&self) -> &[T][src]

Get inner slice

Trait Implementations

impl<'a, T: Type, C: Color> AsRef<[T]> for Data<'a, T, C>[src]

fn as_ref(&self) -> &[T][src]

Performs the conversion.

impl<'a, T: Clone + 'a + Type, C: Clone + 'a + Color> Clone for Data<'a, T, C>[src]

fn clone(&self) -> Data<'a, T, C>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a, T: Debug + 'a + Type, C: Debug + 'a + Color> Debug for Data<'a, T, C>[src]

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

Formats the value using the given formatter. Read more

impl<'a, T: Type, C: Color> Index<usize> for Data<'a, T, C>[src]

type Output = T

The returned type after indexing.

fn index(&self, i: usize) -> &T[src]

Performs the indexing (container[index]) operation. Read more

impl<'a, T: 'a + Type, C: 'a + Color> IntoIterator for Data<'a, T, C>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Iter<'a, T>[src]

Creates an iterator from a value. Read more

impl<'a, T: PartialEq + 'a + Type, C: PartialEq + 'a + Color> PartialEq<Data<'a, T, C>> for Data<'a, T, C>[src]

fn eq(&self, other: &Data<'a, T, C>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Data<'a, T, C>) -> bool[src]

This method tests for !=.

impl<'a, T: PartialOrd + 'a + Type, C: PartialOrd + 'a + Color> PartialOrd<Data<'a, T, C>> for Data<'a, T, C>[src]

fn partial_cmp(&self, other: &Data<'a, T, C>) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<'a, T: Copy + 'a + Type, C: Copy + 'a + Color> Copy for Data<'a, T, C>[src]

impl<'a, T: 'a + Type, C: 'a + Color> StructuralPartialEq for Data<'a, T, C>[src]

Auto Trait Implementations

impl<'a, T, C> RefUnwindSafe for Data<'a, T, C> where
    C: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, C> Send for Data<'a, T, C>

impl<'a, T, C> Sync for Data<'a, T, C>

impl<'a, T, C> Unpin for Data<'a, T, C>

impl<'a, T, C> UnwindSafe for Data<'a, T, C> where
    C: UnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.