1use ::{Raster,RasterMut};
4
5pub const FLI_BLACK: u16 = 13;
10
11pub fn decode_fli_black(dst: &mut RasterMut) {
13 let start = dst.stride * dst.y;
14 let end = dst.stride * (dst.y + dst.h);
15 for row in dst.buf[start..end].chunks_mut(dst.stride) {
16 let start = dst.x;
17 let end = start + dst.w;
18 for e in &mut row[start..end] {
19 *e = 0;
20 }
21 }
22}
23
24pub fn can_encode_fli_black(next: &Raster) -> bool {
26 let start = next.stride * next.y;
27 let end = next.stride * (next.y + next.h);
28 next.buf[start..end].chunks(next.stride)
29 .all(|row| row.iter().all(|&e| e == 0))
30}