We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 302601a commit ef433f3Copy full SHA for ef433f3
src/mediancut.rs
@@ -300,8 +300,7 @@ impl<'hist> MedianCutter<'hist> {
300
self.boxes.iter().enumerate()
301
.filter(|(_, mbox)| mbox.colors.len() > 1)
302
.map(move |(i, mbox)| {
303
- let cv = mbox.variance.r.max(mbox.variance.g).max(mbox.variance.b);
304
- let mut thissum = mbox.adjusted_weight_sum * f64::from(cv.max(mbox.variance.a));
+ let mut thissum = mbox.adjusted_weight_sum * mbox.variance.iter().map(|f| f as f64).sum::<f64>();
305
if f64::from(mbox.max_error) > max_mse {
306
thissum = thissum * f64::from(mbox.max_error) / max_mse;
307
}
0 commit comments