ag-psd 30.1.1 → 31.0.0
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/.v8-cache/v24.13.1-x64-cf738c9d/017325ac +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/01e5e61b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/043c7b90 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/05135617 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/059f8558 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/06423db9 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/06e765df +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0706ecb8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0930679d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/09519a62 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0a6607b0 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0ad8fa6e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0d390e10 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0db754a7 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0dfa7b16 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/0e9e09db +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1130885f +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1222cb8c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/15e2c039 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/15f0e479 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1a2d469d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1b300c82 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1bc3d370 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1e44e5af +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1efa10a1 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/1f6c8743 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/20477c23 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/20b27e40 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/20dfa422 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/257c62ba +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/25d60154 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/26f822f3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2a19133e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2a1e2a8d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2b02fded +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2b069ee0 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2c76dc0d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2de09439 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2deb286a +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2e44f5f0 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/2fb229a9 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/3144b401 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/32018e44 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/341402c3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/34e0fa2e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/37481985 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/3bbf643e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/3ceff89e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/404f5cdc +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4087aa2b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4376c1f9 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/44903df4 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/44d58dc8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4511bacf +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/47da0ce8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/48cd54a9 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/49d22b79 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4d938476 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4ec6d390 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/4f5702bd +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/514cc428 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/557d3b42 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/56abbff7 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/57b540ee +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/57d3380b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/5e20c081 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6024ce3f +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/61735b23 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/63dbdb75 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/651c4ada +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/652a0d59 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6a0e89ee +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6af33b91 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6c2562d2 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6cbfc0ec +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6dae0cfa +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6e2529ce +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/6f08372c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7100ee08 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/71df9cb3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/72e1d543 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/75519c80 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/75e41e43 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/79bf115c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7a39347c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7b83e3d3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7cd71bc5 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7da78512 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/7ea06cea +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/82c3b573 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/84c186e4 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/8568576b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/8607bd36 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/87372817 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/87cf2209 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/882aaa05 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/8a4d3de8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/8e223473 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/92b7aefd +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/932f0770 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/937c03a1 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/991e4758 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/9af658fb +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/9ed80ba5 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/9f0dc993 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/a19c0c4f +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/a6409d95 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/a79a40bb +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/a7e80865 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ac9802c6 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/acc36e66 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ad11e2dc +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b0c8fcd8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b1762958 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b3c2fab7 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b5b3329b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b69ed3a3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/b806679e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/bc1cdd48 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/bc7ebd1d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/bdff1628 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c0b789d2 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c314aece +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c399a5dc +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c681cbc8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c6834ffc +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/c6f12ed5 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cb0f0a3d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cbcb7c95 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cdd9107c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cdf2c4a3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cfc49f4f +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/cff9434a +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/d02dd6f7 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/d0507bf3 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/d60fce19 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/d733d619 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/d75b7803 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/dc86f000 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/de74e659 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/defa4f7f +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e03e2acd +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e0e3f52c +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e158d332 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e6735171 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e6745c2b +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e6b99945 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e6d8ceb8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/e7ffec37 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ea33b6de +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/eaafa3c4 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ebb50fca +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ec805f2e +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/edaef8f1 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/ee4401c8 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/eeeebdfe +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/f3d51676 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/f7b50a75 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/fa58ca72 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/fbca6276 +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/fc97d72d +0 -0
- package/.v8-cache/v24.13.1-x64-cf738c9d/fd0a2987 +0 -0
- package/CHANGELOG.md +9 -0
- package/README.md +65 -1
- package/README_PSD.md +1 -1
- package/TODO.md +2 -0
- package/dist/abr.d.ts +196 -196
- package/dist/abr.js +364 -378
- package/dist/abr.js.map +1 -1
- package/dist/additionalInfo.d.ts +26 -26
- package/dist/additionalInfo.js +3478 -3516
- package/dist/additionalInfo.js.map +1 -1
- package/dist/ase.d.ts +32 -32
- package/dist/ase.js +81 -82
- package/dist/ase.js.map +1 -1
- package/dist/bundle.js +12380 -12445
- package/dist/csh.d.ts +10 -10
- package/dist/csh.js +35 -47
- package/dist/csh.js.map +1 -1
- package/dist/descriptor.d.ts +601 -601
- package/dist/descriptor.js +2003 -2038
- package/dist/descriptor.js.map +1 -1
- package/dist/effectsHelpers.d.ts +5 -5
- package/dist/effectsHelpers.js +286 -308
- package/dist/effectsHelpers.js.map +1 -1
- package/dist/engineData.d.ts +2 -2
- package/dist/engineData.js +334 -341
- package/dist/engineData.js.map +1 -1
- package/dist/engineData2.d.ts +2 -2
- package/dist/engineData2.js +409 -411
- package/dist/engineData2.js.map +1 -1
- package/dist/helpers.d.ts +74 -74
- package/dist/helpers.js +353 -348
- package/dist/helpers.js.map +1 -1
- package/dist/imageResources.d.ts +17 -17
- package/dist/imageResources.js +1040 -1079
- package/dist/imageResources.js.map +1 -1
- package/dist/index.d.ts +20 -22
- package/dist/index.js +61 -56
- package/dist/index.js.map +1 -1
- package/dist/initializeCanvas.d.ts +1 -1
- package/dist/initializeCanvas.js +9 -10
- package/dist/initializeCanvas.js.map +1 -1
- package/dist/jpeg.d.ts +1 -1
- package/dist/jpeg.js +1020 -1021
- package/dist/jpeg.js.map +1 -1
- package/dist/psd.d.ts +1877 -1873
- package/dist/psd.js +45 -45
- package/dist/psd.js.map +1 -1
- package/dist/psdReader.d.ts +52 -45
- package/dist/psdReader.js +1385 -1293
- package/dist/psdReader.js.map +1 -1
- package/dist/psdWriter.d.ts +34 -33
- package/dist/psdWriter.js +834 -805
- package/dist/psdWriter.js.map +1 -1
- package/dist/text.d.ts +179 -179
- package/dist/text.js +552 -577
- package/dist/text.js.map +1 -1
- package/dist/utf8.d.ts +4 -6
- package/dist/utf8.js +156 -157
- package/dist/utf8.js.map +1 -1
- package/dist-es/abr.d.ts +196 -196
- package/dist-es/abr.js +364 -374
- package/dist-es/abr.js.map +1 -1
- package/dist-es/additionalInfo.d.ts +26 -26
- package/dist-es/additionalInfo.js +3478 -3510
- package/dist-es/additionalInfo.js.map +1 -1
- package/dist-es/ase.d.ts +32 -32
- package/dist-es/ase.js +81 -78
- package/dist-es/ase.js.map +1 -1
- package/dist-es/csh.d.ts +10 -10
- package/dist-es/csh.js +35 -43
- package/dist-es/csh.js.map +1 -1
- package/dist-es/descriptor.d.ts +601 -601
- package/dist-es/descriptor.js +2003 -2005
- package/dist-es/descriptor.js.map +1 -1
- package/dist-es/effectsHelpers.d.ts +5 -5
- package/dist-es/effectsHelpers.js +286 -303
- package/dist-es/effectsHelpers.js.map +1 -1
- package/dist-es/engineData.d.ts +2 -2
- package/dist-es/engineData.js +334 -336
- package/dist-es/engineData.js.map +1 -1
- package/dist-es/engineData2.d.ts +2 -2
- package/dist-es/engineData2.js +409 -407
- package/dist-es/engineData2.js.map +1 -1
- package/dist-es/helpers.d.ts +74 -74
- package/dist-es/helpers.js +353 -330
- package/dist-es/helpers.js.map +1 -1
- package/dist-es/imageResources.d.ts +17 -17
- package/dist-es/imageResources.js +1040 -1076
- package/dist-es/imageResources.js.map +1 -1
- package/dist-es/index.d.ts +20 -22
- package/dist-es/index.js +61 -33
- package/dist-es/index.js.map +1 -1
- package/dist-es/initializeCanvas.d.ts +1 -1
- package/dist-es/initializeCanvas.js +9 -6
- package/dist-es/initializeCanvas.js.map +1 -1
- package/dist-es/jpeg.d.ts +1 -1
- package/dist-es/jpeg.js +1020 -1017
- package/dist-es/jpeg.js.map +1 -1
- package/dist-es/psd.d.ts +1877 -1873
- package/dist-es/psd.js +45 -42
- package/dist-es/psd.js.map +1 -1
- package/dist-es/psdReader.d.ts +52 -45
- package/dist-es/psdReader.js +1385 -1255
- package/dist-es/psdReader.js.map +1 -1
- package/dist-es/psdWriter.d.ts +34 -33
- package/dist-es/psdWriter.js +834 -776
- package/dist-es/psdWriter.js.map +1 -1
- package/dist-es/text.d.ts +179 -179
- package/dist-es/text.js +552 -572
- package/dist-es/text.js.map +1 -1
- package/dist-es/utf8.d.ts +4 -6
- package/dist-es/utf8.js +156 -150
- package/dist-es/utf8.js.map +1 -1
- package/package.json +4 -3
- package/publish.js +24 -0
- package/src/additionalInfo.ts +15 -11
- package/src/helpers.ts +13 -3
- package/src/index.ts +4 -6
- package/src/psd.ts +4 -0
- package/src/psdReader.ts +136 -43
- package/src/psdWriter.ts +118 -24
- package/tsconfig-es6.json +2 -1
- package/tsconfig.json +5 -3
package/dist/descriptor.js
CHANGED
|
@@ -1,2039 +1,2004 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
'
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
'
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
'
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
'
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
'
|
|
212
|
-
'
|
|
213
|
-
'
|
|
214
|
-
'
|
|
215
|
-
'
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
'
|
|
219
|
-
'
|
|
220
|
-
'
|
|
221
|
-
'
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
'
|
|
225
|
-
'
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
'
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
'
|
|
232
|
-
'
|
|
233
|
-
'
|
|
234
|
-
'
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
'
|
|
238
|
-
'
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
'
|
|
242
|
-
'
|
|
243
|
-
'
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
'
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
'
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
else if (key === '
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
else if (
|
|
475
|
-
type =
|
|
476
|
-
}
|
|
477
|
-
else if (key === '
|
|
478
|
-
type =
|
|
479
|
-
}
|
|
480
|
-
else if (key === '
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
return
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
return
|
|
535
|
-
}
|
|
536
|
-
case '
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
case '
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
case '
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
case '
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return
|
|
565
|
-
}
|
|
566
|
-
case '
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
(0, psdReader_1.
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
(0, psdWriter_1.
|
|
653
|
-
break;
|
|
654
|
-
case '
|
|
655
|
-
if (
|
|
656
|
-
throw new Error(
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
//
|
|
677
|
-
//
|
|
678
|
-
//
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
(0, psdWriter_1.
|
|
682
|
-
break;
|
|
683
|
-
case '
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
(0, psdWriter_1.
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
break;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
case '
|
|
731
|
-
readClassStructure(reader);
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
case '
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
// case '
|
|
785
|
-
// case '
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
writeClassStructure(writer, '\0',
|
|
789
|
-
(
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
}
|
|
807
|
-
function
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
if (
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
function
|
|
832
|
-
return {
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
FrFX.
|
|
882
|
-
FrFX
|
|
883
|
-
FrFX
|
|
884
|
-
FrFX
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
if (
|
|
914
|
-
info.
|
|
915
|
-
if (
|
|
916
|
-
info.
|
|
917
|
-
if (
|
|
918
|
-
info.
|
|
919
|
-
if (
|
|
920
|
-
info.
|
|
921
|
-
if (e.
|
|
922
|
-
info.
|
|
923
|
-
if (useMulti(e.
|
|
924
|
-
info.
|
|
925
|
-
if (useMulti(e.
|
|
926
|
-
info.
|
|
927
|
-
if (
|
|
928
|
-
info.
|
|
929
|
-
if (e.
|
|
930
|
-
info.
|
|
931
|
-
if (e.
|
|
932
|
-
info.
|
|
933
|
-
if (
|
|
934
|
-
info.
|
|
935
|
-
if (e.
|
|
936
|
-
info.
|
|
937
|
-
if (
|
|
938
|
-
info.
|
|
939
|
-
if (e.
|
|
940
|
-
info.
|
|
941
|
-
if (
|
|
942
|
-
info.
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
case 'keyType.
|
|
1014
|
-
keys.push({
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
break;
|
|
1019
|
-
case 'keyType.
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
case '
|
|
1125
|
-
result.
|
|
1126
|
-
break;
|
|
1127
|
-
case '
|
|
1128
|
-
result.
|
|
1129
|
-
break;
|
|
1130
|
-
case '
|
|
1131
|
-
result.
|
|
1132
|
-
break;
|
|
1133
|
-
case '
|
|
1134
|
-
result.
|
|
1135
|
-
break;
|
|
1136
|
-
case '
|
|
1137
|
-
result.
|
|
1138
|
-
break;
|
|
1139
|
-
case '
|
|
1140
|
-
result.
|
|
1141
|
-
break;
|
|
1142
|
-
case '
|
|
1143
|
-
result.
|
|
1144
|
-
break;
|
|
1145
|
-
case '
|
|
1146
|
-
result.
|
|
1147
|
-
break;
|
|
1148
|
-
case '
|
|
1149
|
-
result.
|
|
1150
|
-
break;
|
|
1151
|
-
case '
|
|
1152
|
-
result.
|
|
1153
|
-
break;
|
|
1154
|
-
case '
|
|
1155
|
-
result.
|
|
1156
|
-
break;
|
|
1157
|
-
case '
|
|
1158
|
-
result.
|
|
1159
|
-
break;
|
|
1160
|
-
case '
|
|
1161
|
-
result.
|
|
1162
|
-
break;
|
|
1163
|
-
case '
|
|
1164
|
-
result.
|
|
1165
|
-
break;
|
|
1166
|
-
case '
|
|
1167
|
-
result.
|
|
1168
|
-
break;
|
|
1169
|
-
case '
|
|
1170
|
-
result.
|
|
1171
|
-
break;
|
|
1172
|
-
case '
|
|
1173
|
-
result.
|
|
1174
|
-
break;
|
|
1175
|
-
case '
|
|
1176
|
-
result.
|
|
1177
|
-
break;
|
|
1178
|
-
case '
|
|
1179
|
-
result.
|
|
1180
|
-
break;
|
|
1181
|
-
case '
|
|
1182
|
-
result.
|
|
1183
|
-
break;
|
|
1184
|
-
case '
|
|
1185
|
-
result.
|
|
1186
|
-
break;
|
|
1187
|
-
case '
|
|
1188
|
-
result.
|
|
1189
|
-
break;
|
|
1190
|
-
case '
|
|
1191
|
-
result.
|
|
1192
|
-
break;
|
|
1193
|
-
case '
|
|
1194
|
-
result.
|
|
1195
|
-
break;
|
|
1196
|
-
case '
|
|
1197
|
-
result.
|
|
1198
|
-
break;
|
|
1199
|
-
case '
|
|
1200
|
-
result.
|
|
1201
|
-
break;
|
|
1202
|
-
case '
|
|
1203
|
-
result.
|
|
1204
|
-
break;
|
|
1205
|
-
case '
|
|
1206
|
-
result.
|
|
1207
|
-
break;
|
|
1208
|
-
case '
|
|
1209
|
-
result.
|
|
1210
|
-
break;
|
|
1211
|
-
case '
|
|
1212
|
-
result.
|
|
1213
|
-
break;
|
|
1214
|
-
case '
|
|
1215
|
-
result.
|
|
1216
|
-
break;
|
|
1217
|
-
case '
|
|
1218
|
-
result.
|
|
1219
|
-
break;
|
|
1220
|
-
case '
|
|
1221
|
-
result.
|
|
1222
|
-
break;
|
|
1223
|
-
case '
|
|
1224
|
-
result.
|
|
1225
|
-
break;
|
|
1226
|
-
case '
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
case '
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
case '
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
case '
|
|
1393
|
-
result.
|
|
1394
|
-
break;
|
|
1395
|
-
case '
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
case '
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
if (
|
|
1587
|
-
return {
|
|
1588
|
-
}
|
|
1589
|
-
else if (
|
|
1590
|
-
return {
|
|
1591
|
-
}
|
|
1592
|
-
else {
|
|
1593
|
-
return {
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
if (
|
|
1660
|
-
|
|
1661
|
-
return
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
function
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
if (
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
'
|
|
1768
|
-
'
|
|
1769
|
-
'
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
'
|
|
1773
|
-
'
|
|
1774
|
-
'
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
});
|
|
1799
|
-
exports.
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
});
|
|
1806
|
-
exports.
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
});
|
|
1819
|
-
exports.
|
|
1820
|
-
|
|
1821
|
-
center: '
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
});
|
|
1854
|
-
exports.
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
});
|
|
1859
|
-
exports.
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
});
|
|
1864
|
-
exports.
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
});
|
|
1868
|
-
exports.
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
'
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
'
|
|
1928
|
-
'
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
'
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
'
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
});
|
|
1954
|
-
exports.
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
'
|
|
1964
|
-
'
|
|
1965
|
-
'
|
|
1966
|
-
'
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
});
|
|
1972
|
-
exports.
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
});
|
|
1989
|
-
exports.
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
'
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
'
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
lower: 'Lwr ',
|
|
2005
|
-
upper: 'Upr ',
|
|
2006
|
-
});
|
|
2007
|
-
exports.WndM = (0, helpers_1.createEnum)('WndM', 'wind', {
|
|
2008
|
-
wind: 'Wnd ',
|
|
2009
|
-
blast: 'Blst',
|
|
2010
|
-
stagger: 'Stgr',
|
|
2011
|
-
});
|
|
2012
|
-
exports.Drct = (0, helpers_1.createEnum)('Drct', 'from the right', {
|
|
2013
|
-
left: 'Left',
|
|
2014
|
-
right: 'Rght',
|
|
2015
|
-
});
|
|
2016
|
-
exports.IntE = (0, helpers_1.createEnum)('IntE', 'odd lines', {
|
|
2017
|
-
'odd lines': 'ElmO',
|
|
2018
|
-
'even lines': 'ElmE',
|
|
2019
|
-
});
|
|
2020
|
-
exports.IntC = (0, helpers_1.createEnum)('IntC', 'interpolation', {
|
|
2021
|
-
duplication: 'CrtD',
|
|
2022
|
-
interpolation: 'CrtI',
|
|
2023
|
-
});
|
|
2024
|
-
exports.FlMd = (0, helpers_1.createEnum)('FlMd', 'wrap around', {
|
|
2025
|
-
'set to transparent': 'Bckg',
|
|
2026
|
-
'repeat edge pixels': 'Rpt ',
|
|
2027
|
-
'wrap around': 'Wrp ',
|
|
2028
|
-
});
|
|
2029
|
-
exports.prjM = (0, helpers_1.createEnum)('prjM', 'fisheye', {
|
|
2030
|
-
'fisheye': 'fisP',
|
|
2031
|
-
'perspective': 'perP',
|
|
2032
|
-
'auto': 'auto',
|
|
2033
|
-
'full spherical': 'fusP',
|
|
2034
|
-
});
|
|
2035
|
-
exports.presetKindType = (0, helpers_1.createEnum)('presetKindType', 'presetKindCustom', {
|
|
2036
|
-
custom: 'presetKindCustom',
|
|
2037
|
-
default: 'presetKindDefault',
|
|
2038
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.IntC = exports.IntE = exports.Drct = exports.WndM = exports.CntE = exports.FlCl = exports.ExtR = exports.ExtT = exports.DfsM = exports.blurType = exports.Lns = exports.MztT = exports.Chnl = exports.Dstr = exports.ZZTy = exports.Wvtp = exports.SphM = exports.RplS = exports.Cnvr = exports.UndA = exports.DspM = exports.SmBQ = exports.SmBM = exports.BlrQ = exports.BlrM = exports.strokeStyleLineAlignment = exports.strokeStyleLineJoinType = exports.strokeStyleLineCapType = exports.ESliceBGColorType = exports.ESliceOrigin = exports.ESliceVertAlign = exports.ESliceHorzAlign = exports.ESliceType = exports.FrFl = exports.FStl = exports.ClrS = exports.gradientInterpolationMethodType = exports.stdTrackID = exports.animInterpStyleEnum = exports.GrdT = exports.IGSr = exports.BETE = exports.BESs = exports.bvlT = exports.BESl = exports.BlnM = exports.warpStyle = exports.Annt = exports.Ornt = exports.textGridding = void 0;
|
|
15
|
+
exports.presetKindType = exports.prjM = exports.FlMd = void 0;
|
|
16
|
+
exports.setLogErrors = setLogErrors;
|
|
17
|
+
exports.readAsciiStringOrClassId = readAsciiStringOrClassId;
|
|
18
|
+
exports.readDescriptorStructure = readDescriptorStructure;
|
|
19
|
+
exports.writeDescriptorStructure = writeDescriptorStructure;
|
|
20
|
+
exports.readVersionAndDescriptor = readVersionAndDescriptor;
|
|
21
|
+
exports.writeVersionAndDescriptor = writeVersionAndDescriptor;
|
|
22
|
+
exports.horzVrtcToXY = horzVrtcToXY;
|
|
23
|
+
exports.xyToHorzVrtc = xyToHorzVrtc;
|
|
24
|
+
exports.descBoundsToBounds = descBoundsToBounds;
|
|
25
|
+
exports.boundsToDescBounds = boundsToDescBounds;
|
|
26
|
+
exports.serializeEffects = serializeEffects;
|
|
27
|
+
exports.parseEffects = parseEffects;
|
|
28
|
+
exports.parseTrackList = parseTrackList;
|
|
29
|
+
exports.serializeTrackList = serializeTrackList;
|
|
30
|
+
exports.parseVectorContent = parseVectorContent;
|
|
31
|
+
exports.serializeVectorContent = serializeVectorContent;
|
|
32
|
+
exports.parseColor = parseColor;
|
|
33
|
+
exports.serializeColor = serializeColor;
|
|
34
|
+
exports.parseAngle = parseAngle;
|
|
35
|
+
exports.parsePercent = parsePercent;
|
|
36
|
+
exports.parsePercentOrAngle = parsePercentOrAngle;
|
|
37
|
+
exports.parseUnits = parseUnits;
|
|
38
|
+
exports.parseUnitsOrNumber = parseUnitsOrNumber;
|
|
39
|
+
exports.parseUnitsToNumber = parseUnitsToNumber;
|
|
40
|
+
exports.unitsAngle = unitsAngle;
|
|
41
|
+
exports.unitsPercent = unitsPercent;
|
|
42
|
+
exports.unitsPercentF = unitsPercentF;
|
|
43
|
+
exports.unitsValue = unitsValue;
|
|
44
|
+
exports.frac = frac;
|
|
45
|
+
const helpers_1 = require("./helpers");
|
|
46
|
+
const psdReader_1 = require("./psdReader");
|
|
47
|
+
const psdWriter_1 = require("./psdWriter");
|
|
48
|
+
function revMap(map) {
|
|
49
|
+
const result = {};
|
|
50
|
+
Object.keys(map).forEach(key => result[map[key]] = key);
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
const unitsMap = {
|
|
54
|
+
'#Ang': 'Angle',
|
|
55
|
+
'#Rsl': 'Density',
|
|
56
|
+
'#Rlt': 'Distance',
|
|
57
|
+
'#Nne': 'None',
|
|
58
|
+
'#Prc': 'Percent',
|
|
59
|
+
'#Pxl': 'Pixels',
|
|
60
|
+
'#Mlm': 'Millimeters',
|
|
61
|
+
'#Pnt': 'Points',
|
|
62
|
+
'RrPi': 'Picas',
|
|
63
|
+
'RrIn': 'Inches',
|
|
64
|
+
'RrCm': 'Centimeters',
|
|
65
|
+
};
|
|
66
|
+
const unitsMapRev = revMap(unitsMap);
|
|
67
|
+
let logErrors = false;
|
|
68
|
+
function setLogErrors(value) {
|
|
69
|
+
logErrors = value;
|
|
70
|
+
}
|
|
71
|
+
function makeType(name, classID) {
|
|
72
|
+
return { name, classID };
|
|
73
|
+
}
|
|
74
|
+
const nullType = makeType('', 'null');
|
|
75
|
+
const USE_CHINESE = false; // Testing
|
|
76
|
+
const fieldToExtType = {
|
|
77
|
+
strokeStyleContent: makeType('', 'solidColorLayer'),
|
|
78
|
+
printProofSetup: makeType(USE_CHINESE ? '校样设置' : 'Proof Setup', 'proofSetup'),
|
|
79
|
+
Grad: makeType(USE_CHINESE ? '渐变' : 'Gradient', 'Grdn'),
|
|
80
|
+
Trnf: makeType(USE_CHINESE ? '变换' : 'Transform', 'Trnf'),
|
|
81
|
+
patternFill: makeType('', 'patternFill'),
|
|
82
|
+
ebbl: makeType('', 'ebbl'),
|
|
83
|
+
SoFi: makeType('', 'SoFi'),
|
|
84
|
+
GrFl: makeType('', 'GrFl'),
|
|
85
|
+
sdwC: makeType('', 'RGBC'),
|
|
86
|
+
hglC: makeType('', 'RGBC'),
|
|
87
|
+
'Clr ': makeType('', 'RGBC'),
|
|
88
|
+
'tintColor': makeType('', 'RGBC'),
|
|
89
|
+
Ofst: makeType('', 'Pnt '),
|
|
90
|
+
ChFX: makeType('', 'ChFX'),
|
|
91
|
+
MpgS: makeType('', 'ShpC'),
|
|
92
|
+
DrSh: makeType('', 'DrSh'),
|
|
93
|
+
IrSh: makeType('', 'IrSh'),
|
|
94
|
+
OrGl: makeType('', 'OrGl'),
|
|
95
|
+
IrGl: makeType('', 'IrGl'),
|
|
96
|
+
TrnS: makeType('', 'ShpC'),
|
|
97
|
+
Ptrn: makeType('', 'Ptrn'),
|
|
98
|
+
FrFX: makeType('', 'FrFX'),
|
|
99
|
+
phase: makeType('', 'Pnt '),
|
|
100
|
+
frameStep: nullType,
|
|
101
|
+
duration: nullType,
|
|
102
|
+
workInTime: nullType,
|
|
103
|
+
workOutTime: nullType,
|
|
104
|
+
audioClipGroupList: nullType,
|
|
105
|
+
bounds: makeType('', 'Rctn'),
|
|
106
|
+
customEnvelopeWarp: makeType('', 'customEnvelopeWarp'),
|
|
107
|
+
warp: makeType('', 'warp'),
|
|
108
|
+
'Sz ': makeType('', 'Pnt '),
|
|
109
|
+
origin: makeType('', 'Pnt '),
|
|
110
|
+
autoExpandOffset: makeType('', 'Pnt '),
|
|
111
|
+
keyOriginShapeBBox: makeType('', 'unitRect'),
|
|
112
|
+
Vrsn: nullType,
|
|
113
|
+
psVersion: nullType,
|
|
114
|
+
docDefaultNewArtboardBackgroundColor: makeType('', 'RGBC'),
|
|
115
|
+
artboardRect: makeType('', 'classFloatRect'),
|
|
116
|
+
keyOriginRRectRadii: makeType('', 'radii'),
|
|
117
|
+
keyOriginBoxCorners: nullType,
|
|
118
|
+
rectangleCornerA: makeType('', 'Pnt '),
|
|
119
|
+
rectangleCornerB: makeType('', 'Pnt '),
|
|
120
|
+
rectangleCornerC: makeType('', 'Pnt '),
|
|
121
|
+
rectangleCornerD: makeType('', 'Pnt '),
|
|
122
|
+
compInfo: nullType,
|
|
123
|
+
quiltWarp: makeType('', 'quiltWarp'),
|
|
124
|
+
generatorSettings: nullType,
|
|
125
|
+
crema: nullType,
|
|
126
|
+
FrIn: nullType,
|
|
127
|
+
blendOptions: nullType,
|
|
128
|
+
FXRf: nullType,
|
|
129
|
+
Lefx: nullType,
|
|
130
|
+
time: nullType,
|
|
131
|
+
animKey: nullType,
|
|
132
|
+
timeScope: nullType,
|
|
133
|
+
inTime: nullType,
|
|
134
|
+
outTime: nullType,
|
|
135
|
+
sheetStyle: nullType,
|
|
136
|
+
translation: nullType,
|
|
137
|
+
Skew: nullType,
|
|
138
|
+
boundingBox: makeType('', 'boundingBox'),
|
|
139
|
+
'Lnk ': makeType('', 'ExternalFileLink'),
|
|
140
|
+
frameReader: makeType('', 'FrameReader'),
|
|
141
|
+
effectParams: makeType('', 'motionTrackEffectParams'),
|
|
142
|
+
Impr: makeType('None', 'none'),
|
|
143
|
+
Anch: makeType('', 'Pnt '),
|
|
144
|
+
'Fwd ': makeType('', 'Pnt '),
|
|
145
|
+
'Bwd ': makeType('', 'Pnt '),
|
|
146
|
+
FlrC: makeType('', 'Pnt '),
|
|
147
|
+
meshBoundaryPath: makeType('', 'pathClass'),
|
|
148
|
+
filterFX: makeType('', 'filterFXStyle'),
|
|
149
|
+
Fltr: makeType('', 'rigidTransform'),
|
|
150
|
+
FrgC: makeType('', 'RGBC'),
|
|
151
|
+
BckC: makeType('', 'RGBC'),
|
|
152
|
+
sdwM: makeType('Parameters', 'adaptCorrectTones'),
|
|
153
|
+
hglM: makeType('Parameters', 'adaptCorrectTones'),
|
|
154
|
+
customShape: makeType('', 'customShape'),
|
|
155
|
+
origFXRefPoint: nullType,
|
|
156
|
+
FXRefPoint: nullType,
|
|
157
|
+
ClMg: makeType('', 'ClMg'),
|
|
158
|
+
};
|
|
159
|
+
const fieldToArrayExtType = {
|
|
160
|
+
'Crv ': makeType('', 'CrPt'),
|
|
161
|
+
Clrs: makeType('', 'Clrt'),
|
|
162
|
+
Trns: makeType('', 'TrnS'),
|
|
163
|
+
keyDescriptorList: nullType,
|
|
164
|
+
solidFillMulti: makeType('', 'SoFi'),
|
|
165
|
+
gradientFillMulti: makeType('', 'GrFl'),
|
|
166
|
+
dropShadowMulti: makeType('', 'DrSh'),
|
|
167
|
+
innerShadowMulti: makeType('', 'IrSh'),
|
|
168
|
+
frameFXMulti: makeType('', 'FrFX'),
|
|
169
|
+
FrIn: nullType,
|
|
170
|
+
FSts: nullType,
|
|
171
|
+
LaSt: nullType,
|
|
172
|
+
sheetTimelineOptions: nullType,
|
|
173
|
+
trackList: makeType('', 'animationTrack'),
|
|
174
|
+
globalTrackList: makeType('', 'animationTrack'),
|
|
175
|
+
keyList: nullType,
|
|
176
|
+
audioClipGroupList: nullType,
|
|
177
|
+
audioClipList: nullType,
|
|
178
|
+
countObjectList: makeType('', 'countObject'),
|
|
179
|
+
countGroupList: makeType('', 'countGroup'),
|
|
180
|
+
slices: makeType('', 'slice'),
|
|
181
|
+
'Pts ': makeType('', 'Pthp'),
|
|
182
|
+
SbpL: makeType('', 'SbpL'),
|
|
183
|
+
pathComponents: makeType('', 'PaCm'),
|
|
184
|
+
filterFXList: makeType('', 'filterFX'),
|
|
185
|
+
puppetShapeList: makeType('', 'puppetShape'),
|
|
186
|
+
channelDenoise: makeType('', 'channelDenoiseParams'),
|
|
187
|
+
ShrP: makeType('', 'Pnt '),
|
|
188
|
+
layerSettings: nullType,
|
|
189
|
+
list: nullType,
|
|
190
|
+
Adjs: makeType('', 'CrvA'),
|
|
191
|
+
};
|
|
192
|
+
const typeToField = {
|
|
193
|
+
'TEXT': [
|
|
194
|
+
'Txt ', 'printerName', 'Nm ', 'Idnt', 'blackAndWhitePresetFileName', 'LUT3DFileName',
|
|
195
|
+
'presetFileName', 'curvesPresetFileName', 'mixerPresetFileName', 'placed', 'description', 'reason',
|
|
196
|
+
'artboardPresetName', 'json', 'clipID', 'relPath', 'fullPath', 'mediaDescriptor', 'Msge',
|
|
197
|
+
'altTag', 'url', 'cellText', 'preset', 'KnNm', 'FPth', 'comment', 'originalPath',
|
|
198
|
+
],
|
|
199
|
+
'tdta': [
|
|
200
|
+
'EngineData', 'LUT3DFileData', 'indexArray', 'originalVertexArray', 'deformedVertexArray',
|
|
201
|
+
'LqMe',
|
|
202
|
+
],
|
|
203
|
+
'long': [
|
|
204
|
+
'TextIndex', 'RndS', 'Mdpn', 'Smth', 'Lctn', 'strokeStyleVersion', 'LaID', 'Vrsn', 'Cnt ',
|
|
205
|
+
'Brgh', 'Cntr', 'means', 'vibrance', 'Strt', 'bwPresetKind', 'comp', 'compID', 'originalCompID',
|
|
206
|
+
'curvesPresetKind', 'mixerPresetKind', 'uOrder', 'vOrder', 'PgNm', 'totalPages', 'Crop',
|
|
207
|
+
'numerator', 'denominator', 'frameCount', 'Annt', 'keyOriginType', 'unitValueQuadVersion',
|
|
208
|
+
'keyOriginIndex', 'major', 'minor', 'fix', 'docDefaultNewArtboardBackgroundType', 'artboardBackgroundType',
|
|
209
|
+
'numModifyingFX', 'deformNumRows', 'deformNumCols', 'FrID', 'FrDl', 'FsID', 'LCnt', 'AFrm', 'AFSt',
|
|
210
|
+
'numBefore', 'numAfter', 'Spcn', 'minOpacity', 'maxOpacity', 'BlnM', 'sheetID', 'gblA', 'globalAltitude',
|
|
211
|
+
'descVersion', 'frameReaderType', 'LyrI', 'zoomOrigin', 'fontSize', 'Rds ', 'sliceID',
|
|
212
|
+
'topOutset', 'leftOutset', 'bottomOutset', 'rightOutset', 'filterID', 'meshQuality',
|
|
213
|
+
'meshExpansion', 'meshRigidity', 'VrsM', 'VrsN', 'NmbG', 'WLMn', 'WLMx', 'AmMn', 'AmMx', 'SclH', 'SclV',
|
|
214
|
+
'Lvl ', 'TlNm', 'TlOf', 'FlRs', 'Thsh', 'ShrS', 'ShrE', 'FlRs', 'Vrnc', 'Strg', 'ExtS', 'ExtD',
|
|
215
|
+
'HrzS', 'VrtS', 'NmbR', 'EdgF', 'Ang1', 'Ang2', 'Ang3', 'Ang4', 'lastAppliedComp', 'capturedInfo',
|
|
216
|
+
],
|
|
217
|
+
'enum': [
|
|
218
|
+
'textGridding', 'Ornt', 'warpStyle', 'warpRotate', 'Inte', 'Bltn', 'ClrS', 'BlrQ',
|
|
219
|
+
'bvlT', 'bvlS', 'bvlD', 'Md ', 'glwS', 'GrdF', 'GlwT', 'RplS', 'BlrM', 'SmBM',
|
|
220
|
+
'strokeStyleLineCapType', 'strokeStyleLineJoinType', 'strokeStyleLineAlignment',
|
|
221
|
+
'strokeStyleBlendMode', 'PntT', 'Styl', 'lookupType', 'LUTFormat', 'dataOrder',
|
|
222
|
+
'tableOrder', 'enableCompCore', 'enableCompCoreGPU', 'compCoreSupport', 'compCoreGPUSupport', 'Engn',
|
|
223
|
+
'enableCompCoreThreads', 'gs99', 'FrDs', 'trackID', 'animInterpStyle', 'horzAlign',
|
|
224
|
+
'vertAlign', 'bgColorType', 'shapeOperation', 'UndA', 'Wvtp', 'Drct', 'WndM', 'Edg ', 'FlCl', 'IntE',
|
|
225
|
+
'IntC', 'Cnvr', 'Fl ', 'Dstr', 'MztT', 'Lns ', 'ExtT', 'DspM', 'ExtR', 'ZZTy', 'SphM', 'SmBQ', 'placedLayerOCIOConversion', 'gradientsInterpolationMethod',
|
|
226
|
+
],
|
|
227
|
+
'bool': [
|
|
228
|
+
'PstS', 'printSixteenBit', 'masterFXSwitch', 'enab', 'uglg', 'antialiasGloss',
|
|
229
|
+
'useShape', 'useTexture', 'uglg', 'antialiasGloss', 'useShape', 'Vsbl',
|
|
230
|
+
'useTexture', 'Algn', 'Rvrs', 'Dthr', 'Invr', 'VctC', 'ShTr', 'layerConceals',
|
|
231
|
+
'strokeEnabled', 'fillEnabled', 'strokeStyleScaleLock', 'strokeStyleStrokeAdjust',
|
|
232
|
+
'hardProof', 'MpBl', 'paperWhite', 'useLegacy', 'Auto', 'Lab ', 'useTint', 'keyShapeInvalidated',
|
|
233
|
+
'autoExpandEnabled', 'autoNestEnabled', 'autoPositionEnabled', 'shrinkwrapOnSaveEnabled',
|
|
234
|
+
'present', 'showInDialog', 'overprint', 'sheetDisclosed', 'lightsDisclosed', 'meshesDisclosed',
|
|
235
|
+
'materialsDisclosed', 'hasMotion', 'muted', 'Effc', 'selected', 'autoScope', 'fillCanvas',
|
|
236
|
+
'cellTextIsHTML', 'Smoo', 'Clsp', 'validAtPosition', 'rigidType', 'hasoptions', 'filterMaskEnable',
|
|
237
|
+
'filterMaskLinked', 'filterMaskExtendWithWhite', 'removeJPEGArtifact', 'Mnch', 'ExtF', 'ExtM',
|
|
238
|
+
'moreAccurate', 'GpuY', 'LIWy', 'Cnty',
|
|
239
|
+
],
|
|
240
|
+
'doub': [
|
|
241
|
+
'warpValue', 'warpPerspective', 'warpPerspectiveOther', 'Intr', 'Wdth', 'Hght',
|
|
242
|
+
'strokeStyleMiterLimit', 'strokeStyleResolution', 'layerTime', 'keyOriginResolution',
|
|
243
|
+
'xx', 'xy', 'yx', 'yy', 'tx', 'ty', 'FrGA', 'frameRate', 'audioLevel', 'rotation',
|
|
244
|
+
'X ', 'Y ', 'redFloat', 'greenFloat', 'blueFloat', 'imageResolution',
|
|
245
|
+
'PuX0', 'PuX1', 'PuX2', 'PuX3', 'PuY0', 'PuY1', 'PuY2', 'PuY3'
|
|
246
|
+
],
|
|
247
|
+
'UntF': [
|
|
248
|
+
'sdwO', 'hglO', 'lagl', 'Lald', 'srgR', 'blur', 'Sftn', 'Opct', 'Dstn', 'Angl',
|
|
249
|
+
'Ckmt', 'Nose', 'Inpr', 'ShdN', 'strokeStyleLineWidth', 'strokeStyleLineDashOffset',
|
|
250
|
+
'strokeStyleOpacity', 'H ', 'Top ', 'Left', 'Btom', 'Rght', 'Rslt',
|
|
251
|
+
'topRight', 'topLeft', 'bottomLeft', 'bottomRight', 'ClNs', 'Shrp',
|
|
252
|
+
],
|
|
253
|
+
'VlLs': [
|
|
254
|
+
'Crv ', 'Clrs', 'Mnm ', 'Mxm ', 'Trns', 'pathList', 'strokeStyleLineDashSet', 'FrLs', 'slices',
|
|
255
|
+
'LaSt', 'Trnf', 'nonAffineTransform', 'keyDescriptorList', 'guideIndeces', 'gradientFillMulti',
|
|
256
|
+
'solidFillMulti', 'frameFXMulti', 'innerShadowMulti', 'dropShadowMulti', 'FrIn', 'FSts', 'FsFr',
|
|
257
|
+
'sheetTimelineOptions', 'audioClipList', 'trackList', 'globalTrackList', 'keyList', 'audioClipList',
|
|
258
|
+
'warpValues', 'selectedPin', 'Pts ', 'SbpL', 'pathComponents', 'pinOffsets', 'posFinalPins',
|
|
259
|
+
'pinVertexIndices', 'PinP', 'PnRt', 'PnOv', 'PnDp', 'filterFXList', 'puppetShapeList', 'ShrP',
|
|
260
|
+
'channelDenoise', 'Mtrx', 'layerSettings', 'list', 'compList', 'Adjs',
|
|
261
|
+
],
|
|
262
|
+
'ObAr': ['meshPoints', 'quiltSliceX', 'quiltSliceY'],
|
|
263
|
+
'obj ': ['null', 'Chnl'],
|
|
264
|
+
'Pth ': ['DspF'],
|
|
265
|
+
};
|
|
266
|
+
const channels = [
|
|
267
|
+
'Rd ', 'Grn ', 'Bl ', 'Yllw', 'Ylw ', 'Cyn ', 'Mgnt', 'Blck', 'Gry ', 'Lmnc', 'A ', 'B ',
|
|
268
|
+
];
|
|
269
|
+
const fieldToArrayType = {
|
|
270
|
+
'Mnm ': 'long',
|
|
271
|
+
'Mxm ': 'long',
|
|
272
|
+
FrLs: 'long',
|
|
273
|
+
strokeStyleLineDashSet: 'UntF',
|
|
274
|
+
Trnf: 'doub',
|
|
275
|
+
nonAffineTransform: 'doub',
|
|
276
|
+
keyDescriptorList: 'Objc',
|
|
277
|
+
gradientFillMulti: 'Objc',
|
|
278
|
+
solidFillMulti: 'Objc',
|
|
279
|
+
frameFXMulti: 'Objc',
|
|
280
|
+
innerShadowMulti: 'Objc',
|
|
281
|
+
dropShadowMulti: 'Objc',
|
|
282
|
+
LaSt: 'Objc',
|
|
283
|
+
FrIn: 'Objc',
|
|
284
|
+
FSts: 'Objc',
|
|
285
|
+
FsFr: 'long',
|
|
286
|
+
blendOptions: 'Objc',
|
|
287
|
+
sheetTimelineOptions: 'Objc',
|
|
288
|
+
keyList: 'Objc',
|
|
289
|
+
warpValues: 'doub',
|
|
290
|
+
selectedPin: 'long',
|
|
291
|
+
'Pts ': 'Objc',
|
|
292
|
+
SbpL: 'Objc',
|
|
293
|
+
pathComponents: 'Objc',
|
|
294
|
+
pinOffsets: 'doub',
|
|
295
|
+
posFinalPins: 'doub',
|
|
296
|
+
pinVertexIndices: 'long',
|
|
297
|
+
PinP: 'doub',
|
|
298
|
+
PnRt: 'long',
|
|
299
|
+
PnOv: 'bool',
|
|
300
|
+
PnDp: 'doub',
|
|
301
|
+
filterFXList: 'Objc',
|
|
302
|
+
puppetShapeList: 'Objc',
|
|
303
|
+
ShrP: 'Objc',
|
|
304
|
+
channelDenoise: 'Objc',
|
|
305
|
+
Mtrx: 'long',
|
|
306
|
+
compList: 'long',
|
|
307
|
+
Chnl: 'enum',
|
|
308
|
+
};
|
|
309
|
+
const fieldToType = {};
|
|
310
|
+
for (const type of Object.keys(typeToField)) {
|
|
311
|
+
for (const field of typeToField[type]) {
|
|
312
|
+
fieldToType[field] = type;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
for (const field of Object.keys(fieldToExtType)) {
|
|
316
|
+
if (!fieldToType[field])
|
|
317
|
+
fieldToType[field] = 'Objc';
|
|
318
|
+
}
|
|
319
|
+
for (const field of Object.keys(fieldToArrayExtType)) {
|
|
320
|
+
fieldToArrayType[field] = 'Objc';
|
|
321
|
+
}
|
|
322
|
+
function getTypeByKey(key, value, root, parent) {
|
|
323
|
+
if (key === 'presetKind') {
|
|
324
|
+
return typeof value === 'string' ? 'enum' : 'long';
|
|
325
|
+
}
|
|
326
|
+
if (key === 'null' && root === 'slices') {
|
|
327
|
+
return 'TEXT';
|
|
328
|
+
}
|
|
329
|
+
else if (key === 'groupID') {
|
|
330
|
+
return root === 'slices' ? 'long' : 'TEXT';
|
|
331
|
+
}
|
|
332
|
+
else if (key === 'Sz ') {
|
|
333
|
+
return ('Wdth' in value) ? 'Objc' : (('units' in value) ? 'UntF' : 'doub');
|
|
334
|
+
}
|
|
335
|
+
else if (key === 'Type') {
|
|
336
|
+
return typeof value === 'string' ? 'enum' : 'long';
|
|
337
|
+
}
|
|
338
|
+
else if (key === 'AntA') {
|
|
339
|
+
return typeof value === 'string' ? 'enum' : 'bool';
|
|
340
|
+
}
|
|
341
|
+
else if ((key === 'Hrzn' || key === 'Vrtc') && (parent.Type === 'keyType.Pstn' || parent._classID === 'Ofst')) {
|
|
342
|
+
return 'long';
|
|
343
|
+
}
|
|
344
|
+
else if (key === 'Hrzn' || key === 'Vrtc' || key === 'Top ' || key === 'Left' || key === 'Btom' || key === 'Rght') {
|
|
345
|
+
if (root === 'slices')
|
|
346
|
+
return 'long';
|
|
347
|
+
return typeof value === 'number' ? 'doub' : 'UntF';
|
|
348
|
+
}
|
|
349
|
+
else if (key === 'Vrsn') {
|
|
350
|
+
return typeof value === 'number' ? 'long' : 'Objc';
|
|
351
|
+
}
|
|
352
|
+
else if (key === 'Rd ' || key === 'Grn ' || key === 'Bl ') {
|
|
353
|
+
return root === 'artd' ? 'long' : 'doub';
|
|
354
|
+
}
|
|
355
|
+
else if (key === 'Trnf') {
|
|
356
|
+
return Array.isArray(value) ? 'VlLs' : 'Objc';
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
return fieldToType[key];
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
function readAsciiStringOrClassId(reader) {
|
|
363
|
+
const length = (0, psdReader_1.readInt32)(reader);
|
|
364
|
+
return (0, psdReader_1.readAsciiString)(reader, length || 4);
|
|
365
|
+
}
|
|
366
|
+
function writeAsciiStringOrClassId(writer, value) {
|
|
367
|
+
if (value.length === 4 && value !== 'warp' && value !== 'time' && value !== 'hold' && value !== 'list') {
|
|
368
|
+
// write classId
|
|
369
|
+
(0, psdWriter_1.writeInt32)(writer, 0);
|
|
370
|
+
(0, psdWriter_1.writeSignature)(writer, value);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
// write ascii string
|
|
374
|
+
(0, psdWriter_1.writeInt32)(writer, value.length);
|
|
375
|
+
for (let i = 0; i < value.length; i++) {
|
|
376
|
+
(0, psdWriter_1.writeUint8)(writer, value.charCodeAt(i));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function readDescriptorStructure(reader, includeClass) {
|
|
381
|
+
const struct = readClassStructure(reader);
|
|
382
|
+
const object = includeClass ? { _name: struct.name, _classID: struct.classID } : {};
|
|
383
|
+
// console.log('>> ', struct);
|
|
384
|
+
const itemsCount = (0, psdReader_1.readUint32)(reader);
|
|
385
|
+
for (let i = 0; i < itemsCount; i++) {
|
|
386
|
+
const key = readAsciiStringOrClassId(reader);
|
|
387
|
+
const type = (0, psdReader_1.readSignature)(reader);
|
|
388
|
+
// console.log(`> '${key}' '${type}'`);
|
|
389
|
+
const data = readOSType(reader, type, includeClass);
|
|
390
|
+
// if (!getTypeByKey(key, data)) console.log(`> '${key}' '${type}'`, data);
|
|
391
|
+
object[key] = data;
|
|
392
|
+
}
|
|
393
|
+
return object;
|
|
394
|
+
}
|
|
395
|
+
function writeDescriptorStructure(writer, name, classId, value, root) {
|
|
396
|
+
if (logErrors && !classId)
|
|
397
|
+
console.log('Missing classId for: ', name, classId, value);
|
|
398
|
+
// write class structure
|
|
399
|
+
(0, psdWriter_1.writeUnicodeStringWithPadding)(writer, name);
|
|
400
|
+
writeAsciiStringOrClassId(writer, classId);
|
|
401
|
+
const keys = Object.keys(value);
|
|
402
|
+
let keyCount = keys.length;
|
|
403
|
+
if ('_name' in value)
|
|
404
|
+
keyCount--;
|
|
405
|
+
if ('_classID' in value)
|
|
406
|
+
keyCount--;
|
|
407
|
+
(0, psdWriter_1.writeUint32)(writer, keyCount);
|
|
408
|
+
for (const key of keys) {
|
|
409
|
+
if (key === '_name' || key === '_classID')
|
|
410
|
+
continue;
|
|
411
|
+
let type = getTypeByKey(key, value[key], root, value);
|
|
412
|
+
let extType = fieldToExtType[key];
|
|
413
|
+
if (key === 'bounds' && root === 'text') {
|
|
414
|
+
extType = makeType('', 'bounds');
|
|
415
|
+
}
|
|
416
|
+
else if (key === 'origin') {
|
|
417
|
+
type = root === 'slices' ? 'enum' : 'Objc';
|
|
418
|
+
}
|
|
419
|
+
else if ((key === 'Cyn ' || key === 'Mgnt' || key === 'Ylw ' || key === 'Blck') && value._classID === 'CMYC') {
|
|
420
|
+
type = 'doub';
|
|
421
|
+
}
|
|
422
|
+
else if (/^PN[a-z][a-z]$/.test(key)) {
|
|
423
|
+
type = 'TEXT';
|
|
424
|
+
}
|
|
425
|
+
else if (/^PT[a-z][a-z]$/.test(key)) {
|
|
426
|
+
type = 'long';
|
|
427
|
+
}
|
|
428
|
+
else if (/^PF[a-z][a-z]$/.test(key)) {
|
|
429
|
+
type = 'doub';
|
|
430
|
+
}
|
|
431
|
+
else if ((key === 'Rds ' || key === 'Thsh') && typeof value[key] === 'number' && value._classID === 'SmrB') {
|
|
432
|
+
type = 'doub';
|
|
433
|
+
}
|
|
434
|
+
else if (key === 'ClSz' || key === 'Rds ' || key === 'Amnt') {
|
|
435
|
+
type = typeof value[key] === 'number' ? 'long' : 'UntF';
|
|
436
|
+
}
|
|
437
|
+
else if ((key === 'sdwM' || key === 'hglM') && typeof value[key] === 'string') {
|
|
438
|
+
type = 'enum';
|
|
439
|
+
}
|
|
440
|
+
else if (key === 'blur' && typeof value[key] === 'string') {
|
|
441
|
+
type = 'enum';
|
|
442
|
+
}
|
|
443
|
+
else if (key === 'Hght' && typeof value[key] === 'number' && value._classID === 'Embs') {
|
|
444
|
+
type = 'long';
|
|
445
|
+
}
|
|
446
|
+
else if (key === 'Angl' && typeof value[key] === 'number' && (value._classID === 'Embs' || value._classID === 'smartSharpen' || value._classID === 'Twrl' || value._classID === 'MtnB')) {
|
|
447
|
+
type = 'long';
|
|
448
|
+
}
|
|
449
|
+
else if (key === 'Angl' && typeof value[key] === 'number') {
|
|
450
|
+
type = 'doub'; // ???
|
|
451
|
+
}
|
|
452
|
+
else if (key === 'bounds' && root === 'slices') {
|
|
453
|
+
type = 'Objc';
|
|
454
|
+
extType = makeType('', 'Rct1');
|
|
455
|
+
}
|
|
456
|
+
else if (key === 'Scl ') {
|
|
457
|
+
if (typeof value[key] === 'object' && 'Hrzn' in value[key]) {
|
|
458
|
+
type = 'Objc';
|
|
459
|
+
extType = nullType;
|
|
460
|
+
}
|
|
461
|
+
else if (typeof value[key] === 'number') {
|
|
462
|
+
type = 'long';
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
type = 'UntF';
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else if (key === 'audioClipGroupList' && keys.length === 1) {
|
|
469
|
+
type = 'VlLs';
|
|
470
|
+
}
|
|
471
|
+
else if ((key === 'Strt' || key === 'Brgh') && 'H ' in value) {
|
|
472
|
+
type = 'doub';
|
|
473
|
+
}
|
|
474
|
+
else if (key === 'Wdth' && typeof value[key] === 'object') {
|
|
475
|
+
type = 'UntF';
|
|
476
|
+
}
|
|
477
|
+
else if (key === 'Ofst' && typeof value[key] === 'number') {
|
|
478
|
+
type = 'long';
|
|
479
|
+
}
|
|
480
|
+
else if (key === 'Strt' && typeof value[key] === 'object') {
|
|
481
|
+
type = 'Objc';
|
|
482
|
+
extType = nullType;
|
|
483
|
+
}
|
|
484
|
+
else if (channels.indexOf(key) !== -1) {
|
|
485
|
+
type = (classId === 'RGBC' && root !== 'artd') ? 'doub' : 'long';
|
|
486
|
+
}
|
|
487
|
+
else if (key === 'profile') {
|
|
488
|
+
type = classId === 'printOutput' ? 'TEXT' : 'tdta';
|
|
489
|
+
}
|
|
490
|
+
else if (key === 'strokeStyleContent') {
|
|
491
|
+
if (value[key]['Clr ']) {
|
|
492
|
+
extType = makeType('', 'solidColorLayer');
|
|
493
|
+
}
|
|
494
|
+
else if (value[key].Grad) {
|
|
495
|
+
extType = makeType('', 'gradientLayer');
|
|
496
|
+
}
|
|
497
|
+
else if (value[key].Ptrn) {
|
|
498
|
+
extType = makeType('', 'patternLayer');
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
logErrors && console.log('Invalid strokeStyleContent value', value[key]);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
else if (key === 'bounds' && root === 'quiltWarp') {
|
|
505
|
+
extType = makeType('', 'classFloatRect');
|
|
506
|
+
}
|
|
507
|
+
if (extType && extType.classID === 'RGBC') {
|
|
508
|
+
if ('H ' in value[key])
|
|
509
|
+
extType = { classID: 'HSBC', name: '' };
|
|
510
|
+
// TODO: other color spaces
|
|
511
|
+
}
|
|
512
|
+
writeAsciiStringOrClassId(writer, key);
|
|
513
|
+
(0, psdWriter_1.writeSignature)(writer, type || 'long');
|
|
514
|
+
writeOSType(writer, type || 'long', value[key], key, extType, root);
|
|
515
|
+
if (logErrors && !type)
|
|
516
|
+
console.log(`Missing descriptor field type for: '${key}' in`, value);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function readOSType(reader, type, includeClass) {
|
|
520
|
+
switch (type) {
|
|
521
|
+
case 'obj ': // Reference
|
|
522
|
+
return readReferenceStructure(reader);
|
|
523
|
+
case 'Objc': // Descriptor
|
|
524
|
+
case 'GlbO': // GlobalObject same as Descriptor
|
|
525
|
+
return readDescriptorStructure(reader, includeClass);
|
|
526
|
+
case 'VlLs': { // List
|
|
527
|
+
const length = (0, psdReader_1.readInt32)(reader);
|
|
528
|
+
const items = [];
|
|
529
|
+
for (let i = 0; i < length; i++) {
|
|
530
|
+
const itemType = (0, psdReader_1.readSignature)(reader);
|
|
531
|
+
// console.log(' >', itemType);
|
|
532
|
+
items.push(readOSType(reader, itemType, includeClass));
|
|
533
|
+
}
|
|
534
|
+
return items;
|
|
535
|
+
}
|
|
536
|
+
case 'doub': // Double
|
|
537
|
+
return (0, psdReader_1.readFloat64)(reader);
|
|
538
|
+
case 'UntF': { // Unit double
|
|
539
|
+
const units = (0, psdReader_1.readSignature)(reader);
|
|
540
|
+
const value = (0, psdReader_1.readFloat64)(reader);
|
|
541
|
+
if (!unitsMap[units])
|
|
542
|
+
throw new Error(`Invalid units: ${units}`);
|
|
543
|
+
return { units: unitsMap[units], value };
|
|
544
|
+
}
|
|
545
|
+
case 'UnFl': { // Unit float
|
|
546
|
+
const units = (0, psdReader_1.readSignature)(reader);
|
|
547
|
+
const value = (0, psdReader_1.readFloat32)(reader);
|
|
548
|
+
if (!unitsMap[units])
|
|
549
|
+
throw new Error(`Invalid units: ${units}`);
|
|
550
|
+
return { units: unitsMap[units], value };
|
|
551
|
+
}
|
|
552
|
+
case 'TEXT': // String
|
|
553
|
+
return (0, psdReader_1.readUnicodeString)(reader);
|
|
554
|
+
case 'enum': { // Enumerated
|
|
555
|
+
const enumType = readAsciiStringOrClassId(reader);
|
|
556
|
+
const value = readAsciiStringOrClassId(reader);
|
|
557
|
+
return `${enumType}.${value}`;
|
|
558
|
+
}
|
|
559
|
+
case 'long': // Integer
|
|
560
|
+
return (0, psdReader_1.readInt32)(reader);
|
|
561
|
+
case 'comp': { // Large Integer
|
|
562
|
+
const low = (0, psdReader_1.readUint32)(reader);
|
|
563
|
+
const high = (0, psdReader_1.readUint32)(reader);
|
|
564
|
+
return { low, high };
|
|
565
|
+
}
|
|
566
|
+
case 'bool': // Boolean
|
|
567
|
+
return !!(0, psdReader_1.readUint8)(reader);
|
|
568
|
+
case 'type': // Class
|
|
569
|
+
case 'GlbC': // Class
|
|
570
|
+
return readClassStructure(reader);
|
|
571
|
+
case 'alis': { // Alias
|
|
572
|
+
const length = (0, psdReader_1.readInt32)(reader);
|
|
573
|
+
return (0, psdReader_1.readAsciiString)(reader, length);
|
|
574
|
+
}
|
|
575
|
+
case 'tdta': { // Raw Data
|
|
576
|
+
const length = (0, psdReader_1.readInt32)(reader);
|
|
577
|
+
return (0, psdReader_1.readBytes)(reader, length);
|
|
578
|
+
}
|
|
579
|
+
case 'ObAr': { // Object array
|
|
580
|
+
(0, psdReader_1.readInt32)(reader); // version: 16
|
|
581
|
+
(0, psdReader_1.readUnicodeString)(reader); // name: ''
|
|
582
|
+
readAsciiStringOrClassId(reader); // 'rationalPoint'
|
|
583
|
+
const length = (0, psdReader_1.readInt32)(reader);
|
|
584
|
+
const items = [];
|
|
585
|
+
for (let i = 0; i < length; i++) {
|
|
586
|
+
const type1 = readAsciiStringOrClassId(reader); // type Hrzn | Vrtc
|
|
587
|
+
(0, psdReader_1.readSignature)(reader); // UnFl
|
|
588
|
+
(0, psdReader_1.readSignature)(reader); // units ? '#Pxl'
|
|
589
|
+
const valuesCount = (0, psdReader_1.readInt32)(reader);
|
|
590
|
+
const values = [];
|
|
591
|
+
for (let j = 0; j < valuesCount; j++) {
|
|
592
|
+
values.push((0, psdReader_1.readFloat64)(reader));
|
|
593
|
+
}
|
|
594
|
+
items.push({ type: type1, values });
|
|
595
|
+
}
|
|
596
|
+
return items;
|
|
597
|
+
}
|
|
598
|
+
case 'Pth ': { // File path
|
|
599
|
+
/*const length =*/ (0, psdReader_1.readInt32)(reader); // total size of all fields below
|
|
600
|
+
const sig = (0, psdReader_1.readSignature)(reader);
|
|
601
|
+
/*const pathSize =*/ (0, psdReader_1.readInt32LE)(reader); // the same as length
|
|
602
|
+
const charsCount = (0, psdReader_1.readInt32LE)(reader);
|
|
603
|
+
const path = (0, psdReader_1.readUnicodeStringWithLengthLE)(reader, charsCount);
|
|
604
|
+
return { sig, path };
|
|
605
|
+
}
|
|
606
|
+
default:
|
|
607
|
+
throw new Error(`Invalid TySh descriptor OSType: ${type} at ${reader.offset.toString(16)}`);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const ObArTypes = {
|
|
611
|
+
meshPoints: 'rationalPoint',
|
|
612
|
+
quiltSliceX: 'UntF',
|
|
613
|
+
quiltSliceY: 'UntF',
|
|
614
|
+
};
|
|
615
|
+
function writeOSType(writer, type, value, key, extType, root) {
|
|
616
|
+
switch (type) {
|
|
617
|
+
case 'obj ': // Reference
|
|
618
|
+
writeReferenceStructure(writer, key, value);
|
|
619
|
+
break;
|
|
620
|
+
case 'Objc': // Descriptor
|
|
621
|
+
case 'GlbO': { // GlobalObject same as Descriptor
|
|
622
|
+
if (typeof value !== 'object')
|
|
623
|
+
throw new Error(`Invalid struct value: ${JSON.stringify(value)}, key: ${key}`);
|
|
624
|
+
if (!extType)
|
|
625
|
+
throw new Error(`Missing ext type for: '${key}' (${JSON.stringify(value)})`);
|
|
626
|
+
const name = value._name || extType.name;
|
|
627
|
+
const classID = value._classID || extType.classID;
|
|
628
|
+
writeDescriptorStructure(writer, name, classID, value, root);
|
|
629
|
+
break;
|
|
630
|
+
}
|
|
631
|
+
case 'VlLs': // List
|
|
632
|
+
if (!Array.isArray(value))
|
|
633
|
+
throw new Error(`Invalid list value: ${JSON.stringify(value)}, key: ${key}`);
|
|
634
|
+
(0, psdWriter_1.writeInt32)(writer, value.length);
|
|
635
|
+
for (let i = 0; i < value.length; i++) {
|
|
636
|
+
const type = fieldToArrayType[key];
|
|
637
|
+
(0, psdWriter_1.writeSignature)(writer, type || 'long');
|
|
638
|
+
writeOSType(writer, type || 'long', value[i], `${key}[]`, fieldToArrayExtType[key], root);
|
|
639
|
+
if (logErrors && !type)
|
|
640
|
+
console.log(`Missing descriptor array type for: '${key}' in`, value);
|
|
641
|
+
}
|
|
642
|
+
break;
|
|
643
|
+
case 'doub': // Double
|
|
644
|
+
if (typeof value !== 'number')
|
|
645
|
+
throw new Error(`Invalid number value: ${JSON.stringify(value)}, key: ${key}`);
|
|
646
|
+
(0, psdWriter_1.writeFloat64)(writer, value);
|
|
647
|
+
break;
|
|
648
|
+
case 'UntF': // Unit double
|
|
649
|
+
if (!unitsMapRev[value.units])
|
|
650
|
+
throw new Error(`Invalid units: ${value.units} in ${key}`);
|
|
651
|
+
(0, psdWriter_1.writeSignature)(writer, unitsMapRev[value.units]);
|
|
652
|
+
(0, psdWriter_1.writeFloat64)(writer, value.value);
|
|
653
|
+
break;
|
|
654
|
+
case 'UnFl': // Unit float
|
|
655
|
+
if (!unitsMapRev[value.units])
|
|
656
|
+
throw new Error(`Invalid units: ${value.units} in ${key}`);
|
|
657
|
+
(0, psdWriter_1.writeSignature)(writer, unitsMapRev[value.units]);
|
|
658
|
+
(0, psdWriter_1.writeFloat32)(writer, value.value);
|
|
659
|
+
break;
|
|
660
|
+
case 'TEXT': // String
|
|
661
|
+
(0, psdWriter_1.writeUnicodeStringWithPadding)(writer, value);
|
|
662
|
+
break;
|
|
663
|
+
case 'enum': { // Enumerated
|
|
664
|
+
if (typeof value !== 'string')
|
|
665
|
+
throw new Error(`Invalid enum value: ${JSON.stringify(value)}, key: ${key}`);
|
|
666
|
+
const [_type, val] = value.split('.');
|
|
667
|
+
writeAsciiStringOrClassId(writer, _type);
|
|
668
|
+
writeAsciiStringOrClassId(writer, val);
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
case 'long': // Integer
|
|
672
|
+
if (typeof value !== 'number')
|
|
673
|
+
throw new Error(`Invalid integer value: ${JSON.stringify(value)}, key: ${key}`);
|
|
674
|
+
(0, psdWriter_1.writeInt32)(writer, value);
|
|
675
|
+
break;
|
|
676
|
+
// case 'comp': // Large Integer
|
|
677
|
+
// writeLargeInteger(reader);
|
|
678
|
+
case 'bool': // Boolean
|
|
679
|
+
if (typeof value !== 'boolean')
|
|
680
|
+
throw new Error(`Invalid boolean value: ${JSON.stringify(value)}, key: ${key}`);
|
|
681
|
+
(0, psdWriter_1.writeUint8)(writer, value ? 1 : 0);
|
|
682
|
+
break;
|
|
683
|
+
// case 'type': // Class
|
|
684
|
+
// case 'GlbC': // Class
|
|
685
|
+
// writeClassStructure(reader);
|
|
686
|
+
// case 'alis': // Alias
|
|
687
|
+
// writeAliasStructure(reader);
|
|
688
|
+
case 'tdta': // Raw Data
|
|
689
|
+
(0, psdWriter_1.writeInt32)(writer, value.byteLength);
|
|
690
|
+
(0, psdWriter_1.writeBytes)(writer, value);
|
|
691
|
+
break;
|
|
692
|
+
case 'ObAr': { // Object array
|
|
693
|
+
(0, psdWriter_1.writeInt32)(writer, 16); // version
|
|
694
|
+
(0, psdWriter_1.writeUnicodeStringWithPadding)(writer, ''); // name
|
|
695
|
+
const type = ObArTypes[key];
|
|
696
|
+
if (!type)
|
|
697
|
+
throw new Error(`Not implemented ObArType for: ${key}`);
|
|
698
|
+
writeAsciiStringOrClassId(writer, type);
|
|
699
|
+
(0, psdWriter_1.writeInt32)(writer, value.length);
|
|
700
|
+
for (let i = 0; i < value.length; i++) {
|
|
701
|
+
writeAsciiStringOrClassId(writer, value[i].type); // Hrzn | Vrtc
|
|
702
|
+
(0, psdWriter_1.writeSignature)(writer, 'UnFl');
|
|
703
|
+
(0, psdWriter_1.writeSignature)(writer, '#Pxl');
|
|
704
|
+
(0, psdWriter_1.writeInt32)(writer, value[i].values.length);
|
|
705
|
+
for (let j = 0; j < value[i].values.length; j++) {
|
|
706
|
+
(0, psdWriter_1.writeFloat64)(writer, value[i].values[j]);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
case 'Pth ': { // File path
|
|
712
|
+
const length = 4 + 4 + 4 + value.path.length * 2;
|
|
713
|
+
(0, psdWriter_1.writeInt32)(writer, length);
|
|
714
|
+
(0, psdWriter_1.writeSignature)(writer, value.sig);
|
|
715
|
+
(0, psdWriter_1.writeInt32LE)(writer, length);
|
|
716
|
+
(0, psdWriter_1.writeInt32LE)(writer, value.path.length);
|
|
717
|
+
(0, psdWriter_1.writeUnicodeStringWithoutLengthLE)(writer, value.path);
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
default:
|
|
721
|
+
throw new Error(`Not implemented descriptor OSType: ${type}`);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
function readReferenceStructure(reader) {
|
|
725
|
+
const itemsCount = (0, psdReader_1.readInt32)(reader);
|
|
726
|
+
const items = [];
|
|
727
|
+
for (let i = 0; i < itemsCount; i++) {
|
|
728
|
+
const type = (0, psdReader_1.readSignature)(reader);
|
|
729
|
+
switch (type) {
|
|
730
|
+
case 'prop': { // Property
|
|
731
|
+
readClassStructure(reader);
|
|
732
|
+
const keyID = readAsciiStringOrClassId(reader);
|
|
733
|
+
items.push(keyID);
|
|
734
|
+
break;
|
|
735
|
+
}
|
|
736
|
+
case 'Clss': // Class
|
|
737
|
+
items.push(readClassStructure(reader));
|
|
738
|
+
break;
|
|
739
|
+
case 'Enmr': { // Enumerated Reference
|
|
740
|
+
readClassStructure(reader);
|
|
741
|
+
const typeID = readAsciiStringOrClassId(reader);
|
|
742
|
+
const value = readAsciiStringOrClassId(reader);
|
|
743
|
+
items.push(`${typeID}.${value}`);
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
case 'rele': { // Offset
|
|
747
|
+
// const { name, classID } =
|
|
748
|
+
readClassStructure(reader);
|
|
749
|
+
items.push((0, psdReader_1.readUint32)(reader));
|
|
750
|
+
break;
|
|
751
|
+
}
|
|
752
|
+
case 'Idnt': // Identifier
|
|
753
|
+
items.push((0, psdReader_1.readInt32)(reader));
|
|
754
|
+
break;
|
|
755
|
+
case 'indx': // Index
|
|
756
|
+
items.push((0, psdReader_1.readInt32)(reader));
|
|
757
|
+
break;
|
|
758
|
+
case 'name': { // Name
|
|
759
|
+
readClassStructure(reader);
|
|
760
|
+
items.push((0, psdReader_1.readUnicodeString)(reader));
|
|
761
|
+
break;
|
|
762
|
+
}
|
|
763
|
+
default:
|
|
764
|
+
throw new Error(`Invalid descriptor reference type: ${type}`);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return items;
|
|
768
|
+
}
|
|
769
|
+
function writeReferenceStructure(writer, _key, items) {
|
|
770
|
+
(0, psdWriter_1.writeInt32)(writer, items.length);
|
|
771
|
+
for (let i = 0; i < items.length; i++) {
|
|
772
|
+
const value = items[i];
|
|
773
|
+
let type = 'unknown';
|
|
774
|
+
if (typeof value === 'string') {
|
|
775
|
+
if (/^[a-z ]+\.[a-z ]+$/i.test(value)) {
|
|
776
|
+
type = 'Enmr';
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
type = 'name';
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
(0, psdWriter_1.writeSignature)(writer, type);
|
|
783
|
+
switch (type) {
|
|
784
|
+
// case 'prop': // Property
|
|
785
|
+
// case 'Clss': // Class
|
|
786
|
+
case 'Enmr': { // Enumerated Reference
|
|
787
|
+
const [typeID, enumValue] = value.split('.');
|
|
788
|
+
writeClassStructure(writer, '\0', typeID);
|
|
789
|
+
writeAsciiStringOrClassId(writer, typeID);
|
|
790
|
+
writeAsciiStringOrClassId(writer, enumValue);
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
// case 'rele': // Offset
|
|
794
|
+
// case 'Idnt': // Identifier
|
|
795
|
+
// case 'indx': // Index
|
|
796
|
+
case 'name': { // Name
|
|
797
|
+
writeClassStructure(writer, '\0', 'Lyr ');
|
|
798
|
+
(0, psdWriter_1.writeUnicodeString)(writer, value + '\0');
|
|
799
|
+
break;
|
|
800
|
+
}
|
|
801
|
+
default:
|
|
802
|
+
throw new Error(`Invalid descriptor reference type: ${type}`);
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return items;
|
|
806
|
+
}
|
|
807
|
+
function readClassStructure(reader) {
|
|
808
|
+
const name = (0, psdReader_1.readUnicodeString)(reader);
|
|
809
|
+
const classID = readAsciiStringOrClassId(reader);
|
|
810
|
+
return { name, classID };
|
|
811
|
+
}
|
|
812
|
+
function writeClassStructure(writer, name, classID) {
|
|
813
|
+
(0, psdWriter_1.writeUnicodeString)(writer, name);
|
|
814
|
+
writeAsciiStringOrClassId(writer, classID);
|
|
815
|
+
}
|
|
816
|
+
function readVersionAndDescriptor(reader, includeClass = false) {
|
|
817
|
+
const version = (0, psdReader_1.readUint32)(reader);
|
|
818
|
+
if (version !== 16)
|
|
819
|
+
throw new Error(`Invalid descriptor version: ${version}`);
|
|
820
|
+
const desc = readDescriptorStructure(reader, includeClass);
|
|
821
|
+
// console.log(require('util').inspect(desc, false, 99, true));
|
|
822
|
+
return desc;
|
|
823
|
+
}
|
|
824
|
+
function writeVersionAndDescriptor(writer, name, classID, descriptor, root = '') {
|
|
825
|
+
(0, psdWriter_1.writeUint32)(writer, 16); // version
|
|
826
|
+
writeDescriptorStructure(writer, name, classID, descriptor, root);
|
|
827
|
+
}
|
|
828
|
+
function horzVrtcToXY(hv) {
|
|
829
|
+
return { x: hv.Hrzn, y: hv.Vrtc };
|
|
830
|
+
}
|
|
831
|
+
function xyToHorzVrtc(xy) {
|
|
832
|
+
return { Hrzn: xy.x, Vrtc: xy.y };
|
|
833
|
+
}
|
|
834
|
+
function descBoundsToBounds(desc) {
|
|
835
|
+
return {
|
|
836
|
+
top: parseUnits(desc['Top ']),
|
|
837
|
+
left: parseUnits(desc.Left),
|
|
838
|
+
right: parseUnits(desc.Rght),
|
|
839
|
+
bottom: parseUnits(desc.Btom),
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
function boundsToDescBounds(bounds) {
|
|
843
|
+
return {
|
|
844
|
+
Left: unitsValue(bounds.left, 'bounds.left'),
|
|
845
|
+
['Top ']: unitsValue(bounds.top, 'bounds.top'),
|
|
846
|
+
Rght: unitsValue(bounds.right, 'bounds.right'),
|
|
847
|
+
Btom: unitsValue(bounds.bottom, 'bounds.bottom'),
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
function parseFxObject(fx) {
|
|
851
|
+
const stroke = {
|
|
852
|
+
enabled: !!fx.enab,
|
|
853
|
+
position: exports.FStl.decode(fx.Styl),
|
|
854
|
+
fillType: exports.FrFl.decode(fx.PntT),
|
|
855
|
+
blendMode: exports.BlnM.decode(fx['Md ']),
|
|
856
|
+
opacity: parsePercent(fx.Opct),
|
|
857
|
+
size: parseUnits(fx['Sz ']),
|
|
858
|
+
};
|
|
859
|
+
if (fx.present !== undefined)
|
|
860
|
+
stroke.present = fx.present;
|
|
861
|
+
if (fx.showInDialog !== undefined)
|
|
862
|
+
stroke.showInDialog = fx.showInDialog;
|
|
863
|
+
if (fx.overprint !== undefined)
|
|
864
|
+
stroke.overprint = fx.overprint;
|
|
865
|
+
if (fx['Clr '])
|
|
866
|
+
stroke.color = parseColor(fx['Clr ']);
|
|
867
|
+
if (fx.Grad)
|
|
868
|
+
stroke.gradient = parseGradientContent(fx);
|
|
869
|
+
if (fx.Ptrn)
|
|
870
|
+
stroke.pattern = parsePatternContent(fx);
|
|
871
|
+
return stroke;
|
|
872
|
+
}
|
|
873
|
+
function serializeFxObject(stroke) {
|
|
874
|
+
let FrFX = {};
|
|
875
|
+
FrFX.enab = !!stroke.enabled;
|
|
876
|
+
if (stroke.present !== undefined)
|
|
877
|
+
FrFX.present = !!stroke.present;
|
|
878
|
+
if (stroke.showInDialog !== undefined)
|
|
879
|
+
FrFX.showInDialog = !!stroke.showInDialog;
|
|
880
|
+
FrFX.Styl = exports.FStl.encode(stroke.position);
|
|
881
|
+
FrFX.PntT = exports.FrFl.encode(stroke.fillType);
|
|
882
|
+
FrFX['Md '] = exports.BlnM.encode(stroke.blendMode);
|
|
883
|
+
FrFX.Opct = unitsPercent(stroke.opacity);
|
|
884
|
+
FrFX['Sz '] = unitsValue(stroke.size, 'size');
|
|
885
|
+
if (stroke.color)
|
|
886
|
+
FrFX['Clr '] = serializeColor(stroke.color);
|
|
887
|
+
if (stroke.gradient)
|
|
888
|
+
FrFX = Object.assign(Object.assign({}, FrFX), serializeGradientContent(stroke.gradient));
|
|
889
|
+
if (stroke.pattern)
|
|
890
|
+
FrFX = Object.assign(Object.assign({}, FrFX), serializePatternContent(stroke.pattern));
|
|
891
|
+
if (stroke.overprint !== undefined)
|
|
892
|
+
FrFX.overprint = !!stroke.overprint;
|
|
893
|
+
return FrFX;
|
|
894
|
+
}
|
|
895
|
+
function serializeEffects(e, log, multi) {
|
|
896
|
+
var _a, _b, _c;
|
|
897
|
+
const info = multi ? {
|
|
898
|
+
'Scl ': unitsPercentF((_a = e.scale) !== null && _a !== void 0 ? _a : 1),
|
|
899
|
+
masterFXSwitch: !e.disabled,
|
|
900
|
+
} : {
|
|
901
|
+
masterFXSwitch: !e.disabled,
|
|
902
|
+
'Scl ': unitsPercentF((_b = e.scale) !== null && _b !== void 0 ? _b : 1),
|
|
903
|
+
};
|
|
904
|
+
const arrayKeys = ['dropShadow', 'innerShadow', 'solidFill', 'gradientOverlay', 'stroke'];
|
|
905
|
+
for (const key of arrayKeys) {
|
|
906
|
+
if (e[key] && !Array.isArray(e[key]))
|
|
907
|
+
throw new Error(`${key} should be an array`);
|
|
908
|
+
}
|
|
909
|
+
const useMulti = (arr) => !!arr && arr.length > 1 && multi;
|
|
910
|
+
const useSingle = (arr) => !!arr && arr.length >= 1 && (!multi || arr.length === 1);
|
|
911
|
+
if (useSingle(e.dropShadow))
|
|
912
|
+
info.DrSh = serializeEffectObject(e.dropShadow[0], 'dropShadow', log);
|
|
913
|
+
if (useMulti(e.dropShadow))
|
|
914
|
+
info.dropShadowMulti = e.dropShadow.map(i => serializeEffectObject(i, 'dropShadow', log));
|
|
915
|
+
if (useSingle(e.innerShadow))
|
|
916
|
+
info.IrSh = serializeEffectObject(e.innerShadow[0], 'innerShadow', log);
|
|
917
|
+
if (useMulti(e.innerShadow))
|
|
918
|
+
info.innerShadowMulti = e.innerShadow.map(i => serializeEffectObject(i, 'innerShadow', log));
|
|
919
|
+
if (e.outerGlow)
|
|
920
|
+
info.OrGl = serializeEffectObject(e.outerGlow, 'outerGlow', log);
|
|
921
|
+
if (useMulti(e.solidFill))
|
|
922
|
+
info.solidFillMulti = e.solidFill.map(i => serializeEffectObject(i, 'solidFill', log));
|
|
923
|
+
if (useMulti(e.gradientOverlay))
|
|
924
|
+
info.gradientFillMulti = e.gradientOverlay.map(i => serializeEffectObject(i, 'gradientOverlay', log));
|
|
925
|
+
if (useMulti(e.stroke))
|
|
926
|
+
info.frameFXMulti = e.stroke.map(i => serializeFxObject(i));
|
|
927
|
+
if (e.innerGlow)
|
|
928
|
+
info.IrGl = serializeEffectObject(e.innerGlow, 'innerGlow', log);
|
|
929
|
+
if (e.bevel)
|
|
930
|
+
info.ebbl = serializeEffectObject(e.bevel, 'bevel', log);
|
|
931
|
+
if (useSingle(e.solidFill))
|
|
932
|
+
info.SoFi = serializeEffectObject(e.solidFill[0], 'solidFill', log);
|
|
933
|
+
if (e.patternOverlay)
|
|
934
|
+
info.patternFill = serializeEffectObject(e.patternOverlay, 'patternOverlay', log);
|
|
935
|
+
if (useSingle(e.gradientOverlay))
|
|
936
|
+
info.GrFl = serializeEffectObject(e.gradientOverlay[0], 'gradientOverlay', log);
|
|
937
|
+
if (e.satin)
|
|
938
|
+
info.ChFX = serializeEffectObject(e.satin, 'satin', log);
|
|
939
|
+
if (useSingle(e.stroke))
|
|
940
|
+
info.FrFX = serializeFxObject((_c = e.stroke) === null || _c === void 0 ? void 0 : _c[0]);
|
|
941
|
+
if (multi) {
|
|
942
|
+
info.numModifyingFX = 0;
|
|
943
|
+
for (const key of Object.keys(e)) {
|
|
944
|
+
const value = e[key];
|
|
945
|
+
if (Array.isArray(value)) {
|
|
946
|
+
for (const effect of value) {
|
|
947
|
+
if (effect.enabled)
|
|
948
|
+
info.numModifyingFX++;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
else if (value.enabled) {
|
|
952
|
+
info.numModifyingFX++;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return info;
|
|
957
|
+
}
|
|
958
|
+
function parseEffects(info, log) {
|
|
959
|
+
const effects = {};
|
|
960
|
+
const { masterFXSwitch, DrSh, dropShadowMulti, IrSh, innerShadowMulti, OrGl, IrGl, ebbl, SoFi, solidFillMulti, patternFill, GrFl, gradientFillMulti, ChFX, FrFX, frameFXMulti, numModifyingFX } = info, rest = __rest(info, ["masterFXSwitch", "DrSh", "dropShadowMulti", "IrSh", "innerShadowMulti", "OrGl", "IrGl", "ebbl", "SoFi", "solidFillMulti", "patternFill", "GrFl", "gradientFillMulti", "ChFX", "FrFX", "frameFXMulti", "numModifyingFX"]);
|
|
961
|
+
if (!masterFXSwitch)
|
|
962
|
+
effects.disabled = true;
|
|
963
|
+
if (info['Scl '])
|
|
964
|
+
effects.scale = parsePercent(info['Scl ']);
|
|
965
|
+
if (DrSh)
|
|
966
|
+
effects.dropShadow = [parseEffectObject(DrSh, log)];
|
|
967
|
+
if (dropShadowMulti)
|
|
968
|
+
effects.dropShadow = dropShadowMulti.map(i => parseEffectObject(i, log));
|
|
969
|
+
if (IrSh)
|
|
970
|
+
effects.innerShadow = [parseEffectObject(IrSh, log)];
|
|
971
|
+
if (innerShadowMulti)
|
|
972
|
+
effects.innerShadow = innerShadowMulti.map(i => parseEffectObject(i, log));
|
|
973
|
+
if (OrGl)
|
|
974
|
+
effects.outerGlow = parseEffectObject(OrGl, log);
|
|
975
|
+
if (IrGl)
|
|
976
|
+
effects.innerGlow = parseEffectObject(IrGl, log);
|
|
977
|
+
if (ebbl)
|
|
978
|
+
effects.bevel = parseEffectObject(ebbl, log);
|
|
979
|
+
if (SoFi)
|
|
980
|
+
effects.solidFill = [parseEffectObject(SoFi, log)];
|
|
981
|
+
if (solidFillMulti)
|
|
982
|
+
effects.solidFill = solidFillMulti.map(i => parseEffectObject(i, log));
|
|
983
|
+
if (patternFill)
|
|
984
|
+
effects.patternOverlay = parseEffectObject(patternFill, log);
|
|
985
|
+
if (GrFl)
|
|
986
|
+
effects.gradientOverlay = [parseEffectObject(GrFl, log)];
|
|
987
|
+
if (gradientFillMulti)
|
|
988
|
+
effects.gradientOverlay = gradientFillMulti.map(i => parseEffectObject(i, log));
|
|
989
|
+
if (ChFX)
|
|
990
|
+
effects.satin = parseEffectObject(ChFX, log);
|
|
991
|
+
if (FrFX)
|
|
992
|
+
effects.stroke = [parseFxObject(FrFX)];
|
|
993
|
+
if (frameFXMulti)
|
|
994
|
+
effects.stroke = frameFXMulti.map(i => parseFxObject(i));
|
|
995
|
+
if (log && Object.keys(rest).length > 1)
|
|
996
|
+
console.log('Unhandled effect keys:', rest);
|
|
997
|
+
return effects;
|
|
998
|
+
}
|
|
999
|
+
function parseKeyList(keyList, logMissingFeatures) {
|
|
1000
|
+
const keys = [];
|
|
1001
|
+
for (let j = 0; j < keyList.length; j++) {
|
|
1002
|
+
const key = keyList[j];
|
|
1003
|
+
const { time: { denominator, numerator }, selected, animKey } = key;
|
|
1004
|
+
const time = { numerator, denominator };
|
|
1005
|
+
const interpolation = exports.animInterpStyleEnum.decode(key.animInterpStyle);
|
|
1006
|
+
switch (animKey.Type) {
|
|
1007
|
+
case 'keyType.Opct':
|
|
1008
|
+
keys.push({ interpolation, time, selected, type: 'opacity', value: parsePercent(animKey.Opct) });
|
|
1009
|
+
break;
|
|
1010
|
+
case 'keyType.Pstn':
|
|
1011
|
+
keys.push({ interpolation, time, selected, type: 'position', x: animKey.Hrzn, y: animKey.Vrtc });
|
|
1012
|
+
break;
|
|
1013
|
+
case 'keyType.Trnf':
|
|
1014
|
+
keys.push({
|
|
1015
|
+
interpolation, time, selected, type: 'transform',
|
|
1016
|
+
scale: horzVrtcToXY(animKey['Scl ']), skew: horzVrtcToXY(animKey.Skew), rotation: animKey.rotation, translation: horzVrtcToXY(animKey.translation)
|
|
1017
|
+
});
|
|
1018
|
+
break;
|
|
1019
|
+
case 'keyType.sheetStyle': {
|
|
1020
|
+
const key = { interpolation, time, selected, type: 'style' };
|
|
1021
|
+
if (animKey.sheetStyle.Lefx)
|
|
1022
|
+
key.style = parseEffects(animKey.sheetStyle.Lefx, logMissingFeatures);
|
|
1023
|
+
keys.push(key);
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
case 'keyType.globalLighting': {
|
|
1027
|
+
keys.push({
|
|
1028
|
+
interpolation, time, selected, type: 'globalLighting',
|
|
1029
|
+
globalAngle: animKey.gblA, globalAltitude: animKey.globalAltitude
|
|
1030
|
+
});
|
|
1031
|
+
break;
|
|
1032
|
+
}
|
|
1033
|
+
default: throw new Error(`Unsupported keyType value`);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
return keys;
|
|
1037
|
+
}
|
|
1038
|
+
function serializeKeyList(keys) {
|
|
1039
|
+
const keyList = [];
|
|
1040
|
+
for (let j = 0; j < keys.length; j++) {
|
|
1041
|
+
const key = keys[j];
|
|
1042
|
+
const { time, selected = false, interpolation } = key;
|
|
1043
|
+
const animInterpStyle = exports.animInterpStyleEnum.encode(interpolation);
|
|
1044
|
+
let animKey;
|
|
1045
|
+
switch (key.type) {
|
|
1046
|
+
case 'opacity':
|
|
1047
|
+
animKey = { Type: 'keyType.Opct', Opct: unitsPercent(key.value) };
|
|
1048
|
+
break;
|
|
1049
|
+
case 'position':
|
|
1050
|
+
animKey = { Type: 'keyType.Pstn', Hrzn: key.x, Vrtc: key.y };
|
|
1051
|
+
break;
|
|
1052
|
+
case 'transform':
|
|
1053
|
+
animKey = { Type: 'keyType.Trnf', 'Scl ': xyToHorzVrtc(key.scale), Skew: xyToHorzVrtc(key.skew), rotation: key.rotation, translation: xyToHorzVrtc(key.translation) };
|
|
1054
|
+
break;
|
|
1055
|
+
case 'style':
|
|
1056
|
+
animKey = { Type: 'keyType.sheetStyle', sheetStyle: { Vrsn: 1, blendOptions: {} } };
|
|
1057
|
+
if (key.style)
|
|
1058
|
+
animKey.sheetStyle = { Vrsn: 1, Lefx: serializeEffects(key.style, false, false), blendOptions: {} };
|
|
1059
|
+
break;
|
|
1060
|
+
case 'globalLighting': {
|
|
1061
|
+
animKey = { Type: 'keyType.globalLighting', gblA: key.globalAngle, globalAltitude: key.globalAltitude };
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
default: throw new Error(`Unsupported keyType value`);
|
|
1065
|
+
}
|
|
1066
|
+
keyList.push({ Vrsn: 1, animInterpStyle, time, animKey, selected });
|
|
1067
|
+
}
|
|
1068
|
+
return keyList;
|
|
1069
|
+
}
|
|
1070
|
+
function parseTrackList(trackList, logMissingFeatures) {
|
|
1071
|
+
const tracks = [];
|
|
1072
|
+
for (let i = 0; i < trackList.length; i++) {
|
|
1073
|
+
const tr = trackList[i];
|
|
1074
|
+
const track = {
|
|
1075
|
+
type: exports.stdTrackID.decode(tr.trackID),
|
|
1076
|
+
enabled: tr.enab,
|
|
1077
|
+
keys: parseKeyList(tr.keyList, logMissingFeatures),
|
|
1078
|
+
};
|
|
1079
|
+
if (tr.effectParams) {
|
|
1080
|
+
track.effectParams = {
|
|
1081
|
+
fillCanvas: tr.effectParams.fillCanvas,
|
|
1082
|
+
zoomOrigin: tr.effectParams.zoomOrigin,
|
|
1083
|
+
keys: parseKeyList(tr.effectParams.keyList, logMissingFeatures),
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
tracks.push(track);
|
|
1087
|
+
}
|
|
1088
|
+
return tracks;
|
|
1089
|
+
}
|
|
1090
|
+
function serializeTrackList(tracks) {
|
|
1091
|
+
const trackList = [];
|
|
1092
|
+
for (let i = 0; i < tracks.length; i++) {
|
|
1093
|
+
const t = tracks[i];
|
|
1094
|
+
trackList.push(Object.assign(Object.assign({ trackID: exports.stdTrackID.encode(t.type), Vrsn: 1, enab: !!t.enabled, Effc: !!t.effectParams }, (t.effectParams ? {
|
|
1095
|
+
effectParams: {
|
|
1096
|
+
keyList: serializeKeyList(t.keys),
|
|
1097
|
+
fillCanvas: t.effectParams.fillCanvas,
|
|
1098
|
+
zoomOrigin: t.effectParams.zoomOrigin,
|
|
1099
|
+
}
|
|
1100
|
+
} : {})), { keyList: serializeKeyList(t.keys) }));
|
|
1101
|
+
}
|
|
1102
|
+
return trackList;
|
|
1103
|
+
}
|
|
1104
|
+
function parseEffectObject(obj, reportErrors) {
|
|
1105
|
+
const result = {};
|
|
1106
|
+
for (const key of Object.keys(obj)) {
|
|
1107
|
+
const val = obj[key];
|
|
1108
|
+
switch (key) {
|
|
1109
|
+
case 'enab':
|
|
1110
|
+
result.enabled = !!val;
|
|
1111
|
+
break;
|
|
1112
|
+
case 'uglg':
|
|
1113
|
+
result.useGlobalLight = !!val;
|
|
1114
|
+
break;
|
|
1115
|
+
case 'AntA':
|
|
1116
|
+
result.antialiased = !!val;
|
|
1117
|
+
break;
|
|
1118
|
+
case 'Algn':
|
|
1119
|
+
result.align = !!val;
|
|
1120
|
+
break;
|
|
1121
|
+
case 'Dthr':
|
|
1122
|
+
result.dither = !!val;
|
|
1123
|
+
break;
|
|
1124
|
+
case 'Invr':
|
|
1125
|
+
result.invert = !!val;
|
|
1126
|
+
break;
|
|
1127
|
+
case 'Rvrs':
|
|
1128
|
+
result.reverse = !!val;
|
|
1129
|
+
break;
|
|
1130
|
+
case 'Clr ':
|
|
1131
|
+
result.color = parseColor(val);
|
|
1132
|
+
break;
|
|
1133
|
+
case 'hglC':
|
|
1134
|
+
result.highlightColor = parseColor(val);
|
|
1135
|
+
break;
|
|
1136
|
+
case 'sdwC':
|
|
1137
|
+
result.shadowColor = parseColor(val);
|
|
1138
|
+
break;
|
|
1139
|
+
case 'Styl':
|
|
1140
|
+
result.position = exports.FStl.decode(val);
|
|
1141
|
+
break;
|
|
1142
|
+
case 'Md ':
|
|
1143
|
+
result.blendMode = exports.BlnM.decode(val);
|
|
1144
|
+
break;
|
|
1145
|
+
case 'hglM':
|
|
1146
|
+
result.highlightBlendMode = exports.BlnM.decode(val);
|
|
1147
|
+
break;
|
|
1148
|
+
case 'sdwM':
|
|
1149
|
+
result.shadowBlendMode = exports.BlnM.decode(val);
|
|
1150
|
+
break;
|
|
1151
|
+
case 'bvlS':
|
|
1152
|
+
result.style = exports.BESl.decode(val);
|
|
1153
|
+
break;
|
|
1154
|
+
case 'bvlD':
|
|
1155
|
+
result.direction = exports.BESs.decode(val);
|
|
1156
|
+
break;
|
|
1157
|
+
case 'bvlT':
|
|
1158
|
+
result.technique = exports.bvlT.decode(val);
|
|
1159
|
+
break;
|
|
1160
|
+
case 'GlwT':
|
|
1161
|
+
result.technique = exports.BETE.decode(val);
|
|
1162
|
+
break;
|
|
1163
|
+
case 'glwS':
|
|
1164
|
+
result.source = exports.IGSr.decode(val);
|
|
1165
|
+
break;
|
|
1166
|
+
case 'Type':
|
|
1167
|
+
result.type = exports.GrdT.decode(val);
|
|
1168
|
+
break;
|
|
1169
|
+
case 'gs99':
|
|
1170
|
+
result.interpolationMethod = exports.gradientInterpolationMethodType.decode(val);
|
|
1171
|
+
break;
|
|
1172
|
+
case 'Opct':
|
|
1173
|
+
result.opacity = parsePercent(val);
|
|
1174
|
+
break;
|
|
1175
|
+
case 'hglO':
|
|
1176
|
+
result.highlightOpacity = parsePercent(val);
|
|
1177
|
+
break;
|
|
1178
|
+
case 'sdwO':
|
|
1179
|
+
result.shadowOpacity = parsePercent(val);
|
|
1180
|
+
break;
|
|
1181
|
+
case 'lagl':
|
|
1182
|
+
result.angle = parseAngle(val);
|
|
1183
|
+
break;
|
|
1184
|
+
case 'Angl':
|
|
1185
|
+
result.angle = parseAngle(val);
|
|
1186
|
+
break;
|
|
1187
|
+
case 'Lald':
|
|
1188
|
+
result.altitude = parseAngle(val);
|
|
1189
|
+
break;
|
|
1190
|
+
case 'Sftn':
|
|
1191
|
+
result.soften = parseUnits(val);
|
|
1192
|
+
break;
|
|
1193
|
+
case 'srgR':
|
|
1194
|
+
result.strength = parsePercent(val);
|
|
1195
|
+
break;
|
|
1196
|
+
case 'blur':
|
|
1197
|
+
result.size = parseUnits(val);
|
|
1198
|
+
break;
|
|
1199
|
+
case 'Nose':
|
|
1200
|
+
result.noise = parsePercent(val);
|
|
1201
|
+
break;
|
|
1202
|
+
case 'Inpr':
|
|
1203
|
+
result.range = parsePercent(val);
|
|
1204
|
+
break;
|
|
1205
|
+
case 'Ckmt':
|
|
1206
|
+
result.choke = parseUnits(val);
|
|
1207
|
+
break;
|
|
1208
|
+
case 'ShdN':
|
|
1209
|
+
result.jitter = parsePercent(val);
|
|
1210
|
+
break;
|
|
1211
|
+
case 'Dstn':
|
|
1212
|
+
result.distance = parseUnits(val);
|
|
1213
|
+
break;
|
|
1214
|
+
case 'Scl ':
|
|
1215
|
+
result.scale = parsePercent(val);
|
|
1216
|
+
break;
|
|
1217
|
+
case 'Ptrn':
|
|
1218
|
+
result.pattern = { name: val['Nm '], id: val.Idnt };
|
|
1219
|
+
break;
|
|
1220
|
+
case 'phase':
|
|
1221
|
+
result.phase = { x: val.Hrzn, y: val.Vrtc };
|
|
1222
|
+
break;
|
|
1223
|
+
case 'Ofst':
|
|
1224
|
+
result.offset = { x: parsePercent(val.Hrzn), y: parsePercent(val.Vrtc) };
|
|
1225
|
+
break;
|
|
1226
|
+
case 'MpgS':
|
|
1227
|
+
case 'TrnS':
|
|
1228
|
+
result.contour = {
|
|
1229
|
+
name: val['Nm '],
|
|
1230
|
+
curve: val['Crv '].map(p => ({ x: p.Hrzn, y: p.Vrtc })),
|
|
1231
|
+
};
|
|
1232
|
+
break;
|
|
1233
|
+
case 'Grad':
|
|
1234
|
+
result.gradient = parseGradient(val);
|
|
1235
|
+
break;
|
|
1236
|
+
case 'useTexture':
|
|
1237
|
+
case 'useShape':
|
|
1238
|
+
case 'layerConceals':
|
|
1239
|
+
case 'present':
|
|
1240
|
+
case 'showInDialog':
|
|
1241
|
+
case 'antialiasGloss':
|
|
1242
|
+
result[key] = val;
|
|
1243
|
+
break;
|
|
1244
|
+
case '_name':
|
|
1245
|
+
case '_classID':
|
|
1246
|
+
break;
|
|
1247
|
+
default:
|
|
1248
|
+
reportErrors && console.log(`Invalid effect key: '${key}', value:`, val);
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
return result;
|
|
1252
|
+
}
|
|
1253
|
+
function serializeEffectObject(obj, objName, reportErrors) {
|
|
1254
|
+
const result = {
|
|
1255
|
+
enab: false,
|
|
1256
|
+
};
|
|
1257
|
+
if (objName === 'dropShadow') {
|
|
1258
|
+
result.TrnS = { 'Nm ': '', 'Crv ': [] };
|
|
1259
|
+
}
|
|
1260
|
+
for (const objKey of Object.keys(obj)) {
|
|
1261
|
+
const key = objKey;
|
|
1262
|
+
const val = obj[key];
|
|
1263
|
+
switch (key) {
|
|
1264
|
+
case 'enabled':
|
|
1265
|
+
result.enab = !!val;
|
|
1266
|
+
break;
|
|
1267
|
+
case 'useGlobalLight':
|
|
1268
|
+
result.uglg = !!val;
|
|
1269
|
+
break;
|
|
1270
|
+
case 'antialiased':
|
|
1271
|
+
result.AntA = !!val;
|
|
1272
|
+
break;
|
|
1273
|
+
case 'align':
|
|
1274
|
+
result.Algn = !!val;
|
|
1275
|
+
break;
|
|
1276
|
+
case 'dither':
|
|
1277
|
+
result.Dthr = !!val;
|
|
1278
|
+
break;
|
|
1279
|
+
case 'invert':
|
|
1280
|
+
result.Invr = !!val;
|
|
1281
|
+
break;
|
|
1282
|
+
case 'reverse':
|
|
1283
|
+
result.Rvrs = !!val;
|
|
1284
|
+
break;
|
|
1285
|
+
case 'color':
|
|
1286
|
+
result['Clr '] = serializeColor(val);
|
|
1287
|
+
break;
|
|
1288
|
+
case 'highlightColor':
|
|
1289
|
+
result.hglC = serializeColor(val);
|
|
1290
|
+
break;
|
|
1291
|
+
case 'shadowColor':
|
|
1292
|
+
result.sdwC = serializeColor(val);
|
|
1293
|
+
break;
|
|
1294
|
+
case 'position':
|
|
1295
|
+
result.Styl = exports.FStl.encode(val);
|
|
1296
|
+
break;
|
|
1297
|
+
case 'blendMode':
|
|
1298
|
+
result['Md '] = exports.BlnM.encode(val);
|
|
1299
|
+
break;
|
|
1300
|
+
case 'highlightBlendMode':
|
|
1301
|
+
result.hglM = exports.BlnM.encode(val);
|
|
1302
|
+
break;
|
|
1303
|
+
case 'shadowBlendMode':
|
|
1304
|
+
result.sdwM = exports.BlnM.encode(val);
|
|
1305
|
+
break;
|
|
1306
|
+
case 'style':
|
|
1307
|
+
result.bvlS = exports.BESl.encode(val);
|
|
1308
|
+
break;
|
|
1309
|
+
case 'direction':
|
|
1310
|
+
result.bvlD = exports.BESs.encode(val);
|
|
1311
|
+
break;
|
|
1312
|
+
case 'technique':
|
|
1313
|
+
if (objName === 'bevel') {
|
|
1314
|
+
result.bvlT = exports.bvlT.encode(val);
|
|
1315
|
+
}
|
|
1316
|
+
else {
|
|
1317
|
+
result.GlwT = exports.BETE.encode(val);
|
|
1318
|
+
}
|
|
1319
|
+
break;
|
|
1320
|
+
case 'source':
|
|
1321
|
+
result.glwS = exports.IGSr.encode(val);
|
|
1322
|
+
break;
|
|
1323
|
+
case 'type':
|
|
1324
|
+
result.Type = exports.GrdT.encode(val);
|
|
1325
|
+
break;
|
|
1326
|
+
case 'interpolationMethod':
|
|
1327
|
+
result.gs99 = exports.gradientInterpolationMethodType.encode(val);
|
|
1328
|
+
break;
|
|
1329
|
+
case 'opacity':
|
|
1330
|
+
result.Opct = unitsPercent(val);
|
|
1331
|
+
break;
|
|
1332
|
+
case 'highlightOpacity':
|
|
1333
|
+
result.hglO = unitsPercent(val);
|
|
1334
|
+
break;
|
|
1335
|
+
case 'shadowOpacity':
|
|
1336
|
+
result.sdwO = unitsPercent(val);
|
|
1337
|
+
break;
|
|
1338
|
+
case 'angle':
|
|
1339
|
+
if (objName === 'gradientOverlay' || objName === 'patternFill') {
|
|
1340
|
+
result.Angl = unitsAngle(val);
|
|
1341
|
+
}
|
|
1342
|
+
else {
|
|
1343
|
+
result.lagl = unitsAngle(val);
|
|
1344
|
+
}
|
|
1345
|
+
break;
|
|
1346
|
+
case 'altitude':
|
|
1347
|
+
result.Lald = unitsAngle(val);
|
|
1348
|
+
break;
|
|
1349
|
+
case 'soften':
|
|
1350
|
+
result.Sftn = unitsValue(val, key);
|
|
1351
|
+
break;
|
|
1352
|
+
case 'strength':
|
|
1353
|
+
result.srgR = unitsPercent(val);
|
|
1354
|
+
break;
|
|
1355
|
+
case 'size':
|
|
1356
|
+
result.blur = unitsValue(val, key);
|
|
1357
|
+
break;
|
|
1358
|
+
case 'noise':
|
|
1359
|
+
result.Nose = unitsPercent(val);
|
|
1360
|
+
break;
|
|
1361
|
+
case 'range':
|
|
1362
|
+
result.Inpr = unitsPercent(val);
|
|
1363
|
+
break;
|
|
1364
|
+
case 'choke':
|
|
1365
|
+
result.Ckmt = unitsValue(val, key);
|
|
1366
|
+
break;
|
|
1367
|
+
case 'jitter':
|
|
1368
|
+
result.ShdN = unitsPercent(val);
|
|
1369
|
+
break;
|
|
1370
|
+
case 'distance':
|
|
1371
|
+
result.Dstn = unitsValue(val, key);
|
|
1372
|
+
break;
|
|
1373
|
+
case 'scale':
|
|
1374
|
+
result['Scl '] = unitsPercent(val);
|
|
1375
|
+
break;
|
|
1376
|
+
case 'pattern':
|
|
1377
|
+
result.Ptrn = { 'Nm ': val.name, Idnt: val.id };
|
|
1378
|
+
break;
|
|
1379
|
+
case 'phase':
|
|
1380
|
+
result.phase = { Hrzn: val.x, Vrtc: val.y };
|
|
1381
|
+
break;
|
|
1382
|
+
case 'offset':
|
|
1383
|
+
result.Ofst = { Hrzn: unitsPercent(val.x), Vrtc: unitsPercent(val.y) };
|
|
1384
|
+
break;
|
|
1385
|
+
case 'contour': {
|
|
1386
|
+
result[objName === 'satin' ? 'MpgS' : 'TrnS'] = {
|
|
1387
|
+
'Nm ': val.name,
|
|
1388
|
+
'Crv ': val.curve.map(p => ({ Hrzn: p.x, Vrtc: p.y })),
|
|
1389
|
+
};
|
|
1390
|
+
break;
|
|
1391
|
+
}
|
|
1392
|
+
case 'gradient':
|
|
1393
|
+
result.Grad = serializeGradient(val);
|
|
1394
|
+
break;
|
|
1395
|
+
case 'useTexture':
|
|
1396
|
+
case 'useShape':
|
|
1397
|
+
case 'layerConceals':
|
|
1398
|
+
case 'present':
|
|
1399
|
+
case 'showInDialog':
|
|
1400
|
+
case 'antialiasGloss':
|
|
1401
|
+
result[key] = val;
|
|
1402
|
+
break;
|
|
1403
|
+
default:
|
|
1404
|
+
reportErrors && console.log(`Invalid effect key: '${key}', value:`, val);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
return result;
|
|
1408
|
+
}
|
|
1409
|
+
function parseGradient(grad) {
|
|
1410
|
+
if (grad.GrdF === 'GrdF.CstS') {
|
|
1411
|
+
const samples = grad.Intr || 4096;
|
|
1412
|
+
return {
|
|
1413
|
+
type: 'solid',
|
|
1414
|
+
name: grad['Nm '],
|
|
1415
|
+
smoothness: grad.Intr / 4096,
|
|
1416
|
+
colorStops: grad.Clrs.map(s => ({
|
|
1417
|
+
color: parseColor(s['Clr ']),
|
|
1418
|
+
location: s.Lctn / samples,
|
|
1419
|
+
midpoint: s.Mdpn / 100,
|
|
1420
|
+
})),
|
|
1421
|
+
opacityStops: grad.Trns.map(s => ({
|
|
1422
|
+
opacity: parsePercent(s.Opct),
|
|
1423
|
+
location: s.Lctn / samples,
|
|
1424
|
+
midpoint: s.Mdpn / 100,
|
|
1425
|
+
})),
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
else {
|
|
1429
|
+
return {
|
|
1430
|
+
type: 'noise',
|
|
1431
|
+
name: grad['Nm '],
|
|
1432
|
+
roughness: grad.Smth / 4096,
|
|
1433
|
+
colorModel: exports.ClrS.decode(grad.ClrS),
|
|
1434
|
+
randomSeed: grad.RndS,
|
|
1435
|
+
restrictColors: !!grad.VctC,
|
|
1436
|
+
addTransparency: !!grad.ShTr,
|
|
1437
|
+
min: grad['Mnm '].map(x => x / 100),
|
|
1438
|
+
max: grad['Mxm '].map(x => x / 100),
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
function serializeGradient(grad) {
|
|
1443
|
+
var _a, _b;
|
|
1444
|
+
if (grad.type === 'solid') {
|
|
1445
|
+
const samples = Math.round(((_a = grad.smoothness) !== null && _a !== void 0 ? _a : 1) * 4096);
|
|
1446
|
+
return {
|
|
1447
|
+
'Nm ': grad.name || '',
|
|
1448
|
+
GrdF: 'GrdF.CstS',
|
|
1449
|
+
Intr: samples,
|
|
1450
|
+
Clrs: grad.colorStops.map(s => {
|
|
1451
|
+
var _a;
|
|
1452
|
+
return ({
|
|
1453
|
+
'Clr ': serializeColor(s.color),
|
|
1454
|
+
Type: 'Clry.UsrS',
|
|
1455
|
+
Lctn: Math.round(s.location * samples),
|
|
1456
|
+
Mdpn: Math.round(((_a = s.midpoint) !== null && _a !== void 0 ? _a : 0.5) * 100),
|
|
1457
|
+
});
|
|
1458
|
+
}),
|
|
1459
|
+
Trns: grad.opacityStops.map(s => {
|
|
1460
|
+
var _a;
|
|
1461
|
+
return ({
|
|
1462
|
+
Opct: unitsPercent(s.opacity),
|
|
1463
|
+
Lctn: Math.round(s.location * samples),
|
|
1464
|
+
Mdpn: Math.round(((_a = s.midpoint) !== null && _a !== void 0 ? _a : 0.5) * 100),
|
|
1465
|
+
});
|
|
1466
|
+
}),
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
else {
|
|
1470
|
+
return {
|
|
1471
|
+
GrdF: 'GrdF.ClNs',
|
|
1472
|
+
'Nm ': grad.name || '',
|
|
1473
|
+
ShTr: !!grad.addTransparency,
|
|
1474
|
+
VctC: !!grad.restrictColors,
|
|
1475
|
+
ClrS: exports.ClrS.encode(grad.colorModel),
|
|
1476
|
+
RndS: grad.randomSeed || 0,
|
|
1477
|
+
Smth: Math.round(((_b = grad.roughness) !== null && _b !== void 0 ? _b : 1) * 4096),
|
|
1478
|
+
'Mnm ': (grad.min || [0, 0, 0, 0]).map(x => x * 100),
|
|
1479
|
+
'Mxm ': (grad.max || [1, 1, 1, 1]).map(x => x * 100),
|
|
1480
|
+
};
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
function parseGradientContent(descriptor) {
|
|
1484
|
+
const result = parseGradient(descriptor.Grad);
|
|
1485
|
+
result.style = exports.GrdT.decode(descriptor.Type);
|
|
1486
|
+
if (descriptor.Dthr !== undefined)
|
|
1487
|
+
result.dither = descriptor.Dthr;
|
|
1488
|
+
if (descriptor.gradientsInterpolationMethod !== undefined)
|
|
1489
|
+
result.interpolationMethod = exports.gradientInterpolationMethodType.decode(descriptor.gradientsInterpolationMethod);
|
|
1490
|
+
if (descriptor.Rvrs !== undefined)
|
|
1491
|
+
result.reverse = descriptor.Rvrs;
|
|
1492
|
+
if (descriptor.Angl !== undefined)
|
|
1493
|
+
result.angle = parseAngle(descriptor.Angl);
|
|
1494
|
+
if (descriptor['Scl '] !== undefined)
|
|
1495
|
+
result.scale = parsePercent(descriptor['Scl ']);
|
|
1496
|
+
if (descriptor.Algn !== undefined)
|
|
1497
|
+
result.align = descriptor.Algn;
|
|
1498
|
+
if (descriptor.Ofst !== undefined) {
|
|
1499
|
+
result.offset = {
|
|
1500
|
+
x: parsePercent(descriptor.Ofst.Hrzn),
|
|
1501
|
+
y: parsePercent(descriptor.Ofst.Vrtc)
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
return result;
|
|
1505
|
+
}
|
|
1506
|
+
function parsePatternContent(descriptor) {
|
|
1507
|
+
const result = {
|
|
1508
|
+
name: descriptor.Ptrn['Nm '],
|
|
1509
|
+
id: descriptor.Ptrn.Idnt,
|
|
1510
|
+
};
|
|
1511
|
+
if (descriptor.Lnkd !== undefined)
|
|
1512
|
+
result.linked = descriptor.Lnkd;
|
|
1513
|
+
if (descriptor.phase !== undefined)
|
|
1514
|
+
result.phase = { x: descriptor.phase.Hrzn, y: descriptor.phase.Vrtc };
|
|
1515
|
+
return result;
|
|
1516
|
+
}
|
|
1517
|
+
function parseVectorContent(descriptor) {
|
|
1518
|
+
if ('Grad' in descriptor) {
|
|
1519
|
+
return parseGradientContent(descriptor);
|
|
1520
|
+
}
|
|
1521
|
+
else if ('Ptrn' in descriptor) {
|
|
1522
|
+
return Object.assign({ type: 'pattern' }, parsePatternContent(descriptor));
|
|
1523
|
+
}
|
|
1524
|
+
else if ('Clr ' in descriptor) {
|
|
1525
|
+
return { type: 'color', color: parseColor(descriptor['Clr ']) };
|
|
1526
|
+
}
|
|
1527
|
+
else {
|
|
1528
|
+
throw new Error('Invalid vector content');
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
function serializeGradientContent(content) {
|
|
1532
|
+
const result = {};
|
|
1533
|
+
if (content.dither !== undefined)
|
|
1534
|
+
result.Dthr = content.dither;
|
|
1535
|
+
if (content.interpolationMethod !== undefined)
|
|
1536
|
+
result.gradientsInterpolationMethod = exports.gradientInterpolationMethodType.encode(content.interpolationMethod);
|
|
1537
|
+
if (content.reverse !== undefined)
|
|
1538
|
+
result.Rvrs = content.reverse;
|
|
1539
|
+
if (content.angle !== undefined)
|
|
1540
|
+
result.Angl = unitsAngle(content.angle);
|
|
1541
|
+
result.Type = exports.GrdT.encode(content.style);
|
|
1542
|
+
if (content.align !== undefined)
|
|
1543
|
+
result.Algn = content.align;
|
|
1544
|
+
if (content.scale !== undefined)
|
|
1545
|
+
result['Scl '] = unitsPercent(content.scale);
|
|
1546
|
+
if (content.offset) {
|
|
1547
|
+
result.Ofst = {
|
|
1548
|
+
Hrzn: unitsPercent(content.offset.x),
|
|
1549
|
+
Vrtc: unitsPercent(content.offset.y),
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
result.Grad = serializeGradient(content);
|
|
1553
|
+
return result;
|
|
1554
|
+
}
|
|
1555
|
+
function serializePatternContent(content) {
|
|
1556
|
+
const result = {
|
|
1557
|
+
Ptrn: {
|
|
1558
|
+
'Nm ': content.name || '',
|
|
1559
|
+
Idnt: content.id || '',
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
if (content.linked !== undefined)
|
|
1563
|
+
result.Lnkd = !!content.linked;
|
|
1564
|
+
if (content.phase !== undefined)
|
|
1565
|
+
result.phase = { Hrzn: content.phase.x, Vrtc: content.phase.y };
|
|
1566
|
+
return result;
|
|
1567
|
+
}
|
|
1568
|
+
function serializeVectorContent(content) {
|
|
1569
|
+
if (content.type === 'color') {
|
|
1570
|
+
return { key: 'SoCo', descriptor: { 'Clr ': serializeColor(content.color) } };
|
|
1571
|
+
}
|
|
1572
|
+
else if (content.type === 'pattern') {
|
|
1573
|
+
return { key: 'PtFl', descriptor: serializePatternContent(content) };
|
|
1574
|
+
}
|
|
1575
|
+
else {
|
|
1576
|
+
return { key: 'GdFl', descriptor: serializeGradientContent(content) };
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
function parseColor(color) {
|
|
1580
|
+
if ('H ' in color) {
|
|
1581
|
+
return { h: parsePercentOrAngle(color['H ']), s: color.Strt, b: color.Brgh };
|
|
1582
|
+
}
|
|
1583
|
+
else if ('Rd ' in color) {
|
|
1584
|
+
return { r: color['Rd '], g: color['Grn '], b: color['Bl '] };
|
|
1585
|
+
}
|
|
1586
|
+
else if ('Cyn ' in color) {
|
|
1587
|
+
return { c: color['Cyn '], m: color.Mgnt, y: color['Ylw '], k: color.Blck };
|
|
1588
|
+
}
|
|
1589
|
+
else if ('Gry ' in color) {
|
|
1590
|
+
return { k: color['Gry '] };
|
|
1591
|
+
}
|
|
1592
|
+
else if ('Lmnc' in color) {
|
|
1593
|
+
return { l: color.Lmnc, a: color['A '], b: color['B '] };
|
|
1594
|
+
}
|
|
1595
|
+
else if ('redFloat' in color) {
|
|
1596
|
+
return { fr: color.redFloat, fg: color.greenFloat, fb: color.blueFloat };
|
|
1597
|
+
}
|
|
1598
|
+
else {
|
|
1599
|
+
throw new Error('Unsupported color descriptor');
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
function serializeColor(color) {
|
|
1603
|
+
if (!color) {
|
|
1604
|
+
return { _name: '', _classID: 'RGBC', 'Rd ': 0, 'Grn ': 0, 'Bl ': 0 };
|
|
1605
|
+
}
|
|
1606
|
+
else if ('r' in color) {
|
|
1607
|
+
return { _name: '', _classID: 'RGBC', 'Rd ': color.r || 0, 'Grn ': color.g || 0, 'Bl ': color.b || 0 };
|
|
1608
|
+
}
|
|
1609
|
+
else if ('fr' in color) {
|
|
1610
|
+
return { _name: '', _classID: 'RGBC', redFloat: color.fr, greenFloat: color.fg, blueFloat: color.fb };
|
|
1611
|
+
}
|
|
1612
|
+
else if ('h' in color) {
|
|
1613
|
+
return { _name: '', _classID: 'HSBC', 'H ': unitsAngle(color.h * 360), Strt: color.s || 0, Brgh: color.b || 0 };
|
|
1614
|
+
}
|
|
1615
|
+
else if ('c' in color) {
|
|
1616
|
+
return { _name: '', _classID: 'CMYC', 'Cyn ': color.c || 0, Mgnt: color.m || 0, 'Ylw ': color.y || 0, Blck: color.k || 0 };
|
|
1617
|
+
}
|
|
1618
|
+
else if ('l' in color) {
|
|
1619
|
+
return { _name: '', _classID: 'LABC', Lmnc: color.l || 0, 'A ': color.a || 0, 'B ': color.b || 0 };
|
|
1620
|
+
}
|
|
1621
|
+
else if ('k' in color) {
|
|
1622
|
+
return { _name: '', _classID: 'GRYC', 'Gry ': color.k };
|
|
1623
|
+
}
|
|
1624
|
+
else {
|
|
1625
|
+
throw new Error('Invalid color value');
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
function parseAngle(x) {
|
|
1629
|
+
if (x === undefined)
|
|
1630
|
+
return 0;
|
|
1631
|
+
if (x.units !== 'Angle')
|
|
1632
|
+
throw new Error(`Invalid units: ${x.units}`);
|
|
1633
|
+
return x.value;
|
|
1634
|
+
}
|
|
1635
|
+
function parsePercent(x) {
|
|
1636
|
+
if (x === undefined)
|
|
1637
|
+
return 1;
|
|
1638
|
+
if (x.units !== 'Percent')
|
|
1639
|
+
throw new Error(`Invalid units: ${x.units}`);
|
|
1640
|
+
return x.value / 100;
|
|
1641
|
+
}
|
|
1642
|
+
function parsePercentOrAngle(x) {
|
|
1643
|
+
if (x === undefined)
|
|
1644
|
+
return 1;
|
|
1645
|
+
if (x.units === 'Percent')
|
|
1646
|
+
return x.value / 100;
|
|
1647
|
+
if (x.units === 'Angle')
|
|
1648
|
+
return x.value / 360;
|
|
1649
|
+
throw new Error(`Invalid units: ${x.units}`);
|
|
1650
|
+
}
|
|
1651
|
+
function parseUnits({ units, value }) {
|
|
1652
|
+
if (units !== 'Pixels' && units !== 'Millimeters' && units !== 'Points' && units !== 'None' &&
|
|
1653
|
+
units !== 'Picas' && units !== 'Inches' && units !== 'Centimeters' && units !== 'Density') {
|
|
1654
|
+
throw new Error(`Invalid units: ${JSON.stringify({ units, value })}`);
|
|
1655
|
+
}
|
|
1656
|
+
return { value, units };
|
|
1657
|
+
}
|
|
1658
|
+
function parseUnitsOrNumber(value, units = 'Pixels') {
|
|
1659
|
+
if (typeof value === 'number')
|
|
1660
|
+
return { value, units };
|
|
1661
|
+
return parseUnits(value);
|
|
1662
|
+
}
|
|
1663
|
+
function parseUnitsToNumber({ units, value }, expectedUnits) {
|
|
1664
|
+
if (units !== expectedUnits)
|
|
1665
|
+
throw new Error(`Invalid units: ${JSON.stringify({ units, value })}`);
|
|
1666
|
+
return value;
|
|
1667
|
+
}
|
|
1668
|
+
function unitsAngle(value) {
|
|
1669
|
+
return { units: 'Angle', value: value || 0 };
|
|
1670
|
+
}
|
|
1671
|
+
function unitsPercent(value) {
|
|
1672
|
+
return { units: 'Percent', value: Math.round((value || 0) * 100) };
|
|
1673
|
+
}
|
|
1674
|
+
function unitsPercentF(value) {
|
|
1675
|
+
return { units: 'Percent', value: (value || 0) * 100 };
|
|
1676
|
+
}
|
|
1677
|
+
function unitsValue(x, key) {
|
|
1678
|
+
if (x == null)
|
|
1679
|
+
return { units: 'Pixels', value: 0 };
|
|
1680
|
+
if (typeof x !== 'object')
|
|
1681
|
+
throw new Error(`Invalid value: ${JSON.stringify(x)} (key: ${key}) (should have value and units)`);
|
|
1682
|
+
const { units, value } = x;
|
|
1683
|
+
if (typeof value !== 'number')
|
|
1684
|
+
throw new Error(`Invalid value in ${JSON.stringify(x)} (key: ${key})`);
|
|
1685
|
+
if (units !== 'Pixels' && units !== 'Millimeters' && units !== 'Points' && units !== 'None' &&
|
|
1686
|
+
units !== 'Picas' && units !== 'Inches' && units !== 'Centimeters' && units !== 'Density') {
|
|
1687
|
+
throw new Error(`Invalid units in ${JSON.stringify(x)} (key: ${key})`);
|
|
1688
|
+
}
|
|
1689
|
+
return { units, value };
|
|
1690
|
+
}
|
|
1691
|
+
function frac({ numerator, denominator }) {
|
|
1692
|
+
return { numerator, denominator };
|
|
1693
|
+
}
|
|
1694
|
+
exports.textGridding = (0, helpers_1.createEnum)('textGridding', 'none', {
|
|
1695
|
+
none: 'None',
|
|
1696
|
+
round: 'Rnd ',
|
|
1697
|
+
});
|
|
1698
|
+
exports.Ornt = (0, helpers_1.createEnum)('Ornt', 'horizontal', {
|
|
1699
|
+
horizontal: 'Hrzn',
|
|
1700
|
+
vertical: 'Vrtc',
|
|
1701
|
+
});
|
|
1702
|
+
exports.Annt = (0, helpers_1.createEnum)('Annt', 'sharp', {
|
|
1703
|
+
none: 'Anno',
|
|
1704
|
+
sharp: 'antiAliasSharp',
|
|
1705
|
+
crisp: 'AnCr',
|
|
1706
|
+
strong: 'AnSt',
|
|
1707
|
+
smooth: 'AnSm',
|
|
1708
|
+
platform: 'antiAliasPlatformGray',
|
|
1709
|
+
platformLCD: 'antiAliasPlatformLCD',
|
|
1710
|
+
});
|
|
1711
|
+
exports.warpStyle = (0, helpers_1.createEnum)('warpStyle', 'none', {
|
|
1712
|
+
none: 'warpNone',
|
|
1713
|
+
arc: 'warpArc',
|
|
1714
|
+
arcLower: 'warpArcLower',
|
|
1715
|
+
arcUpper: 'warpArcUpper',
|
|
1716
|
+
arch: 'warpArch',
|
|
1717
|
+
bulge: 'warpBulge',
|
|
1718
|
+
shellLower: 'warpShellLower',
|
|
1719
|
+
shellUpper: 'warpShellUpper',
|
|
1720
|
+
flag: 'warpFlag',
|
|
1721
|
+
wave: 'warpWave',
|
|
1722
|
+
fish: 'warpFish',
|
|
1723
|
+
rise: 'warpRise',
|
|
1724
|
+
fisheye: 'warpFisheye',
|
|
1725
|
+
inflate: 'warpInflate',
|
|
1726
|
+
squeeze: 'warpSqueeze',
|
|
1727
|
+
twist: 'warpTwist',
|
|
1728
|
+
cylinder: 'warpCylinder',
|
|
1729
|
+
custom: 'warpCustom',
|
|
1730
|
+
});
|
|
1731
|
+
exports.BlnM = (0, helpers_1.createEnum)('BlnM', 'normal', {
|
|
1732
|
+
'normal': 'Nrml',
|
|
1733
|
+
'dissolve': 'Dslv',
|
|
1734
|
+
'darken': 'Drkn',
|
|
1735
|
+
'multiply': 'Mltp',
|
|
1736
|
+
'color burn': 'CBrn',
|
|
1737
|
+
'linear burn': 'linearBurn',
|
|
1738
|
+
'darker color': 'darkerColor',
|
|
1739
|
+
'lighten': 'Lghn',
|
|
1740
|
+
'screen': 'Scrn',
|
|
1741
|
+
'color dodge': 'CDdg',
|
|
1742
|
+
'linear dodge': 'linearDodge',
|
|
1743
|
+
'lighter color': 'lighterColor',
|
|
1744
|
+
'overlay': 'Ovrl',
|
|
1745
|
+
'soft light': 'SftL',
|
|
1746
|
+
'hard light': 'HrdL',
|
|
1747
|
+
'vivid light': 'vividLight',
|
|
1748
|
+
'linear light': 'linearLight',
|
|
1749
|
+
'pin light': 'pinLight',
|
|
1750
|
+
'hard mix': 'hardMix',
|
|
1751
|
+
'difference': 'Dfrn',
|
|
1752
|
+
'exclusion': 'Xclu',
|
|
1753
|
+
'subtract': 'blendSubtraction',
|
|
1754
|
+
'divide': 'blendDivide',
|
|
1755
|
+
'hue': 'H ',
|
|
1756
|
+
'saturation': 'Strt',
|
|
1757
|
+
'color': 'Clr ',
|
|
1758
|
+
'luminosity': 'Lmns',
|
|
1759
|
+
// used in ABR
|
|
1760
|
+
'linear height': 'linearHeight',
|
|
1761
|
+
'height': 'Hght',
|
|
1762
|
+
'subtraction': 'Sbtr', // 2nd version of subtract ?
|
|
1763
|
+
});
|
|
1764
|
+
exports.BESl = (0, helpers_1.createEnum)('BESl', 'inner bevel', {
|
|
1765
|
+
'inner bevel': 'InrB',
|
|
1766
|
+
'outer bevel': 'OtrB',
|
|
1767
|
+
'emboss': 'Embs',
|
|
1768
|
+
'pillow emboss': 'PlEb',
|
|
1769
|
+
'stroke emboss': 'strokeEmboss',
|
|
1770
|
+
});
|
|
1771
|
+
exports.bvlT = (0, helpers_1.createEnum)('bvlT', 'smooth', {
|
|
1772
|
+
'smooth': 'SfBL',
|
|
1773
|
+
'chisel hard': 'PrBL',
|
|
1774
|
+
'chisel soft': 'Slmt',
|
|
1775
|
+
});
|
|
1776
|
+
exports.BESs = (0, helpers_1.createEnum)('BESs', 'up', {
|
|
1777
|
+
up: 'In ',
|
|
1778
|
+
down: 'Out ',
|
|
1779
|
+
});
|
|
1780
|
+
exports.BETE = (0, helpers_1.createEnum)('BETE', 'softer', {
|
|
1781
|
+
softer: 'SfBL',
|
|
1782
|
+
precise: 'PrBL',
|
|
1783
|
+
});
|
|
1784
|
+
exports.IGSr = (0, helpers_1.createEnum)('IGSr', 'edge', {
|
|
1785
|
+
edge: 'SrcE',
|
|
1786
|
+
center: 'SrcC',
|
|
1787
|
+
});
|
|
1788
|
+
exports.GrdT = (0, helpers_1.createEnum)('GrdT', 'linear', {
|
|
1789
|
+
linear: 'Lnr ',
|
|
1790
|
+
radial: 'Rdl ',
|
|
1791
|
+
angle: 'Angl',
|
|
1792
|
+
reflected: 'Rflc',
|
|
1793
|
+
diamond: 'Dmnd',
|
|
1794
|
+
});
|
|
1795
|
+
exports.animInterpStyleEnum = (0, helpers_1.createEnum)('animInterpStyle', 'linear', {
|
|
1796
|
+
linear: 'Lnr ',
|
|
1797
|
+
hold: 'hold',
|
|
1798
|
+
});
|
|
1799
|
+
exports.stdTrackID = (0, helpers_1.createEnum)('stdTrackID', 'opacity', {
|
|
1800
|
+
opacity: 'opacityTrack',
|
|
1801
|
+
style: 'styleTrack',
|
|
1802
|
+
sheetTransform: 'sheetTransformTrack',
|
|
1803
|
+
sheetPosition: 'sheetPositionTrack',
|
|
1804
|
+
globalLighting: 'globalLightingTrack',
|
|
1805
|
+
});
|
|
1806
|
+
exports.gradientInterpolationMethodType = (0, helpers_1.createEnum)('gradientInterpolationMethodType', 'perceptual', {
|
|
1807
|
+
perceptual: 'Perc',
|
|
1808
|
+
linear: 'Lnr ',
|
|
1809
|
+
classic: 'Gcls',
|
|
1810
|
+
smooth: 'Smoo',
|
|
1811
|
+
// TODO: stripes
|
|
1812
|
+
});
|
|
1813
|
+
exports.ClrS = (0, helpers_1.createEnum)('ClrS', 'rgb', {
|
|
1814
|
+
rgb: 'RGBC',
|
|
1815
|
+
hsb: 'HSBl',
|
|
1816
|
+
lab: 'LbCl',
|
|
1817
|
+
hsl: 'HSLC',
|
|
1818
|
+
});
|
|
1819
|
+
exports.FStl = (0, helpers_1.createEnum)('FStl', 'outside', {
|
|
1820
|
+
outside: 'OutF',
|
|
1821
|
+
center: 'CtrF',
|
|
1822
|
+
inside: 'InsF'
|
|
1823
|
+
});
|
|
1824
|
+
exports.FrFl = (0, helpers_1.createEnum)('FrFl', 'color', {
|
|
1825
|
+
color: 'SClr',
|
|
1826
|
+
gradient: 'GrFl',
|
|
1827
|
+
pattern: 'Ptrn',
|
|
1828
|
+
});
|
|
1829
|
+
exports.ESliceType = (0, helpers_1.createEnum)('ESliceType', 'image', {
|
|
1830
|
+
image: 'Img ',
|
|
1831
|
+
noImage: 'noImage',
|
|
1832
|
+
});
|
|
1833
|
+
exports.ESliceHorzAlign = (0, helpers_1.createEnum)('ESliceHorzAlign', 'default', {
|
|
1834
|
+
default: 'default',
|
|
1835
|
+
});
|
|
1836
|
+
exports.ESliceVertAlign = (0, helpers_1.createEnum)('ESliceVertAlign', 'default', {
|
|
1837
|
+
default: 'default',
|
|
1838
|
+
});
|
|
1839
|
+
exports.ESliceOrigin = (0, helpers_1.createEnum)('ESliceOrigin', 'userGenerated', {
|
|
1840
|
+
userGenerated: 'userGenerated',
|
|
1841
|
+
autoGenerated: 'autoGenerated',
|
|
1842
|
+
layer: 'layer',
|
|
1843
|
+
});
|
|
1844
|
+
exports.ESliceBGColorType = (0, helpers_1.createEnum)('ESliceBGColorType', 'none', {
|
|
1845
|
+
none: 'None',
|
|
1846
|
+
matte: 'matte',
|
|
1847
|
+
color: 'Clr ',
|
|
1848
|
+
});
|
|
1849
|
+
exports.strokeStyleLineCapType = (0, helpers_1.createEnum)('strokeStyleLineCapType', 'butt', {
|
|
1850
|
+
butt: 'strokeStyleButtCap',
|
|
1851
|
+
round: 'strokeStyleRoundCap',
|
|
1852
|
+
square: 'strokeStyleSquareCap',
|
|
1853
|
+
});
|
|
1854
|
+
exports.strokeStyleLineJoinType = (0, helpers_1.createEnum)('strokeStyleLineJoinType', 'miter', {
|
|
1855
|
+
miter: 'strokeStyleMiterJoin',
|
|
1856
|
+
round: 'strokeStyleRoundJoin',
|
|
1857
|
+
bevel: 'strokeStyleBevelJoin',
|
|
1858
|
+
});
|
|
1859
|
+
exports.strokeStyleLineAlignment = (0, helpers_1.createEnum)('strokeStyleLineAlignment', 'inside', {
|
|
1860
|
+
inside: 'strokeStyleAlignInside',
|
|
1861
|
+
center: 'strokeStyleAlignCenter',
|
|
1862
|
+
outside: 'strokeStyleAlignOutside',
|
|
1863
|
+
});
|
|
1864
|
+
exports.BlrM = (0, helpers_1.createEnum)('BlrM', 'ispinmage', {
|
|
1865
|
+
spin: 'Spn ',
|
|
1866
|
+
zoom: 'Zm ',
|
|
1867
|
+
});
|
|
1868
|
+
exports.BlrQ = (0, helpers_1.createEnum)('BlrQ', 'good', {
|
|
1869
|
+
draft: 'Drft',
|
|
1870
|
+
good: 'Gd ',
|
|
1871
|
+
best: 'Bst ',
|
|
1872
|
+
});
|
|
1873
|
+
exports.SmBM = (0, helpers_1.createEnum)('SmBM', 'normal', {
|
|
1874
|
+
normal: 'SBMN',
|
|
1875
|
+
'edge only': 'SBME',
|
|
1876
|
+
'overlay edge': 'SBMO',
|
|
1877
|
+
});
|
|
1878
|
+
exports.SmBQ = (0, helpers_1.createEnum)('SmBQ', 'medium', {
|
|
1879
|
+
low: 'SBQL',
|
|
1880
|
+
medium: 'SBQM',
|
|
1881
|
+
high: 'SBQH',
|
|
1882
|
+
});
|
|
1883
|
+
exports.DspM = (0, helpers_1.createEnum)('DspM', 'stretch to fit', {
|
|
1884
|
+
'stretch to fit': 'StrF',
|
|
1885
|
+
'tile': 'Tile',
|
|
1886
|
+
});
|
|
1887
|
+
exports.UndA = (0, helpers_1.createEnum)('UndA', 'repeat edge pixels', {
|
|
1888
|
+
'wrap around': 'WrpA',
|
|
1889
|
+
'repeat edge pixels': 'RptE',
|
|
1890
|
+
});
|
|
1891
|
+
exports.Cnvr = (0, helpers_1.createEnum)('Cnvr', 'rectangular to polar', {
|
|
1892
|
+
'rectangular to polar': 'RctP',
|
|
1893
|
+
'polar to rectangular': 'PlrR',
|
|
1894
|
+
});
|
|
1895
|
+
exports.RplS = (0, helpers_1.createEnum)('RplS', 'medium', {
|
|
1896
|
+
small: 'Sml ',
|
|
1897
|
+
medium: 'Mdm ',
|
|
1898
|
+
large: 'Lrg ',
|
|
1899
|
+
});
|
|
1900
|
+
exports.SphM = (0, helpers_1.createEnum)('SphM', 'normal', {
|
|
1901
|
+
'normal': 'Nrml',
|
|
1902
|
+
'horizontal only': 'HrzO',
|
|
1903
|
+
'vertical only': 'VrtO',
|
|
1904
|
+
});
|
|
1905
|
+
exports.Wvtp = (0, helpers_1.createEnum)('Wvtp', 'sine', {
|
|
1906
|
+
sine: 'WvSn',
|
|
1907
|
+
triangle: 'WvTr',
|
|
1908
|
+
square: 'WvSq',
|
|
1909
|
+
});
|
|
1910
|
+
exports.ZZTy = (0, helpers_1.createEnum)('ZZTy', 'pond ripples', {
|
|
1911
|
+
'around center': 'ArnC',
|
|
1912
|
+
'out from center': 'OtFr',
|
|
1913
|
+
'pond ripples': 'PndR',
|
|
1914
|
+
});
|
|
1915
|
+
exports.Dstr = (0, helpers_1.createEnum)('Dstr', 'uniform', {
|
|
1916
|
+
uniform: 'Unfr',
|
|
1917
|
+
gaussian: 'Gsn ',
|
|
1918
|
+
});
|
|
1919
|
+
exports.Chnl = (0, helpers_1.createEnum)('Chnl', 'composite', {
|
|
1920
|
+
red: 'Rd ',
|
|
1921
|
+
green: 'Grn ',
|
|
1922
|
+
blue: 'Bl ',
|
|
1923
|
+
composite: 'Cmps',
|
|
1924
|
+
});
|
|
1925
|
+
exports.MztT = (0, helpers_1.createEnum)('MztT', 'fine dots', {
|
|
1926
|
+
'fine dots': 'FnDt',
|
|
1927
|
+
'medium dots': 'MdmD',
|
|
1928
|
+
'grainy dots': 'GrnD',
|
|
1929
|
+
'coarse dots': 'CrsD',
|
|
1930
|
+
'short lines': 'ShrL',
|
|
1931
|
+
'medium lines': 'MdmL',
|
|
1932
|
+
'long lines': 'LngL',
|
|
1933
|
+
'short strokes': 'ShSt',
|
|
1934
|
+
'medium strokes': 'MdmS',
|
|
1935
|
+
'long strokes': 'LngS',
|
|
1936
|
+
});
|
|
1937
|
+
exports.Lns = (0, helpers_1.createEnum)('Lns ', '50-300mm zoom', {
|
|
1938
|
+
'50-300mm zoom': 'Zm ',
|
|
1939
|
+
'32mm prime': 'Nkn ',
|
|
1940
|
+
'105mm prime': 'Nkn1',
|
|
1941
|
+
'movie prime': 'PnVs',
|
|
1942
|
+
});
|
|
1943
|
+
exports.blurType = (0, helpers_1.createEnum)('blurType', 'gaussian blur', {
|
|
1944
|
+
'gaussian blur': 'GsnB',
|
|
1945
|
+
'lens blur': 'lensBlur',
|
|
1946
|
+
'motion blur': 'MtnB',
|
|
1947
|
+
});
|
|
1948
|
+
exports.DfsM = (0, helpers_1.createEnum)('DfsM', 'normal', {
|
|
1949
|
+
'normal': 'Nrml',
|
|
1950
|
+
'darken only': 'DrkO',
|
|
1951
|
+
'lighten only': 'LghO',
|
|
1952
|
+
'anisotropic': 'anisotropic',
|
|
1953
|
+
});
|
|
1954
|
+
exports.ExtT = (0, helpers_1.createEnum)('ExtT', 'blocks', {
|
|
1955
|
+
blocks: 'Blks',
|
|
1956
|
+
pyramids: 'Pyrm',
|
|
1957
|
+
});
|
|
1958
|
+
exports.ExtR = (0, helpers_1.createEnum)('ExtR', 'random', {
|
|
1959
|
+
random: 'Rndm',
|
|
1960
|
+
'level-based': 'LvlB',
|
|
1961
|
+
});
|
|
1962
|
+
exports.FlCl = (0, helpers_1.createEnum)('FlCl', 'background color', {
|
|
1963
|
+
'background color': 'FlBc',
|
|
1964
|
+
'foreground color': 'FlFr',
|
|
1965
|
+
'inverse image': 'FlIn',
|
|
1966
|
+
'unaltered image': 'FlSm',
|
|
1967
|
+
});
|
|
1968
|
+
exports.CntE = (0, helpers_1.createEnum)('CntE', 'upper', {
|
|
1969
|
+
lower: 'Lwr ',
|
|
1970
|
+
upper: 'Upr ',
|
|
1971
|
+
});
|
|
1972
|
+
exports.WndM = (0, helpers_1.createEnum)('WndM', 'wind', {
|
|
1973
|
+
wind: 'Wnd ',
|
|
1974
|
+
blast: 'Blst',
|
|
1975
|
+
stagger: 'Stgr',
|
|
1976
|
+
});
|
|
1977
|
+
exports.Drct = (0, helpers_1.createEnum)('Drct', 'from the right', {
|
|
1978
|
+
left: 'Left',
|
|
1979
|
+
right: 'Rght',
|
|
1980
|
+
});
|
|
1981
|
+
exports.IntE = (0, helpers_1.createEnum)('IntE', 'odd lines', {
|
|
1982
|
+
'odd lines': 'ElmO',
|
|
1983
|
+
'even lines': 'ElmE',
|
|
1984
|
+
});
|
|
1985
|
+
exports.IntC = (0, helpers_1.createEnum)('IntC', 'interpolation', {
|
|
1986
|
+
duplication: 'CrtD',
|
|
1987
|
+
interpolation: 'CrtI',
|
|
1988
|
+
});
|
|
1989
|
+
exports.FlMd = (0, helpers_1.createEnum)('FlMd', 'wrap around', {
|
|
1990
|
+
'set to transparent': 'Bckg',
|
|
1991
|
+
'repeat edge pixels': 'Rpt ',
|
|
1992
|
+
'wrap around': 'Wrp ',
|
|
1993
|
+
});
|
|
1994
|
+
exports.prjM = (0, helpers_1.createEnum)('prjM', 'fisheye', {
|
|
1995
|
+
'fisheye': 'fisP',
|
|
1996
|
+
'perspective': 'perP',
|
|
1997
|
+
'auto': 'auto',
|
|
1998
|
+
'full spherical': 'fusP',
|
|
1999
|
+
});
|
|
2000
|
+
exports.presetKindType = (0, helpers_1.createEnum)('presetKindType', 'presetKindCustom', {
|
|
2001
|
+
custom: 'presetKindCustom',
|
|
2002
|
+
default: 'presetKindDefault',
|
|
2003
|
+
});
|
|
2039
2004
|
//# sourceMappingURL=descriptor.js.map
|