Set which pixels are more important (and more likely to get a palette entry) The map must be `width`×`height` pixels large. Higher numbers = more important.
(&mut self, map: impl Into<Box<[u8]>>)
| 175 | /// |
| 176 | /// The map must be `width`×`height` pixels large. Higher numbers = more important. |
| 177 | pub fn set_importance_map(&mut self, map: impl Into<Box<[u8]>>) -> Result<(), Error> { |
| 178 | let map = map.into(); |
| 179 | if map.len() != self.width() * self.height() { |
| 180 | return Err(BufferTooSmall); |
| 181 | } |
| 182 | self.importance_map = Some(map); |
| 183 | Ok(()) |
| 184 | } |
| 185 | |
| 186 | /// Remap pixels assuming they will be displayed on this background. This is designed for GIF's "keep" mode. |
| 187 | /// |