func p6Enc(b []byte) []byte { // i := 4 * clz _, _, w, h := dec(b[0:i]) cl := p6Codelen(w, h) p := make([]byte, cl) p6txt(w, 50) p6txt(h, 55) j := t6 copy(p[0:j], p6t) if w == 0 || h == 0 { return p } if underX { xker.P6Encode(w, h, b[i:], p[j:]) } else { di, dj := int(colourdepth), col.P6 for y := uint(0); y < h; y++ { for x := uint(0); x < w; x++ { col.P6Encode(b[i:i+di], p[j:j+dj]) i += di j += dj } } } return p }
func P6Encode(w, h uint, b, p []byte) { // i, j := uint(0), uint(0) di := uint(clz) for y := uint(0); y < h; y++ { for x := uint(0); x < w; x++ { col.P6Encode(b[i:i+di], p[j:j+col.P6]) i += di j += col.P6 } } }