gb-image-decoder 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +20 -13
- package/dist/index.mjs +20 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -384,19 +384,26 @@ class Decoder {
|
|
|
384
384
|
for (let x = 0; x < TILE_PIXEL_WIDTH; x += 1) {
|
|
385
385
|
for (let y = 0; y < TILE_PIXEL_HEIGHT; y += 1) {
|
|
386
386
|
const rawIndex = (pixelXOffset + x + (pixelYOffset + y) * this.tilesPerLine * TILE_PIXEL_WIDTH) * 4;
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
387
|
+
if (pixels !== null) {
|
|
388
|
+
const color = getRGBValue({
|
|
389
|
+
pixels,
|
|
390
|
+
index: y * TILE_PIXEL_WIDTH + x,
|
|
391
|
+
tileIndex: index,
|
|
392
|
+
handleExportFrame: ExportFrameMode.FRAMEMODE_KEEP,
|
|
393
|
+
invertPalette: this.invertPalette,
|
|
394
|
+
lockFrame: this.lockFrame,
|
|
395
|
+
colorData: this.colorData
|
|
396
|
+
});
|
|
397
|
+
this.rawImageData[rawIndex] = color.r;
|
|
398
|
+
this.rawImageData[rawIndex + 1] = color.g;
|
|
399
|
+
this.rawImageData[rawIndex + 2] = color.b;
|
|
400
|
+
this.rawImageData[rawIndex + 3] = 255;
|
|
401
|
+
} else {
|
|
402
|
+
this.rawImageData[rawIndex] = 0;
|
|
403
|
+
this.rawImageData[rawIndex + 1] = 0;
|
|
404
|
+
this.rawImageData[rawIndex + 2] = 0;
|
|
405
|
+
this.rawImageData[rawIndex + 3] = 0;
|
|
406
|
+
}
|
|
400
407
|
}
|
|
401
408
|
}
|
|
402
409
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -382,19 +382,26 @@ class Decoder {
|
|
|
382
382
|
for (let x = 0; x < TILE_PIXEL_WIDTH; x += 1) {
|
|
383
383
|
for (let y = 0; y < TILE_PIXEL_HEIGHT; y += 1) {
|
|
384
384
|
const rawIndex = (pixelXOffset + x + (pixelYOffset + y) * this.tilesPerLine * TILE_PIXEL_WIDTH) * 4;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
385
|
+
if (pixels !== null) {
|
|
386
|
+
const color = getRGBValue({
|
|
387
|
+
pixels,
|
|
388
|
+
index: y * TILE_PIXEL_WIDTH + x,
|
|
389
|
+
tileIndex: index,
|
|
390
|
+
handleExportFrame: ExportFrameMode.FRAMEMODE_KEEP,
|
|
391
|
+
invertPalette: this.invertPalette,
|
|
392
|
+
lockFrame: this.lockFrame,
|
|
393
|
+
colorData: this.colorData
|
|
394
|
+
});
|
|
395
|
+
this.rawImageData[rawIndex] = color.r;
|
|
396
|
+
this.rawImageData[rawIndex + 1] = color.g;
|
|
397
|
+
this.rawImageData[rawIndex + 2] = color.b;
|
|
398
|
+
this.rawImageData[rawIndex + 3] = 255;
|
|
399
|
+
} else {
|
|
400
|
+
this.rawImageData[rawIndex] = 0;
|
|
401
|
+
this.rawImageData[rawIndex + 1] = 0;
|
|
402
|
+
this.rawImageData[rawIndex + 2] = 0;
|
|
403
|
+
this.rawImageData[rawIndex + 3] = 0;
|
|
404
|
+
}
|
|
398
405
|
}
|
|
399
406
|
}
|
|
400
407
|
}
|