| 33 | |
| 34 | export default class BMPOut extends PixelsOut { |
| 35 | constructor(dictionary) { |
| 36 | super(dictionary); |
| 37 | |
| 38 | this.depth = Bitmap.depth(dictionary.pixelFormat); |
| 39 | |
| 40 | if ((Bitmap.Gray16 != dictionary.pixelFormat) && (Bitmap.Gray256 != dictionary.pixelFormat) && (Bitmap.RGB565LE != dictionary.pixelFormat) && (Bitmap.RGB565BE != dictionary.pixelFormat) && (Bitmap.RGB332 != dictionary.pixelFormat) && (Bitmap.CLUT16 != dictionary.pixelFormat) && (Bitmap.Monochrome != dictionary.pixelFormat) && |
| 41 | (Bitmap.ARGB4444 != dictionary.pixelFormat) && (Bitmap.BGRA32 != dictionary.pixelFormat)) |
| 42 | throw new Error("unsupported BMP pixel fornat"); |
| 43 | |
| 44 | this.file = new File(dictionary.path, 1); |
| 45 | |
| 46 | if (dictionary.clut) |
| 47 | this.colors = dictionary.clut; |
| 48 | } |
| 49 | begin(x, y, width, height) { |
| 50 | let rowBytes = this.pixelsToBytes(width); |
| 51 | |