fn add_pixel(x: usize, p: &RGB, labels: &[ColorLabel], histogram: &mut [Bin]) {
    for (color, label) in labels.iter() {
        if color == p {
            histogram[x].count += 1;
            histogram[x].label = *label;
            return;
        }
    }
}
// Helper to add a row to the histogram.
Helper to add a row to the histogram.
Helper to add a row to the histogram .
fn add_pixel(x: usize, p: &RGB, labels: &[ColorLabel], histogram: &mut [Bin]) {
    for (color, label) in labels.iter() {
        if color == p {
            histogram[x].count += 1;
            histogram[x].label = *label;
            return;
        }
    }
}
fn add_pixel ( x : usize , p : & RGB , labels : & [ ColorLabel ] , histogram : & mut [ Bin ] ) { for ( color , label ) in labels . iter ( ) { if color == p { histogram [ x ] . count += 1 ; histogram [ x ] . label = * label ; return ; } } }
Helper to add a row to the histogram.
Helper to add a row to the histogram .
x
usize
p
&RGB
labels
&[ColorLabel]
histogram
&mut [Bin]