raw = $this->nbcol > 0 ? str_split($this->datas, $this->nbcol) : []; $this->raw = array_slice($this->raw, 0, $this->nbligne); $maskMap = str_repeat("\0", 256); $maskMap[$this->vide] = "\xFF"; $map[$this->vide] = "\0"; $this->rows = []; $this->masks = []; foreach ($this->raw as $row) { $this->rows[] = strtr($row, Mac::IDENT, $map); $this->masks[] = strtr($row, Mac::IDENT, $maskMap); } } /** One row through another palette map (transparent pixels = 0). */ public function rowWith(int $y, string $map): string { $map[$this->vide] = "\0"; return strtr($this->raw[$y], Mac::IDENT, $map); } }