(x, y, width, height)
| 47 | throw new Error("requires Gray16 pixels"); |
| 48 | } |
| 49 | begin(x, y, width, height) { |
| 50 | // buffer for expanded scanline |
| 51 | width = (width + 1) & ~1; |
| 52 | this.scan = new Uint8Array(width); |
| 53 | |
| 54 | // buffer to hold worst-case encoded image |
| 55 | this.output = new Uint8Array(width * (height + (height >> 2))); |
| 56 | this.output.position = 0; |
| 57 | this.output.firstNybble = true; |
| 58 | } |
| 59 | send(pixels, offsetIn = 0, count = pixels.byteLength - offsetIn) { |
| 60 | let width = this.width; |
| 61 | let halfWidth = (width + 1) >> 1; |