| 484 | |
| 485 | class BM4Out extends PixelsOut { |
| 486 | constructor(dictionary) { |
| 487 | super(dictionary); |
| 488 | |
| 489 | const pixelFormat = this.pixelFormat; |
| 490 | this.depth = Bitmap.depth(pixelFormat); |
| 491 | |
| 492 | if ((Bitmap.Gray16 != pixelFormat) && |
| 493 | (Bitmap.Gray256 != pixelFormat) && |
| 494 | (Bitmap.RGB565LE != pixelFormat) && |
| 495 | (Bitmap.RGB332 != pixelFormat) && |
| 496 | (Bitmap.CLUT16 != pixelFormat) && |
| 497 | (Bitmap.Monochrome != pixelFormat) && |
| 498 | (Bitmap.MonochromeAligned != pixelFormat) && |
| 499 | (Bitmap.ARGB2222 != pixelFormat) && |
| 500 | (Bitmap.Gray4 != pixelFormat)) |
| 501 | throw new Error("unsupported BM4 pixel fornat"); |
| 502 | |
| 503 | this.file = new File(dictionary.path, 1); |
| 504 | } |
| 505 | begin(/* x, y, width, height */) { |
| 506 | const file = this.file; |
| 507 | |