(hist: &HistogramInternal, max_colors: PalLen)
| 455 | |
| 456 | #[cold] |
| 457 | fn palette_from_histogram(hist: &HistogramInternal, max_colors: PalLen) -> (PalF, Option<f64>) { |
| 458 | let mut hist_pal = PalF::new(); |
| 459 | for item in hist.items.iter() { |
| 460 | hist_pal.push(item.color, PalPop::new(item.perceptual_weight)); |
| 461 | } |
| 462 | |
| 463 | (hist_pal.with_fixed_colors(max_colors, &hist.fixed_colors), Some(0.)) |
| 464 | } |
| 465 | |
| 466 | pub(crate) fn quality_to_mse(quality: u8) -> f64 { |
| 467 | if quality == 0 { |
no test coverage detected