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

Method constructor

tools/png2bmp.js:486–504  ·  view source on GitHub ↗
(dictionary)

Source from the content-addressed store, hash-verified

484
485class 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

Callers

nothing calls this directly

Calls 1

depthMethod · 0.45

Tested by

no test coverage detected