Struct imgproc_rs::image::PixelIter[][src]

pub struct PixelIter<'a, T: Number> { /* fields omitted */ }

A struct representing a pixel iterator for an image. next() returns a tuple containing the x-coordinate, y-coordinate, and a slice representing the pixel at that coordinate, in that order.

Examples

use imgproc_rs::image::{Image, BaseImage};

// Create an image
let img = Image::from_vec(2, 2, 3, false, vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);

// Print pixels with corresponding coordinates using the pixel iterator
for vals in img.into_iter() {
    print!("(x: {}, y: {}), pixel: (", vals.0, vals.1);

    for i in 0..(img.info().channels as usize) {
        print!("{}, ", vals.2[i]);
    }

    print!(")");
    println!();
}

Implementations

impl<'a, T: Number> PixelIter<'a, T>[src]

pub fn new(image: &'a Image<T>) -> Self[src]

Trait Implementations

impl<'a, T: Clone + Number> Clone for PixelIter<'a, T>[src]

impl<'a, T: Debug + Number> Debug for PixelIter<'a, T>[src]

impl<'a, T: Number> Iterator for PixelIter<'a, T>[src]

type Item = (u32, u32, &'a [T])

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for PixelIter<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for PixelIter<'a, T>

impl<'a, T> Sync for PixelIter<'a, T>

impl<'a, T> Unpin for PixelIter<'a, T>

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

Blanket Implementations

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

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

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

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Pointable for T

type Init = T

The type for initializers.

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.