Struct image2::DataMut[][src]

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

Wraps mutable image data slices, tagging them with a Color type

Implementations

impl<'a, T: Type, C: Color> DataMut<'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 availible

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

Get the number of channels

pub fn copy_from_slice(&mut self, slice: impl AsRef<[T]>)[src]

Copy values from slice

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

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

Get mutable inner slice

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

Downcast to Data type

Trait Implementations

impl<'a, T: Type, C: Color> AsMut<[T]> for DataMut<'a, T, C>[src]

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

Performs the conversion.

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

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

Performs the conversion.

impl<'a, T: Debug + 'a + Type, C: Debug + 'a + Color> Debug for DataMut<'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 DataMut<'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: Type, C: Color> IndexMut<usize> for DataMut<'a, T, C>[src]

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

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

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

type Item = &'a mut T

The type of the elements being iterated over.

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

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

Creates an iterator from a value. Read more

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

fn eq(&self, other: &DataMut<'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: &DataMut<'a, T, C>) -> bool[src]

This method tests for !=.

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

fn partial_cmp(&self, other: &DataMut<'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: 'a + Type, C: 'a + Color> StructuralPartialEq for DataMut<'a, T, C>[src]

Auto Trait Implementations

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

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

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

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

impl<'a, T, C> !UnwindSafe for DataMut<'a, T, C>

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, 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.