MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / constructor

Method constructor

modules/commodetto/commodettoBMPOut.js:35–48  ·  view source on GitHub ↗
(dictionary)

Source from the content-addressed store, hash-verified

33
34export 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

Callers

nothing calls this directly

Calls 1

depthMethod · 0.45

Tested by

no test coverage detected