(w, name)
| 91 | |
| 92 | // write a layer chunk (visible) — produces a 6-byte chunk header + body |
| 93 | function writeLayerChunk(w, name) { |
| 94 | const sizeOffset = w.length; |
| 95 | w.u32(0); // chunk size — patched |
| 96 | w.u16(0x2004); // chunk type: layer |
| 97 | w.u16(1); // flags: visible |
| 98 | w.u16(0); // type: normal |
| 99 | w.u16(0); // child level |
| 100 | w.u16(0); // default width |
| 101 | w.u16(0); // default height |
| 102 | w.u16(0); // blend mode (normal) |
| 103 | w.u8(255); // opacity |
| 104 | w.zeros(3); |
| 105 | w.str(name); |
| 106 | const end = w.length; |
| 107 | patchU32WriterPart(w, sizeOffset, end - sizeOffset); |
| 108 | } |
| 109 | |
| 110 | // write a raw-image cel chunk at (x,y) on `layer`. The `rgbaPixels` name is |
| 111 | // historical — for non-RGBA color depths the caller passes the raw per-pixel |
no test coverage detected