gb-image-decoder 0.1.5 → 0.1.7

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 CHANGED
@@ -54,6 +54,7 @@ const blendModeNewName = (oldName) => {
54
54
 
55
55
  const BLACK = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
56
56
  const WHITE = "00000000000000000000000000000000";
57
+ const SKIP_LINE = "skip";
57
58
  const TILE_PIXEL_WIDTH = 8;
58
59
  const TILE_PIXEL_HEIGHT = 8;
59
60
  const TILES_PER_LINE = 20;
@@ -365,6 +366,9 @@ class Decoder {
365
366
  return changedTiles;
366
367
  }
367
368
  renderTile(tileIndex, rawLine) {
369
+ if (rawLine === SKIP_LINE) {
370
+ return;
371
+ }
368
372
  const tile = decodeTile(rawLine);
369
373
  this.paintTile(tile, tileIndex);
370
374
  }
@@ -615,6 +619,7 @@ exports.BlendMode = BlendMode;
615
619
  exports.Decoder = Decoder;
616
620
  exports.ExportFrameMode = ExportFrameMode;
617
621
  exports.RGBNDecoder = RGBNDecoder;
622
+ exports.SKIP_LINE = SKIP_LINE;
618
623
  exports.blendModeNewName = blendModeNewName;
619
624
  exports.decodeTile = decodeTile;
620
625
  exports.getRGBValue = getRGBValue;
package/dist/index.d.cts CHANGED
@@ -135,6 +135,7 @@ declare const tileIndexIsPartOfFrame: (tileIndex: number, handleExportFrame?: Ex
135
135
 
136
136
  declare const maxTiles: (rgbnTiles: RGBNTiles) => number;
137
137
 
138
+ declare const SKIP_LINE = "skip";
138
139
  declare const BW_PALETTE: number[];
139
140
 
140
- export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
141
+ export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, SKIP_LINE, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
package/dist/index.d.mts CHANGED
@@ -135,6 +135,7 @@ declare const tileIndexIsPartOfFrame: (tileIndex: number, handleExportFrame?: Ex
135
135
 
136
136
  declare const maxTiles: (rgbnTiles: RGBNTiles) => number;
137
137
 
138
+ declare const SKIP_LINE = "skip";
138
139
  declare const BW_PALETTE: number[];
139
140
 
140
- export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
141
+ export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, SKIP_LINE, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
package/dist/index.d.ts CHANGED
@@ -135,6 +135,7 @@ declare const tileIndexIsPartOfFrame: (tileIndex: number, handleExportFrame?: Ex
135
135
 
136
136
  declare const maxTiles: (rgbnTiles: RGBNTiles) => number;
137
137
 
138
+ declare const SKIP_LINE = "skip";
138
139
  declare const BW_PALETTE: number[];
139
140
 
140
- export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
141
+ export { type BWPalette, BW_PALETTE, BlendMode, type ChangedTile, type Channel, type Channels, Decoder, ExportFrameMode, type IndexedTilePixels, RGBNDecoder, type RGBNPalette, type RGBNTiles, type RGBValue, SKIP_LINE, type ScaledCanvasSize, type SourceCanvases, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
package/dist/index.mjs CHANGED
@@ -52,6 +52,7 @@ const blendModeNewName = (oldName) => {
52
52
 
53
53
  const BLACK = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
54
54
  const WHITE = "00000000000000000000000000000000";
55
+ const SKIP_LINE = "skip";
55
56
  const TILE_PIXEL_WIDTH = 8;
56
57
  const TILE_PIXEL_HEIGHT = 8;
57
58
  const TILES_PER_LINE = 20;
@@ -363,6 +364,9 @@ class Decoder {
363
364
  return changedTiles;
364
365
  }
365
366
  renderTile(tileIndex, rawLine) {
367
+ if (rawLine === SKIP_LINE) {
368
+ return;
369
+ }
366
370
  const tile = decodeTile(rawLine);
367
371
  this.paintTile(tile, tileIndex);
368
372
  }
@@ -608,4 +612,4 @@ class RGBNDecoder {
608
612
 
609
613
  const maxTiles = (rgbnTiles) => Math.max(...channels.map((key) => rgbnTiles[key]?.length || 0));
610
614
 
611
- export { BW_PALETTE, BlendMode, Decoder, ExportFrameMode, RGBNDecoder, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
615
+ export { BW_PALETTE, BlendMode, Decoder, ExportFrameMode, RGBNDecoder, SKIP_LINE, blendModeNewName, decodeTile, getRGBValue, maxTiles, tileIndexIsPartOfFrame };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gb-image-decoder",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Decoder classes for GameBoy-encoded images",
5
5
  "repository": "",
6
6
  "license": "MIT",