@4bitlabs/sci0 4.0.1 → 5.0.1

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.
Files changed (197) hide show
  1. package/README.md +14 -27
  2. package/dist/index.d.ts +18 -29
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +38 -46
  5. package/dist/index.js.map +1 -1
  6. package/dist/models/draw-codes.d.ts +6 -0
  7. package/dist/models/draw-codes.d.ts.map +1 -0
  8. package/dist/{screen/render-result.js → models/draw-codes.js} +1 -1
  9. package/dist/models/draw-codes.js.map +1 -0
  10. package/dist/models/draw-command.d.ts +1 -56
  11. package/dist/models/draw-command.d.ts.map +1 -1
  12. package/dist/models/draw-command.js +0 -18
  13. package/dist/models/draw-command.js.map +1 -1
  14. package/dist/models/draw-commands.d.ts +47 -0
  15. package/dist/models/draw-commands.d.ts.map +1 -0
  16. package/dist/models/draw-commands.js +3 -0
  17. package/dist/models/draw-commands.js.map +1 -0
  18. package/dist/models/draw-mode.d.ts +21 -0
  19. package/dist/models/draw-mode.d.ts.map +1 -0
  20. package/dist/models/draw-mode.js +26 -0
  21. package/dist/models/draw-mode.js.map +1 -0
  22. package/dist/models/pattern-code.d.ts +6 -0
  23. package/dist/models/pattern-code.d.ts.map +1 -0
  24. package/dist/models/pattern-code.js +3 -0
  25. package/dist/models/pattern-code.js.map +1 -0
  26. package/dist/models/pic.d.ts +10 -0
  27. package/dist/models/pic.d.ts.map +1 -0
  28. package/dist/{screen/screen.js → models/pic.js} +1 -1
  29. package/dist/models/pic.js.map +1 -0
  30. package/dist/models/resource-header.d.ts +4 -0
  31. package/dist/models/resource-header.d.ts.map +1 -1
  32. package/dist/models/resource-id.d.ts +4 -8
  33. package/dist/models/resource-id.d.ts.map +1 -1
  34. package/dist/models/resource-id.js +21 -48
  35. package/dist/models/resource-id.js.map +1 -1
  36. package/dist/models/resource-type.d.ts +1 -22
  37. package/dist/models/resource-type.d.ts.map +1 -1
  38. package/dist/models/resource-type.js +0 -23
  39. package/dist/models/resource-type.js.map +1 -1
  40. package/dist/models/resource-types.d.ts +11 -0
  41. package/dist/models/resource-types.d.ts.map +1 -0
  42. package/dist/models/resource-types.js +14 -0
  43. package/dist/models/resource-types.js.map +1 -0
  44. package/dist/parsers/compression.d.ts +25 -1
  45. package/dist/parsers/compression.d.ts.map +1 -1
  46. package/dist/parsers/compression.js +33 -9
  47. package/dist/parsers/compression.js.map +1 -1
  48. package/dist/parsers/mapping.d.ts +2 -2
  49. package/dist/parsers/mapping.d.ts.map +1 -1
  50. package/dist/parsers/mapping.js +19 -29
  51. package/dist/parsers/mapping.js.map +1 -1
  52. package/dist/parsers/{cel.d.ts → parse-cel.d.ts} +1 -1
  53. package/dist/parsers/parse-cel.d.ts.map +1 -0
  54. package/dist/parsers/{cel.js → parse-cel.js} +1 -1
  55. package/dist/parsers/parse-cel.js.map +1 -0
  56. package/dist/parsers/parse-cursor-options.d.ts +9 -0
  57. package/dist/parsers/parse-cursor-options.d.ts.map +1 -0
  58. package/dist/parsers/parse-cursor-options.js +3 -0
  59. package/dist/parsers/parse-cursor-options.js.map +1 -0
  60. package/dist/parsers/parse-cursor.d.ts +4 -0
  61. package/dist/parsers/parse-cursor.d.ts.map +1 -0
  62. package/dist/parsers/{cursor.js → parse-cursor.js} +4 -4
  63. package/dist/parsers/parse-cursor.js.map +1 -0
  64. package/dist/parsers/parse-font-options.d.ts +5 -0
  65. package/dist/parsers/parse-font-options.d.ts.map +1 -0
  66. package/dist/parsers/parse-font-options.js +3 -0
  67. package/dist/parsers/parse-font-options.js.map +1 -0
  68. package/dist/parsers/parse-font.d.ts +4 -0
  69. package/dist/parsers/parse-font.d.ts.map +1 -0
  70. package/dist/parsers/{font.js → parse-font.js} +4 -4
  71. package/dist/parsers/parse-font.js.map +1 -0
  72. package/dist/parsers/parse-pic.d.ts +20 -0
  73. package/dist/parsers/parse-pic.d.ts.map +1 -0
  74. package/dist/parsers/parse-pic.js +33 -0
  75. package/dist/parsers/parse-pic.js.map +1 -0
  76. package/dist/parsers/parse-view.d.ts +3 -0
  77. package/dist/parsers/parse-view.d.ts.map +1 -0
  78. package/dist/parsers/{view.js → parse-view.js} +6 -6
  79. package/dist/parsers/parse-view.js.map +1 -0
  80. package/dist/parsers/pic/handlers.d.ts +1 -6
  81. package/dist/parsers/pic/handlers.d.ts.map +1 -1
  82. package/dist/parsers/pic/handlers.js +60 -47
  83. package/dist/parsers/pic/handlers.js.map +1 -1
  84. package/dist/parsers/pic/op-codes.d.ts.map +1 -1
  85. package/dist/parsers/pic/pic-state.d.ts +3 -1
  86. package/dist/parsers/pic/pic-state.d.ts.map +1 -1
  87. package/dist/parsers/pic/pic-state.js +2 -2
  88. package/dist/parsers/pic/pic-state.js.map +1 -1
  89. package/dist/parsers/pic/points.d.ts +4 -4
  90. package/dist/parsers/pic/points.d.ts.map +1 -1
  91. package/dist/parsers/pic/points.js +3 -4
  92. package/dist/parsers/pic/points.js.map +1 -1
  93. package/dist/parsers/resource-header.d.ts +2 -2
  94. package/dist/parsers/resource-header.d.ts.map +1 -1
  95. package/dist/parsers/resource-header.js +18 -9
  96. package/dist/parsers/resource-header.js.map +1 -1
  97. package/dist/utils/exhaustive.js +1 -2
  98. package/dist/utils/exhaustive.js.map +1 -1
  99. package/dist/utils/repeat.d.ts.map +1 -1
  100. package/package.json +6 -7
  101. package/dist/models/vec2.d.ts +0 -8
  102. package/dist/models/vec2.d.ts.map +0 -1
  103. package/dist/models/vec2.js +0 -22
  104. package/dist/models/vec2.js.map +0 -1
  105. package/dist/parsers/cel.d.ts.map +0 -1
  106. package/dist/parsers/cel.js.map +0 -1
  107. package/dist/parsers/cursor.d.ts +0 -13
  108. package/dist/parsers/cursor.d.ts.map +0 -1
  109. package/dist/parsers/cursor.js.map +0 -1
  110. package/dist/parsers/font.d.ts +0 -7
  111. package/dist/parsers/font.d.ts.map +0 -1
  112. package/dist/parsers/font.js.map +0 -1
  113. package/dist/parsers/pic/index.d.ts +0 -2
  114. package/dist/parsers/pic/index.d.ts.map +0 -1
  115. package/dist/parsers/pic/index.js +0 -6
  116. package/dist/parsers/pic/index.js.map +0 -1
  117. package/dist/parsers/pic/parser.d.ts +0 -3
  118. package/dist/parsers/pic/parser.d.ts.map +0 -1
  119. package/dist/parsers/pic/parser.js +0 -31
  120. package/dist/parsers/pic/parser.js.map +0 -1
  121. package/dist/parsers/view.d.ts +0 -3
  122. package/dist/parsers/view.d.ts.map +0 -1
  123. package/dist/parsers/view.js.map +0 -1
  124. package/dist/screen/circles.d.ts +0 -3
  125. package/dist/screen/circles.d.ts.map +0 -1
  126. package/dist/screen/circles.js +0 -87
  127. package/dist/screen/circles.js.map +0 -1
  128. package/dist/screen/default-palette.d.ts +0 -2
  129. package/dist/screen/default-palette.d.ts.map +0 -1
  130. package/dist/screen/default-palette.js +0 -11
  131. package/dist/screen/default-palette.js.map +0 -1
  132. package/dist/screen/index.d.ts +0 -3
  133. package/dist/screen/index.d.ts.map +0 -1
  134. package/dist/screen/index.js +0 -9
  135. package/dist/screen/index.js.map +0 -1
  136. package/dist/screen/loop-padding-filter.d.ts +0 -5
  137. package/dist/screen/loop-padding-filter.d.ts.map +0 -1
  138. package/dist/screen/loop-padding-filter.js +0 -34
  139. package/dist/screen/loop-padding-filter.js.map +0 -1
  140. package/dist/screen/noise.d.ts +0 -3
  141. package/dist/screen/noise.d.ts.map +0 -1
  142. package/dist/screen/noise.js +0 -24
  143. package/dist/screen/noise.js.map +0 -1
  144. package/dist/screen/render-pic.d.ts +0 -11
  145. package/dist/screen/render-pic.d.ts.map +0 -1
  146. package/dist/screen/render-pic.js +0 -79
  147. package/dist/screen/render-pic.js.map +0 -1
  148. package/dist/screen/render-result.d.ts +0 -8
  149. package/dist/screen/render-result.d.ts.map +0 -1
  150. package/dist/screen/render-result.js.map +0 -1
  151. package/dist/screen/sci0-screen-impl.d.ts +0 -7
  152. package/dist/screen/sci0-screen-impl.d.ts.map +0 -1
  153. package/dist/screen/sci0-screen-impl.js +0 -163
  154. package/dist/screen/sci0-screen-impl.js.map +0 -1
  155. package/dist/screen/screen-buffer.d.ts +0 -6
  156. package/dist/screen/screen-buffer.d.ts.map +0 -1
  157. package/dist/screen/screen-buffer.js +0 -70
  158. package/dist/screen/screen-buffer.js.map +0 -1
  159. package/dist/screen/screen.d.ts +0 -17
  160. package/dist/screen/screen.d.ts.map +0 -1
  161. package/dist/screen/screen.js.map +0 -1
  162. package/dist/screen/tools/circles.d.ts +0 -3
  163. package/dist/screen/tools/circles.d.ts.map +0 -1
  164. package/dist/screen/tools/circles.js +0 -87
  165. package/dist/screen/tools/circles.js.map +0 -1
  166. package/dist/screen/tools/create-blitter.d.ts +0 -5
  167. package/dist/screen/tools/create-blitter.d.ts.map +0 -1
  168. package/dist/screen/tools/create-blitter.js +0 -22
  169. package/dist/screen/tools/create-blitter.js.map +0 -1
  170. package/dist/screen/tools/create-brush.d.ts +0 -3
  171. package/dist/screen/tools/create-brush.d.ts.map +0 -1
  172. package/dist/screen/tools/create-brush.js +0 -37
  173. package/dist/screen/tools/create-brush.js.map +0 -1
  174. package/dist/screen/tools/create-flood-fill.d.ts +0 -3
  175. package/dist/screen/tools/create-flood-fill.d.ts.map +0 -1
  176. package/dist/screen/tools/create-flood-fill.js +0 -63
  177. package/dist/screen/tools/create-flood-fill.js.map +0 -1
  178. package/dist/screen/tools/create-line.d.ts +0 -3
  179. package/dist/screen/tools/create-line.d.ts.map +0 -1
  180. package/dist/screen/tools/create-line.js +0 -46
  181. package/dist/screen/tools/create-line.js.map +0 -1
  182. package/dist/screen/tools/create-marker.d.ts +0 -3
  183. package/dist/screen/tools/create-marker.d.ts.map +0 -1
  184. package/dist/screen/tools/create-marker.js +0 -11
  185. package/dist/screen/tools/create-marker.js.map +0 -1
  186. package/dist/screen/tools/index.d.ts +0 -6
  187. package/dist/screen/tools/index.d.ts.map +0 -1
  188. package/dist/screen/tools/index.js +0 -14
  189. package/dist/screen/tools/index.js.map +0 -1
  190. package/dist/screen/tools/noise.d.ts +0 -3
  191. package/dist/screen/tools/noise.d.ts.map +0 -1
  192. package/dist/screen/tools/noise.js +0 -24
  193. package/dist/screen/tools/noise.js.map +0 -1
  194. package/dist/utils/tbuffer-helpers.d.ts +0 -5
  195. package/dist/utils/tbuffer-helpers.d.ts.map +0 -1
  196. package/dist/utils/tbuffer-helpers.js +0 -11
  197. package/dist/utils/tbuffer-helpers.js.map +0 -1
@@ -1,13 +0,0 @@
1
- import { type Cursor } from '../models/cursor';
2
- type ColorMapping = {
3
- black: number;
4
- gray: number;
5
- white: number;
6
- keyColor: number;
7
- };
8
- export interface ParseCursorOptions {
9
- mapping?: ColorMapping;
10
- }
11
- export declare const parseFrom: (source: Uint8Array, options?: ParseCursorOptions) => Cursor;
12
- export {};
13
- //# sourceMappingURL=cursor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/parsers/cursor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AASF,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,SAAS,WACZ,UAAU,YACT,kBAAkB,KAC1B,MAsCF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/parsers/cursor.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AAUzD,MAAM,eAAe,GAAiB;IACpC,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,IAAI;CACf,CAAC;AAMK,MAAM,SAAS,GAAG,CACvB,MAAkB,EAClB,UAA8B,EAAE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,CAAC,CAAC,GAAG,CAAC,CAAC;YAChC,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAC3B,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO;QACL,GAAG,GAAG;QACN,OAAO;KACR,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,SAAS,aAyCpB"}
@@ -1,7 +0,0 @@
1
- import { FontFace } from '../models/font-face';
2
- export interface ParseFontOptions {
3
- color?: number;
4
- keyColor?: number;
5
- }
6
- export declare const parseFrom: (source: Uint8Array, options?: ParseFontOptions) => FontFace;
7
- //# sourceMappingURL=font.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../../src/parsers/font.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,SAAS,WACZ,UAAU,YACT,gBAAgB,KACxB,QAqCF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"font.js","sourceRoot":"","sources":["../../src/parsers/font.ts"],"names":[],"mappings":";;;AAAA,2CAAgF;AAEhF,4CAAyC;AAOlC,MAAM,SAAS,GAAG,CACvB,MAAkB,EAClB,UAA4B,EAAE,EACpB,EAAE;IACZ,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACrE,MAAM,KAAK,GAAG,UAAU,CAAC,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CAAC,CAAC,GAAG,CAAC,CAAC;gBACpD,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;YACvD,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,SAAS,aAwCpB"}
@@ -1,2 +0,0 @@
1
- export { parseFrom } from './parser';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parsers/pic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseFrom = void 0;
4
- var parser_1 = require("./parser");
5
- Object.defineProperty(exports, "parseFrom", { enumerable: true, get: function () { return parser_1.parseFrom; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parsers/pic/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAA5B,mGAAA,SAAS,OAAA"}
@@ -1,3 +0,0 @@
1
- import { DrawCommand } from '../../models/draw-command';
2
- export declare const parseFrom: (data: Uint8Array) => DrawCommand[];
3
- //# sourceMappingURL=parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/parsers/pic/parser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,eAAO,MAAM,SAAS,SAAU,UAAU,KAAG,WAAW,EAyBvD,CAAC"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseFrom = void 0;
4
- const readers_1 = require("@4bitlabs/readers");
5
- const handlers_1 = require("./handlers");
6
- const op_codes_1 = require("./op-codes");
7
- const pic_state_1 = require("./pic-state");
8
- const parseFrom = (data) => {
9
- const commands = [];
10
- const ctx = {
11
- r: (0, readers_1.createBitReader)(data, { mode: 'msb' }),
12
- state: (0, pic_state_1.createPicState)(),
13
- push(...next) {
14
- commands.push(...next);
15
- },
16
- };
17
- while (true) {
18
- const op = ctx.r.read32(8);
19
- if (!(0, op_codes_1.isOpCode)(op))
20
- throw new Error(`Unrecognized opcode: 0x${op.toString(16)}`);
21
- if (op === op_codes_1.OpCode.Done)
22
- break;
23
- const handler = handlers_1.CodeHandlers[op];
24
- if (!handler)
25
- throw new Error(`Unhandled opcode: 0x${op.toString(16)}`);
26
- handler(ctx);
27
- }
28
- return commands;
29
- };
30
- exports.parseFrom = parseFrom;
31
- //# sourceMappingURL=parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/parsers/pic/parser.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AACpD,yCAA8D;AAC9D,yCAA8C;AAC9C,2CAA6C;AAGtC,MAAM,SAAS,GAAG,CAAC,IAAgB,EAAiB,EAAE;IAC3D,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,GAAG,GAAuB;QAC9B,CAAC,EAAE,IAAA,yBAAe,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QACzC,KAAK,EAAE,IAAA,0BAAc,GAAE;QACvB,IAAI,CAAC,GAAG,IAAmB;YACzB,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;IAEF,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAE3B,IAAI,CAAC,IAAA,mBAAQ,EAAC,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,0BAA0B,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAE/D,IAAI,EAAE,KAAK,iBAAM,CAAC,IAAI;YAAE,MAAM;QAE9B,MAAM,OAAO,GAAG,uBAAY,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAExE,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAzBW,QAAA,SAAS,aAyBpB"}
@@ -1,3 +0,0 @@
1
- import { type View } from '../models/view';
2
- export declare const parseFrom: (source: Uint8Array) => View;
3
- //# sourceMappingURL=view.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/parsers/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAa,MAAM,gBAAgB,CAAC;AAItD,eAAO,MAAM,SAAS,WAAY,UAAU,SAyD3C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../src/parsers/view.ts"],"names":[],"mappings":";;;AACA,+BAAiC;AACjC,4CAAyC;AAElC,MAAM,SAAS,GAAG,CAAC,MAAkB,EAAQ,EAAE;IACpD,MAAM,IAAI,GAAG,IAAI,QAAQ,CACvB,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,UAAU,CAClB,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAEzC,OAAO,IAAA,eAAM,EAA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AAG,EAAE,CAAC;gBAC1B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,GAAG,KAAK,GAAG,EAAE,CAAC;gBAChC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;aACjB,CAAC;QACJ,CAAC,EACD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CACb,CAAC;QAEF,OAAO;YACL,MAAM;YACN,UAAU;YACV,MAAM,EAAE;gBACN,IAAI;gBACJ,GAAG;gBACH,KAAK;gBACL,MAAM;gBACN,KAAK,EAAE,KAAK,GAAG,IAAI;gBACnB,MAAM,EAAE,MAAM,GAAG,GAAG;aACrB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAzDW,QAAA,SAAS,aAyDpB"}
@@ -1,3 +0,0 @@
1
- declare const circleBitmaps: number[][];
2
- export default circleBitmaps;
3
- //# sourceMappingURL=circles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"circles.d.ts","sourceRoot":"","sources":["../../src/screen/circles.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,aAAa,EAAE,MAAM,EAAE,EAoF5B,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // prettier-ignore
4
- const circleBitmaps = [
5
- [
6
- 0b1
7
- ],
8
- [
9
- 0b010,
10
- 0b111,
11
- 0b010,
12
- ],
13
- [
14
- 0b01110,
15
- 0b11111,
16
- 0b11111,
17
- 0b11111,
18
- 0b01110,
19
- ],
20
- [
21
- 0b0011100,
22
- 0b0111110,
23
- 0b1111111,
24
- 0b1111111,
25
- 0b1111111,
26
- 0b0111110,
27
- 0b0011100,
28
- ],
29
- [
30
- 0b000111000,
31
- 0b011111110,
32
- 0b111111111,
33
- 0b111111111,
34
- 0b111111111,
35
- 0b111111111,
36
- 0b111111111,
37
- 0b011111110,
38
- 0b000111000,
39
- ],
40
- [
41
- 0b00001110000,
42
- 0b00111111100,
43
- 0b01111111110,
44
- 0b01111111110,
45
- 0b11111111111,
46
- 0b11111111111,
47
- 0b11111111111,
48
- 0b01111111110,
49
- 0b01111111110,
50
- 0b00111111100,
51
- 0b00011111000,
52
- ],
53
- [
54
- 0b0000111110000,
55
- 0b0011111111100,
56
- 0b0111111111110,
57
- 0b0111111111110,
58
- 0b1111111111111,
59
- 0b1111111111111,
60
- 0b1111111111111,
61
- 0b1111111111111,
62
- 0b1111111111111,
63
- 0b0111111111110,
64
- 0b0111111111110,
65
- 0b0011111111100,
66
- 0b0000111110000,
67
- ],
68
- [
69
- 0b000001111100000,
70
- 0b000111111111000,
71
- 0b001111111111100,
72
- 0b011111111111110,
73
- 0b011111111111110,
74
- 0b111111111111111,
75
- 0b111111111111111,
76
- 0b111111111111111,
77
- 0b111111111111111,
78
- 0b111111111111111,
79
- 0b011111111111110,
80
- 0b011111111111110,
81
- 0b001111111111100,
82
- 0b000111111111000,
83
- 0b000001111100000,
84
- ],
85
- ];
86
- exports.default = circleBitmaps;
87
- //# sourceMappingURL=circles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"circles.js","sourceRoot":"","sources":["../../src/screen/circles.ts"],"names":[],"mappings":";;AAAA,kBAAkB;AAClB,MAAM,aAAa,GAAe;IAChC;QACE,GAAG;KACJ;IACD;QACE,KAAK;QACL,KAAK;QACL,KAAK;KACN;IAED;QACE,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;QACP,OAAO;KACR;IAED;QACE,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;QACT,SAAS;KACV;IAED;QACE,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;QACX,WAAW;KACZ;IACD;QACE,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;KACd;IACD;QACE,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;KAChB;IACD;QACE,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;QACjB,iBAAiB;KAClB;CACF,CAAC;AAEF,kBAAe,aAAa,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const DEFAULT_PALETTE: readonly [0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 136, 136, 1, 2, 3, 4, 5, 6, 136, 136, 249, 250, 251, 252, 253, 254, 255, 8, 145, 42, 59, 76, 93, 110, 136];
2
- //# sourceMappingURL=default-palette.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-palette.d.ts","sourceRoot":"","sources":["../../src/screen/default-palette.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,0LAKlB,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_PALETTE = void 0;
4
- // prettier-ignore
5
- exports.DEFAULT_PALETTE = [
6
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
7
- 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88, 0x88, 0x01, 0x02, 0x03,
8
- 0x04, 0x05, 0x06, 0x88, 0x88, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
9
- 0xfe, 0xff, 0x08, 0x91, 0x2a, 0x3b, 0x4c, 0x5d, 0x6e, 0x88,
10
- ];
11
- //# sourceMappingURL=default-palette.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-palette.js","sourceRoot":"","sources":["../../src/screen/default-palette.ts"],"names":[],"mappings":";;;AAAA,kBAAkB;AACL,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAClD,CAAC"}
@@ -1,3 +0,0 @@
1
- export { renderPic, generatePic } from './render-pic';
2
- export { loopPaddingFilter } from './loop-padding-filter';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loopPaddingFilter = exports.generatePic = exports.renderPic = void 0;
4
- var render_pic_1 = require("./render-pic");
5
- Object.defineProperty(exports, "renderPic", { enumerable: true, get: function () { return render_pic_1.renderPic; } });
6
- Object.defineProperty(exports, "generatePic", { enumerable: true, get: function () { return render_pic_1.generatePic; } });
7
- var loop_padding_filter_1 = require("./loop-padding-filter");
8
- Object.defineProperty(exports, "loopPaddingFilter", { enumerable: true, get: function () { return loop_padding_filter_1.loopPaddingFilter; } });
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/screen/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AAA7C,uGAAA,SAAS,OAAA;AAAE,yGAAA,WAAW,OAAA;AAC/B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA"}
@@ -1,5 +0,0 @@
1
- import { IndexedPixelData } from '@4bitlabs/image';
2
- import { type Loop } from '../models/view';
3
- import { type Cel } from '../models/cel';
4
- export declare const loopPaddingFilter: (loop: Loop) => (source: IndexedPixelData | Cel) => IndexedPixelData;
5
- //# sourceMappingURL=loop-padding-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loop-padding-filter.d.ts","sourceRoot":"","sources":["../../src/screen/loop-padding-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,eAAO,MAAM,iBAAiB,SAAU,IAAI,cAI1B,gBAAgB,GAAG,GAAG,KAAG,gBA+B1C,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loopPaddingFilter = void 0;
4
- const image_1 = require("@4bitlabs/image");
5
- const loopPaddingFilter = (loop) => {
6
- const { isMirrored, bounds } = loop;
7
- const { left, top, right, width: loopWidth, height: loopHeight } = bounds;
8
- return (source) => {
9
- if (!('dx' in source)) {
10
- return source;
11
- }
12
- const dest = (0, image_1.createIndexedPixelData)(loopWidth, loopHeight, {
13
- keyColor: source.keyColor,
14
- });
15
- const sStride = source.width;
16
- const dStride = dest.width;
17
- for (let ySource = 0; ySource < source.height; ySource++) {
18
- const yDest = source.dy - top - source.height + ySource;
19
- for (let xSource = 0; xSource < source.width; xSource++) {
20
- const xActual = isMirrored ? source.width - xSource - 1 : xSource;
21
- const edge = isMirrored
22
- ? +right - source.dx - (source.width & 0b1)
23
- : -left + source.dx;
24
- const xDest = xSource - (source.width >>> 1) + edge;
25
- const destIdx = yDest * dStride + xDest;
26
- const sourceIdx = ySource * sStride + xActual;
27
- dest.pixels[destIdx] = source.pixels[sourceIdx];
28
- }
29
- }
30
- return dest;
31
- };
32
- };
33
- exports.loopPaddingFilter = loopPaddingFilter;
34
- //# sourceMappingURL=loop-padding-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loop-padding-filter.js","sourceRoot":"","sources":["../../src/screen/loop-padding-filter.ts"],"names":[],"mappings":";;;AAAA,2CAA2E;AAIpE,MAAM,iBAAiB,GAAG,CAAC,IAAU,EAAE,EAAE;IAC9C,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IAE1E,OAAO,CAAC,MAA8B,EAAoB,EAAE;QAC1D,IAAI,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,GAAG,IAAA,8BAAsB,EAAC,SAAS,EAAE,UAAU,EAAE;YACzD,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;QAE3B,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;YACzD,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC;YAExD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;gBACxD,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;gBAElE,MAAM,IAAI,GAAG,UAAU;oBACrB,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC;oBAC3C,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;gBACtB,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;gBAEpD,MAAM,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;gBACxC,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;gBAC9C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC,CAAC;AAnCW,QAAA,iBAAiB,qBAmC5B"}
@@ -1,3 +0,0 @@
1
- export declare const NOISE: boolean[];
2
- export declare const NOISE_OFFSETS: number[];
3
- //# sourceMappingURL=noise.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"noise.d.ts","sourceRoot":"","sources":["../../src/screen/noise.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,EAAE,OAAO,EAI6C,CAAC;AAEzE,eAAO,MAAM,aAAa,EAAE,MAAM,EAWjC,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NOISE_OFFSETS = exports.NOISE = void 0;
4
- const BYTE = Array(8)
5
- .fill(0)
6
- .map((_, i) => i);
7
- exports.NOISE = [
8
- 0x20, 0x94, 0x02, 0x24, 0x90, 0x82, 0xa4, 0xa2, 0x82, 0x09, 0x0a, 0x22, 0x12,
9
- 0x10, 0x42, 0x14, 0x91, 0x4a, 0x91, 0x11, 0x08, 0x12, 0x25, 0x10, 0x22, 0xa8,
10
- 0x14, 0x24, 0x00, 0x50, 0x24, 0x04,
11
- ].flatMap((it) => BYTE.map((idx) => ((it >>> (7 - idx)) & 0b1) === 0b1));
12
- exports.NOISE_OFFSETS = [
13
- 0x00, 0x18, 0x30, 0xc4, 0xdc, 0x65, 0xeb, 0x48, 0x60, 0xbd, 0x89, 0x04, 0x0a,
14
- 0xf4, 0x7d, 0x6d, 0x85, 0xb0, 0x8e, 0x95, 0x1f, 0x22, 0x0d, 0xdf, 0x2a, 0x78,
15
- 0xd5, 0x73, 0x1c, 0xb4, 0x40, 0xa1, 0xb9, 0x3c, 0xca, 0x58, 0x92, 0x34, 0xcc,
16
- 0xce, 0xd7, 0x42, 0x90, 0x0f, 0x8b, 0x7f, 0x32, 0xed, 0x5c, 0x9d, 0xc8, 0x99,
17
- 0xad, 0x4e, 0x56, 0xa6, 0xf7, 0x68, 0xb7, 0x25, 0x82, 0x37, 0x3a, 0x51, 0x69,
18
- 0x26, 0x38, 0x52, 0x9e, 0x9a, 0x4f, 0xa7, 0x43, 0x10, 0x80, 0xee, 0x3d, 0x59,
19
- 0x35, 0xcf, 0x79, 0x74, 0xb5, 0xa2, 0xb1, 0x96, 0x23, 0xe0, 0xbe, 0x05, 0xf5,
20
- 0x6e, 0x19, 0xc5, 0x66, 0x49, 0xf0, 0xd1, 0x54, 0xa9, 0x70, 0x4b, 0xa4, 0xe2,
21
- 0xe6, 0xe5, 0xab, 0xe4, 0xd2, 0xaa, 0x4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"}
@@ -1,11 +0,0 @@
1
- import { DrawCommand } from '../models/draw-command';
2
- import { RenderResult } from './render-result';
3
- interface RenderOptions {
4
- forcePal?: 0 | 1 | 2 | 3 | undefined;
5
- width?: number;
6
- height?: number;
7
- }
8
- export declare function generatePic(commands: DrawCommand[], options?: RenderOptions): Generator<[number, DrawCommand, RenderResult]>;
9
- export declare const renderPic: (commands: DrawCommand[], options?: RenderOptions) => RenderResult;
10
- export {};
11
- //# sourceMappingURL=render-pic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-pic.d.ts","sourceRoot":"","sources":["../../src/screen/render-pic.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiE/C,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAiB,WAAW,CAC1B,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,GAAE,aAAkB,GAC1B,SAAS,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAahD;AAED,eAAO,MAAM,SAAS,aACV,WAAW,EAAE,YACd,aAAa,KACrB,YAaF,CAAC"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderPic = exports.generatePic = void 0;
4
- const screen_buffer_1 = require("./screen-buffer");
5
- const default_palette_1 = require("./default-palette");
6
- const exhaustive_1 = require("../utils/exhaustive");
7
- const defaultPalettes = () => [
8
- Uint8Array.from(default_palette_1.DEFAULT_PALETTE),
9
- Uint8Array.from(default_palette_1.DEFAULT_PALETTE),
10
- Uint8Array.from(default_palette_1.DEFAULT_PALETTE),
11
- Uint8Array.from(default_palette_1.DEFAULT_PALETTE),
12
- ];
13
- function picStep(cmd, { fill, line, brush, blit }, palettes) {
14
- const [mode] = cmd;
15
- switch (mode) {
16
- case 'SET_PALETTE': {
17
- const [, [idx], ...palette] = cmd;
18
- palettes[idx].set(palette);
19
- break;
20
- }
21
- case 'UPDATE_PALETTE': {
22
- const [, , ...entries] = cmd;
23
- entries.forEach(([pal, idx, color]) => {
24
- palettes[pal][idx] = color;
25
- });
26
- break;
27
- }
28
- case 'FILL': {
29
- const [, [drawMode, drawCodes], pos] = cmd;
30
- const [x, y] = pos;
31
- fill(x, y, drawMode, drawCodes);
32
- break;
33
- }
34
- case 'PLINE': {
35
- const [, [drawMode, drawCodes], ...points] = cmd;
36
- for (let p = 0; p < points.length - 1; p++)
37
- line(points[p][0], points[p][1], points[p + 1][0], points[p + 1][1], drawMode, drawCodes);
38
- break;
39
- }
40
- case 'BRUSH': {
41
- const [, brushOptions, [cx, cy]] = cmd;
42
- brush(cx, cy, ...brushOptions);
43
- break;
44
- }
45
- case 'CEL': {
46
- const [, [drawMode], [x, y], cel] = cmd;
47
- blit(x, y, drawMode, cel);
48
- break;
49
- }
50
- default:
51
- (0, exhaustive_1.exhaustive)('unhandled opcode', mode);
52
- }
53
- }
54
- function* generatePic(commands, options = {}) {
55
- const { forcePal, width = 320, height = 190 } = options;
56
- const size = [width, height];
57
- const palettes = defaultPalettes();
58
- const [result, screen, t] = (0, screen_buffer_1.createScreenBuffer)(forcePal, palettes, size);
59
- for (let i = 0; i < commands.length; i += 1) {
60
- t(i);
61
- const cmd = commands[i];
62
- picStep(cmd, screen, palettes);
63
- yield [i, cmd, result];
64
- }
65
- }
66
- exports.generatePic = generatePic;
67
- const renderPic = (commands, options = {}) => {
68
- const { forcePal, width = 320, height = 190 } = options;
69
- const size = [width, height];
70
- const palettes = defaultPalettes();
71
- const [result, screen, t] = (0, screen_buffer_1.createScreenBuffer)(forcePal, palettes, size);
72
- for (let i = 0; i < commands.length; i += 1) {
73
- t(i);
74
- picStep(commands[i], screen, palettes);
75
- }
76
- return result;
77
- };
78
- exports.renderPic = renderPic;
79
- //# sourceMappingURL=render-pic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-pic.js","sourceRoot":"","sources":["../../src/screen/render-pic.ts"],"names":[],"mappings":";;;AACA,mDAAqD;AACrD,uDAAoD;AAGpD,oDAAiD;AAIjD,MAAM,eAAe,GAAG,GAAe,EAAE,CAAC;IACxC,UAAU,CAAC,IAAI,CAAC,iCAAe,CAAC;IAChC,UAAU,CAAC,IAAI,CAAC,iCAAe,CAAC;IAChC,UAAU,CAAC,IAAI,CAAC,iCAAe,CAAC;IAChC,UAAU,CAAC,IAAI,CAAC,iCAAe,CAAC;CACjC,CAAC;AAEF,SAAS,OAAO,CACd,GAAgB,EAChB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAU,EACnC,QAA0D;IAE1D,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;IACnB,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;YAClC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC3B,MAAM;QACR,CAAC;QACD,KAAK,gBAAgB,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,EAAE,AAAD,EAAG,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;YAC7B,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACpC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YAC7B,CAAC,CAAC,CAAC;YACH,MAAM;QACR,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,CAAC,EAAE,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,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC,CAAC,CAAC;QACL,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAhBW,QAAA,SAAS,aAgBpB"}
@@ -1,8 +0,0 @@
1
- import type { IndexedPixelData } from '@4bitlabs/image';
2
- export interface RenderResult {
3
- visible: IndexedPixelData;
4
- priority: IndexedPixelData;
5
- control: IndexedPixelData;
6
- tBuffer: Uint32Array;
7
- }
8
- //# sourceMappingURL=render-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-result.d.ts","sourceRoot":"","sources":["../../src/screen/render-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,WAAW,CAAC;CACtB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-result.js","sourceRoot":"","sources":["../../src/screen/render-result.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { Plotter, Brusher, IsFillable, Filler, Liner } from './screen';
2
- import { StaticVec2 } from '../models/vec2';
3
- export declare const createLine: (plot: Plotter) => Liner;
4
- export declare const createFloodFill: (plot: Plotter, isLegal: IsFillable, [width, height]: StaticVec2) => Filler;
5
- export declare const createBrush: (plot: Plotter, [stageWidth, stageHeight]: StaticVec2) => Brusher;
6
- export declare const createMarker: (plot: Plotter) => Filler;
7
- //# sourceMappingURL=sci0-screen-impl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sci0-screen-impl.d.ts","sourceRoot":"","sources":["../../src/screen/sci0-screen-impl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,eAAO,MAAM,UAAU,SAAU,OAAO,KAAG,KAoDxC,CAAC;AAEJ,eAAO,MAAM,eAAe,SACpB,OAAO,WACJ,UAAU,kCAElB,MA2FF,CAAC;AAEF,eAAO,MAAM,WAAW,SAChB,OAAO,4CAEZ,OAmCA,CAAC;AAEJ,eAAO,MAAM,YAAY,SAAU,OAAO,KAAG,MAW1C,CAAC"}