pub fn new(
        image: &'b dyn Image,
        labels: &'a [ColorLabel],
        window_size: u32,
    ) -> WindowHistogramIterator<'a, 'b> {
        let mut histogram: Vec<Bin> = Vec::new();
        histogram.resize(image.width() as usize, Default::default());
        for y in 0..window_size {
            for x in 0..image.width() {
                let p = image.pixel(x, y);
                add_pixel(x as usize, &p, labels, &mut histogram);
            }
        }

        WindowHistogramIterator {
            image,
            histogram,
            y: 0,
            labels,
            window_size,
        }
    }
/// Construct a new sliding window histogram iterator, this creates the initial histogram state.
Construct a new sliding window histogram iterator, this creates the initial histogram state.
Construct a new sliding window histogram iterator this creates the initial histogram state .
pub fn new(
        image: &'b dyn Image,
        labels: &'a [ColorLabel],
        window_size: u32,
    ) -> WindowHistogramIterator<'a, 'b> {
        let mut histogram: Vec<Bin> = Vec::new();
        histogram.resize(image.width() as usize, Default::default());
        for y in 0..window_size {
            for x in 0..image.width() {
                let p = image.pixel(x, y);
                add_pixel(x as usize, &p, labels, &mut histogram);
            }
        }
        WindowHistogramIterator {
            image,
            histogram,
            y: 0,
            labels,
            window_size,
        }
    }
pub fn new ( image : & ' b dyn Image , labels : & ' a [ ColorLabel ] , window_size : u32 , ) -> WindowHistogramIterator < ' a , ' b > { let mut histogram : Vec < Bin > = Vec :: new ( ) ; histogram . resize ( image . width ( ) as usize , Default :: default ( ) ) ; for y in 0 .. window_size { for x in 0 .. image . width ( ) { let p = image . pixel ( x , y ) ; add_pixel ( x as usize , & p , labels , & mut histogram ) ; } } WindowHistogramIterator { image , histogram , y : 0 , labels , window_size , } }
Construct a new sliding window histogram iterator, this creates the initial histogram state.
Construct a new sliding window histogram iterator this creates the initial histogram state .
image
&'b dyn Image
labels
&'a [ColorLabel]
window_size
u32