| 92 | this.outputPath = this.splitPath(this.inputPath).directory; |
| 93 | } |
| 94 | compress(buffer, width, height) { |
| 95 | let writer = new ColorCellOut; |
| 96 | if (this.quality !== undefined) |
| 97 | writer.begin(0, 0, width, height, { quality:this.quality / 100 }); |
| 98 | else |
| 99 | writer.begin(0, 0, width, height); |
| 100 | let from = 0; |
| 101 | for (let y = 0; y < height; y += 4) { |
| 102 | let to = from + (8 * width); |
| 103 | writer.send(buffer.slice(from, to)); |
| 104 | from = to; |
| 105 | } |
| 106 | writer.end(); |
| 107 | return writer.bitmap.buffer; |
| 108 | } |
| 109 | copy0(block, pixels, width, height) { |
| 110 | var buffer = new Uint16Array(block.buffer); |
| 111 | let v = 0; |