@woosh/meep-engine 2.113.14 → 2.113.16
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/build/bundle-worker-image-decoder.js +1 -1
- package/build/meep.cjs +16 -2
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +16 -2
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +3 -0
- package/src/core/collection/table/RowFirstTable.d.ts +11 -3
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +57 -16
- package/src/core/color/Color.d.ts +5 -1
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +16 -2
package/build/meep.module.js
CHANGED
|
@@ -53731,7 +53731,7 @@ class Color {
|
|
|
53731
53731
|
this.b = b;
|
|
53732
53732
|
|
|
53733
53733
|
/**
|
|
53734
|
-
* Alpha channel
|
|
53734
|
+
* Alpha channel (transparency)
|
|
53735
53735
|
* Value from 0 to 1
|
|
53736
53736
|
* @type {number}
|
|
53737
53737
|
*/
|
|
@@ -54228,6 +54228,20 @@ class Color {
|
|
|
54228
54228
|
return destination;
|
|
54229
54229
|
}
|
|
54230
54230
|
|
|
54231
|
+
/**
|
|
54232
|
+
*
|
|
54233
|
+
* @param {number[]|Float32Array} source
|
|
54234
|
+
* @param {number} [offset]
|
|
54235
|
+
*/
|
|
54236
|
+
fromArray(source, offset = 0) {
|
|
54237
|
+
const r = source[offset + 0];
|
|
54238
|
+
const g = source[offset + 1];
|
|
54239
|
+
const b = source[offset + 2];
|
|
54240
|
+
const a = source[offset + 3];
|
|
54241
|
+
|
|
54242
|
+
this.set(r, g, b, a);
|
|
54243
|
+
}
|
|
54244
|
+
|
|
54231
54245
|
|
|
54232
54246
|
/**
|
|
54233
54247
|
*
|
|
@@ -54343,7 +54357,7 @@ class Color {
|
|
|
54343
54357
|
}
|
|
54344
54358
|
|
|
54345
54359
|
/**
|
|
54346
|
-
*
|
|
54360
|
+
* @deprecated use {@link Color#toArray} instead
|
|
54347
54361
|
* @readonly
|
|
54348
54362
|
*/
|
|
54349
54363
|
Color.prototype.writeToArray = Color.prototype.toArray;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryBuffer.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BinaryBuffer.js"],"names":[],"mappings":"AA6BA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"BinaryBuffer.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BinaryBuffer.js"],"names":[],"mappings":"AA6BA;;;GAGG;AACH;IAw9BI;;;;OAIG;IACH,4BAHW,UAAU,GACT,YAAY,CAUvB;IAED;;;;OAIG;IACH,0BAHW,WAAW,GACV,YAAY,CAQvB;IAED;;;;;OAKG;IACH,8BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,yBAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,0BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,2BAJW,YAAY,UACZ,YAAY,GACV,MAAM,CAQlB;IAED;;;;;OAKG;IACH,yBAJW,YAAY,UACZ,YAAY,UACZ,MAAM,cAUhB;IAlmCD;;;OAGG;IACH,YAFU,UAAU,GAAC,OAAO,CAES;IAErC;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;;OAIG;IACH,QAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,UAFU,MAAM,CAEgB;IAEhC;;;;OAIG;IACH,aAA6C;I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B;IAED;;;;OAIG;IACH,sCAgFC;IAED;;;;OAIG;IACH,yBAkEC;IAED;;;OAGG;IACH,yBAFW,MAAM,QAqBhB;IAED;;;;;OAKG;IACH,4BAJW,MAAM,oBACN,OAAO,GACL,MAAM,CAgBlB;IAiJL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CANpC;2BA9nC0B,iBAAiB"}
|
|
@@ -739,6 +739,9 @@ export class BinaryBuffer {
|
|
|
739
739
|
* @param {number} length
|
|
740
740
|
*/
|
|
741
741
|
writeUint32Array(source, source_offset, length) {
|
|
742
|
+
// prevent resizing mid-copy
|
|
743
|
+
this.ensureCapacity(this.position + 4 * length);
|
|
744
|
+
|
|
742
745
|
for (let i = 0; i < length; i++) {
|
|
743
746
|
this.writeUint32(source[source_offset + i]);
|
|
744
747
|
}
|
|
@@ -85,9 +85,9 @@ export class RowFirstTable {
|
|
|
85
85
|
trim(): void;
|
|
86
86
|
/**
|
|
87
87
|
*
|
|
88
|
-
* @param {number}
|
|
88
|
+
* @param {number} row_count
|
|
89
89
|
*/
|
|
90
|
-
resize(
|
|
90
|
+
resize(row_count: number): void;
|
|
91
91
|
/**
|
|
92
92
|
*
|
|
93
93
|
* @param {number} row_index
|
|
@@ -110,11 +110,19 @@ export class RowFirstTable {
|
|
|
110
110
|
removeRows(index: number, row_count: number): void;
|
|
111
111
|
/**
|
|
112
112
|
* Insert a number of blank rows at the given offset
|
|
113
|
-
*
|
|
113
|
+
* Table becomes larger as a result
|
|
114
|
+
* NOTE: doesn't send {@link on.added} signal
|
|
114
115
|
* @param {number} index
|
|
115
116
|
* @param {number} row_count
|
|
116
117
|
*/
|
|
117
118
|
insertRows(index: number, row_count: number): void;
|
|
119
|
+
/**
|
|
120
|
+
* Created a new row at the end of the table, does not dispatch {@link on.added} signal
|
|
121
|
+
* Values are undefined, typically it will be 0s, but if data was previously written in that memory region - that data will be retained.
|
|
122
|
+
* Make sure to clear the row or write to it before reading it
|
|
123
|
+
* @return {number} index of the created row
|
|
124
|
+
*/
|
|
125
|
+
createEmptyRow(): number;
|
|
118
126
|
/**
|
|
119
127
|
*
|
|
120
128
|
* @param {Array.<number>} values
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowFirstTable.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RowFirstTable.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/table/RowFirstTable.js"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH;IACI;;;;;OAKG;IACH,oDAHW,OAAO,EAiDjB;IAzCG;;;OAGG;IACH,wBAAgB;IAEhB;;;OAGG;IACH,MAFU,WAAW,CAE4D;IAEjF;;;OAGG;IACH,QAFU,MAAM,CAED;IAEf;;;OAGG;IACH,UAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,UAFU,QAAQ,CAEqB;IAEvC;;;OAGG;IACH,IAFU;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAOxB;IAIL;;;OAGG;IACH,8BAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;OAGG;IACH,4BAFqB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAIrD;IAED;;;OAGG;IACH,6BAFqB,QAAQ,QAAE,MAAM,QAAE,MAAM,EAAE,KAAG,IAAI,CAIrD;IAGD;;;;OAIG;IACH,uDAMC;IAED;;;OAGG;IACH,QAFa,MAAM,CA+BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAgDhB;IAED;;OAEG;IACH,aAEC;IAED;;;OAGG;IACH,kBAFW,MAAM,QAsBhB;IAED;;;;;OAKG;IACH,0BAJW,MAAM,gBACN,MAAM,SACN,MAAM,QAmBhB;IAED;;;;;OAKG;IACH,yBAJW,MAAM,gBACN,MAAM,GACJ,MAAM,CAmBlB;IAED;;;;OAIG;IACH,kBAHW,MAAM,aACN,MAAM,QAyBhB;IAED;;;;;;OAMG;IACH,kBAHW,MAAM,aACN,MAAM,QAwBhB;IAED;;;;;OAKG;IACH,kBAFY,MAAM,CAYjB;IAED;;;;OAIG;IACH,eAHW,MAAO,MAAM,CAAC,GACZ,MAAM,CAUlB;IAED;;;;OAIG;IACH,eAHW,MAAM,4BA8ChB;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,MAAM,QAwBhB;IAED;;;;OAIG;IACH,YAFW,aAAa,QAmBvB;IAED;;;OAGG;IACH,cAHW,aAAa,GACX,OAAO,CAmCnB;IAED;;;;;OAKG;IACH,eAJW,MAAM,WACN,MAAM,EAAE,GACN,MAAM,EAAE,CAUpB;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,MAAM,EAAE,QAUlB;IAED;;OAEG;IACH,qBA4BC;IAED;;OAEG;IACH,cAIC;IAED;;;OAGG;IACH,iBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,cAFa,MAAM,EAAE,EAAE,CAetB;IAED;;OAEG;IACH,uBAIC;IAED;;OAEG;IACH,mBAEC;IAGL;;OAEG;IACH,gBAtHe,MAAM,WACN,MAAM,EAAE,KACN,MAAM,EAAE,CAoHK;IAC9B;;OAEG;IACH,gBA1Ge,MAAM,UACN,MAAM,EAAE,UAyGO;CAT7B;mBAhpBkB,+BAA+B"}
|
|
@@ -9,7 +9,25 @@ import { array_buffer_copy } from "../array/typed/array_buffer_copy.js";
|
|
|
9
9
|
* How much space to reserve in a newly created table, counted in ROWs
|
|
10
10
|
* @type {number}
|
|
11
11
|
*/
|
|
12
|
-
const DEFAULT_CAPACITY = 8
|
|
12
|
+
const DEFAULT_CAPACITY = 8;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Must be greater than 1
|
|
16
|
+
* @type {number}
|
|
17
|
+
*/
|
|
18
|
+
const ALLOCATION_GROW_FACTOR = 1.5;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Minimum number of rows to add when growing
|
|
22
|
+
* @type {number}
|
|
23
|
+
*/
|
|
24
|
+
const ALLOCATION_GROW_MINIMUM_STEP = 32;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Must be less than 1 and greater than 0
|
|
28
|
+
* @type {number}
|
|
29
|
+
*/
|
|
30
|
+
const ALLOCATION_SHRINK_FACTOR = 0.5;
|
|
13
31
|
|
|
14
32
|
/**
|
|
15
33
|
* Compact binary table storage
|
|
@@ -213,20 +231,28 @@ export class RowFirstTable {
|
|
|
213
231
|
|
|
214
232
|
/**
|
|
215
233
|
*
|
|
216
|
-
* @param {number}
|
|
234
|
+
* @param {number} row_count
|
|
217
235
|
*/
|
|
218
|
-
resize(
|
|
219
|
-
assert.isNonNegativeInteger(
|
|
236
|
+
resize(row_count) {
|
|
237
|
+
assert.isNonNegativeInteger(row_count, 'row_count');
|
|
238
|
+
|
|
239
|
+
if (this.capacity < row_count) {
|
|
220
240
|
|
|
221
|
-
if (this.capacity < rowCount) {
|
|
222
241
|
//grow
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
242
|
+
const new_size = Math.max(
|
|
243
|
+
Math.ceil(row_count * ALLOCATION_GROW_FACTOR),
|
|
244
|
+
row_count + ALLOCATION_GROW_MINIMUM_STEP
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
this.setCapacity(new_size);
|
|
248
|
+
|
|
249
|
+
} else if (this.capacity * ALLOCATION_SHRINK_FACTOR > row_count) {
|
|
250
|
+
|
|
227
251
|
//shrink
|
|
228
|
-
this.setCapacity(
|
|
252
|
+
this.setCapacity(row_count);
|
|
253
|
+
|
|
229
254
|
}
|
|
255
|
+
|
|
230
256
|
}
|
|
231
257
|
|
|
232
258
|
/**
|
|
@@ -311,11 +337,15 @@ export class RowFirstTable {
|
|
|
311
337
|
|
|
312
338
|
/**
|
|
313
339
|
* Insert a number of blank rows at the given offset
|
|
314
|
-
*
|
|
340
|
+
* Table becomes larger as a result
|
|
341
|
+
* NOTE: doesn't send {@link on.added} signal
|
|
315
342
|
* @param {number} index
|
|
316
343
|
* @param {number} row_count
|
|
317
344
|
*/
|
|
318
345
|
insertRows(index, row_count) {
|
|
346
|
+
assert.isNonNegativeInteger(index, 'index');
|
|
347
|
+
assert.isNonNegativeInteger(row_count, 'row_count');
|
|
348
|
+
|
|
319
349
|
const future_length = this.length + row_count;
|
|
320
350
|
|
|
321
351
|
this.resize(future_length);
|
|
@@ -337,12 +367,12 @@ export class RowFirstTable {
|
|
|
337
367
|
}
|
|
338
368
|
|
|
339
369
|
/**
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
370
|
+
* Created a new row at the end of the table, does not dispatch {@link on.added} signal
|
|
371
|
+
* Values are undefined, typically it will be 0s, but if data was previously written in that memory region - that data will be retained.
|
|
372
|
+
* Make sure to clear the row or write to it before reading it
|
|
373
|
+
* @return {number} index of the created row
|
|
343
374
|
*/
|
|
344
|
-
|
|
345
|
-
|
|
375
|
+
createEmptyRow() {
|
|
346
376
|
const newRowCount = this.length + 1;
|
|
347
377
|
|
|
348
378
|
this.resize(newRowCount);
|
|
@@ -351,6 +381,17 @@ export class RowFirstTable {
|
|
|
351
381
|
|
|
352
382
|
this.length = newRowCount;
|
|
353
383
|
|
|
384
|
+
return rowIndex;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* @param {Array.<number>} values
|
|
390
|
+
* @returns {number} index of newly added row
|
|
391
|
+
*/
|
|
392
|
+
addRow(values) {
|
|
393
|
+
const rowIndex = this.createEmptyRow();
|
|
394
|
+
|
|
354
395
|
this.spec.writeRowMethod(this.dataView, this.spec.bytesPerRecord * rowIndex, values);
|
|
355
396
|
|
|
356
397
|
this.on.added.send2(rowIndex, values);
|
|
@@ -12,6 +12,8 @@ export class Color {
|
|
|
12
12
|
|
|
13
13
|
parse(text: string): void
|
|
14
14
|
|
|
15
|
+
set(r: number, g: number, b: number, a: number): void;
|
|
16
|
+
|
|
15
17
|
setRGB(r: number, g: number, b: number): void
|
|
16
18
|
|
|
17
19
|
setA(a: number): void
|
|
@@ -42,5 +44,7 @@ export class Color {
|
|
|
42
44
|
|
|
43
45
|
toJSON(): any
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
fromArray(source: ArrayLike<number>, destination_offset?: number): void
|
|
48
|
+
|
|
49
|
+
toArray<T extends ArrayLike<number>>(destination?: T, destination_offset?: number): T
|
|
46
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED;;;;OAIG;IACH,kCAHW,KAAK,UACL,KAAK,QAIf;IAED;;;;OAIG;IACH,kCAHW,KAAK,UACL,KAAK,QAIf;IA9pBD;;;;;;OAMG;IACH,gBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAuChB;IA/BG;;;;OAIG;IACH,GAFU,MAAM,CAEN;IACV;;;;OAIG;IACH,GAFU,MAAM,CAEN;IACV;;;;OAIG;IACH,GAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,oBAFU,OAAO,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,CAAC,CAE5C;IAWjC;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;IACH,gBAEC;IAkBD;;;OAGG;IACH,mBAEC;IAdD;;;OAGG;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AGG;IACH,6CAOC;IAED;;;;OAIG;IACH,WAHW,MAAM,GACJ,IAAI,CAYhB;IAED;;;;;OAKG;IACH,cAJW,KAAK,KACL,KAAK,KACL,MAAM,QAOhB;IA6DL;;;OAGG;IACH,sCAjJe,MAAM,EAAE,uBACR,MAAM,KACJ,MAAM,EAAE,CA+IG;IA5JxB,sDAOC;CA+IJ;;aAUS,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;gBAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;iBAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;qBAMf,SAAS,KAAK,CAAC;;mBA7uBN,4BAA4B"}
|
package/src/core/color/Color.js
CHANGED
|
@@ -54,7 +54,7 @@ export class Color {
|
|
|
54
54
|
this.b = b;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* Alpha channel
|
|
57
|
+
* Alpha channel (transparency)
|
|
58
58
|
* Value from 0 to 1
|
|
59
59
|
* @type {number}
|
|
60
60
|
*/
|
|
@@ -566,6 +566,20 @@ export class Color {
|
|
|
566
566
|
return destination;
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
+
/**
|
|
570
|
+
*
|
|
571
|
+
* @param {number[]|Float32Array} source
|
|
572
|
+
* @param {number} [offset]
|
|
573
|
+
*/
|
|
574
|
+
fromArray(source, offset = 0) {
|
|
575
|
+
const r = source[offset + 0];
|
|
576
|
+
const g = source[offset + 1];
|
|
577
|
+
const b = source[offset + 2];
|
|
578
|
+
const a = source[offset + 3];
|
|
579
|
+
|
|
580
|
+
this.set(r, g, b, a);
|
|
581
|
+
}
|
|
582
|
+
|
|
569
583
|
|
|
570
584
|
/**
|
|
571
585
|
*
|
|
@@ -681,7 +695,7 @@ export class Color {
|
|
|
681
695
|
}
|
|
682
696
|
|
|
683
697
|
/**
|
|
684
|
-
*
|
|
698
|
+
* @deprecated use {@link Color#toArray} instead
|
|
685
699
|
* @readonly
|
|
686
700
|
*/
|
|
687
701
|
Color.prototype.writeToArray = Color.prototype.toArray;
|