@monogrid/gainmap-js 3.1.0 → 3.3.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CODE_OF_CONDUCT.md +1 -1
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +113 -57
  5. package/dist/Loader-CsjVTcg5.js +424 -0
  6. package/dist/Loader-D4XqFES7.js +5 -0
  7. package/dist/{QuadRenderer-DuOPRGA4.js → QuadRenderer-BqJ2Q8P5.js} +39 -30
  8. package/dist/QuadRenderer-De5PMMtY.js +5 -0
  9. package/dist/{_commonjsHelpers-DeBGiDfT.js → _commonjsHelpers-C2Rq7Bzs.js} +2 -2
  10. package/dist/_commonjsHelpers-FnzxO7yL.js +5 -0
  11. package/dist/compress-HAw5HoXG.js +5 -0
  12. package/dist/{compress-B6OswAu8.js → compress-bMJEJ5JM.js} +4 -3
  13. package/dist/core/QuadRenderer.d.ts +2 -2
  14. package/dist/core/get-data-texture.d.ts +4 -3
  15. package/dist/core/types.d.ts +7 -1
  16. package/dist/decode/index.d.ts +1 -11
  17. package/dist/decode/shared/Loader.d.ts +59 -0
  18. package/dist/decode/shared/decode.d.ts +24 -0
  19. package/dist/decode/{extract.d.ts → shared/extract.d.ts} +4 -4
  20. package/dist/decode/shared/index.d.ts +8 -0
  21. package/dist/decode/shared/types.d.ts +53 -0
  22. package/dist/decode/{utils → shared/utils}/MPFExtractor.d.ts +1 -1
  23. package/dist/decode/{utils → shared/utils}/extractXMP.d.ts +1 -1
  24. package/dist/decode/{decode.d.ts → webgl/decode.d.ts} +6 -6
  25. package/dist/decode/webgl/index.d.ts +8 -0
  26. package/dist/decode/{loaders → webgl/loaders}/GainMapLoader.d.ts +5 -6
  27. package/dist/decode/{loaders → webgl/loaders}/HDRJPGLoader.d.ts +6 -7
  28. package/dist/decode/webgl/loaders/LoaderBaseWebGL.d.ts +20 -0
  29. package/dist/decode/{materials → webgl/materials}/GainMapDecoderMaterial.d.ts +2 -2
  30. package/dist/decode/webgpu/core/QuadRenderer.d.ts +153 -0
  31. package/dist/decode/webgpu/decode.d.ts +60 -0
  32. package/dist/decode/webgpu/index.d.ts +8 -0
  33. package/dist/decode/webgpu/loaders/GainMapLoader.d.ts +69 -0
  34. package/dist/decode/webgpu/loaders/HDRJPGLoader.d.ts +65 -0
  35. package/dist/decode/webgpu/loaders/LoaderBaseWebGPU.d.ts +20 -0
  36. package/dist/decode/webgpu/materials/GainMapDecoderMaterial.d.ts +78 -0
  37. package/dist/decode.js +45 -426
  38. package/dist/decode.min.js +5 -0
  39. package/dist/decode.umd.cjs +360 -314
  40. package/dist/decode.umd.min.cjs +5 -0
  41. package/dist/decode.webgpu.js +814 -0
  42. package/dist/decode.webgpu.min.js +5 -0
  43. package/dist/decode.webgpu.umd.cjs +1244 -0
  44. package/dist/decode.webgpu.umd.min.cjs +5 -0
  45. package/dist/encode/encode-and-compress.d.ts +4 -4
  46. package/dist/encode/encode.d.ts +3 -3
  47. package/dist/encode/find-texture-min-max.d.ts +4 -3
  48. package/dist/encode/types.d.ts +6 -5
  49. package/dist/encode.js +33 -12
  50. package/dist/encode.min.js +5 -0
  51. package/dist/encode.umd.cjs +70 -39
  52. package/dist/encode.umd.min.cjs +5 -0
  53. package/dist/libultrahdr/encode-jpeg-metadata.d.ts +6 -6
  54. package/dist/libultrahdr/jpeg-assembler.d.ts +41 -0
  55. package/dist/libultrahdr/jpeg-markers.d.ts +47 -0
  56. package/dist/libultrahdr/mpf-generator.d.ts +20 -0
  57. package/dist/libultrahdr/xmp-generator.d.ts +33 -0
  58. package/dist/libultrahdr.d.ts +0 -3
  59. package/dist/libultrahdr.js +548 -6598
  60. package/dist/libultrahdr.min.js +5 -0
  61. package/dist/libultrahdr.umd.cjs +633 -6686
  62. package/dist/libultrahdr.umd.min.cjs +5 -0
  63. package/dist/third-party.txt +301 -0
  64. package/dist/worker-interface.js +74 -64
  65. package/dist/worker-interface.min.js +5 -0
  66. package/dist/worker-interface.umd.cjs +73 -63
  67. package/dist/worker-interface.umd.min.cjs +5 -0
  68. package/dist/worker.js +103 -88
  69. package/dist/worker.min.js +5 -0
  70. package/dist/worker.umd.cjs +105 -89
  71. package/dist/worker.umd.min.cjs +5 -0
  72. package/package.json +79 -72
  73. package/dist/decode/loaders/LoaderBase.d.ts +0 -45
  74. package/dist/decode/types.d.ts +0 -42
  75. package/dist/libultrahdr/decode-jpeg-metadata.d.ts +0 -28
  76. package/dist/libultrahdr/library.d.ts +0 -9
  77. package/dist/libultrahdr-esm.wasm +0 -0
  78. package/libultrahdr-wasm/build/libultrahdr-debug.js +0 -7156
  79. package/libultrahdr-wasm/build/libultrahdr-debug.wasm +0 -0
  80. package/libultrahdr-wasm/build/libultrahdr-esm.js +0 -6633
  81. package/libultrahdr-wasm/build/libultrahdr-esm.wasm +0 -0
  82. package/libultrahdr-wasm/build/libultrahdr.d.ts +0 -30
  83. package/libultrahdr-wasm/build/libultrahdr.js +0 -6591
  84. package/libultrahdr-wasm/build/libultrahdr.wasm +0 -0
  85. /package/dist/decode/{errors → shared/errors}/GainMapNotFoundError.d.ts +0 -0
  86. /package/dist/decode/{errors → shared/errors}/XMPMetadataNotFoundError.d.ts +0 -0
  87. /package/dist/decode/{utils → shared/utils}/get-html-image-from-blob.d.ts +0 -0
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @monogrid/gainmap-js v3.3.0
3
+ * With ❤️, by MONOGRID <gainmap@monogrid.com>
4
+ */
5
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).libultrahdr={})}(this,function(t){"use strict";const e=216,n=225,a=226,r=218,i={SIGNATURE:new Uint8Array([77,80,70,0]),BIG_ENDIAN:new Uint8Array([77,77]),TIFF_MAGIC:42,NUM_PICTURES:2,TAG_COUNT:3,TAG_SIZE:12,MP_ENTRY_SIZE:16},s=45056,p=45057,o=45058,h=7,g=4,d=0,u=536870912,c=new Uint8Array([48,49,48,48]);function m(){return i.SIGNATURE.length+2+2+4+2+i.TAG_COUNT*i.TAG_SIZE+4+i.NUM_PICTURES*i.MP_ENTRY_SIZE}const f="Primary",l="GainMap",M="image/jpeg";function U(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function x(t,e,n,a){const r=new DataView(t.buffer,t.byteOffset,t.byteLength);if(r.setUint8(e++,255),r.setUint8(e++,n),a&&a.length>0){const n=a.length+2;r.setUint16(e,n,!1),e+=2,t.set(a,e),e+=a.length}return e}function y(t){const{sdr:y,gainMap:w,metadata:T,exif:E,icc:I}=t;if("image/jpeg"!==y.mimeType)throw new Error("SDR image must be JPEG format");if("image/jpeg"!==w.mimeType)throw new Error("Gain map image must be JPEG format");const A=function(t){const a=new DataView(t.buffer,t.byteOffset,t.byteLength);if(255!==a.getUint8(0)||a.getUint8(1)!==e)return null;let i=2;const s="Exif\0\0";for(;i<t.length-1&&255===a.getUint8(i);){const e=a.getUint8(i+1);if(e===r)break;if(e===n){const e=a.getUint16(i+2,!1),n=i+4;let r=!0;for(let e=0;e<6;e++)if(n+e>=t.length||t[n+e]!==s.charCodeAt(e)){r=!1;break}if(r){const a=e-2;return{data:t.slice(n,n+a),pos:i,size:e+2}}}i+=2+a.getUint16(i+2,!1)}return null}(y.data);if(A&&E)throw new Error("Primary image already contains EXIF data, cannot add external EXIF");let b=y.data,C=E;A&&(b=function(t,e,n){const a=t.length-n,r=new Uint8Array(a);return r.set(t.subarray(0,e),0),r.set(t.subarray(e+n),e),r}(y.data,A.pos,A.size),C=A.data);const S=function(t){const e=[],n=t.hdrCapacityMin,a=t.hdrCapacityMax,r=t=>Array.isArray(t)?t.reduce((t,e)=>t+e,0)/t.length:t,i=r(t.gainMapMin),s=r(t.gainMapMax),p=r(t.gamma),o=r(t.offsetSdr),h=r(t.offsetHdr);return e.push('<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>'),e.push('<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.2">'),e.push(' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">'),e.push(" <rdf:Description"),e.push(' xmlns:hdrgm="http://ns.adobe.com/hdr-gain-map/1.0/"'),e.push(` hdrgm:Version="${U(t.version)}"`),e.push(` hdrgm:GainMapMin="${U(i)}"`),e.push(` hdrgm:GainMapMax="${U(s)}"`),e.push(` hdrgm:Gamma="${U(p)}"`),e.push(` hdrgm:OffsetSDR="${U(o)}"`),e.push(` hdrgm:OffsetHDR="${U(h)}"`),e.push(` hdrgm:HDRCapacityMin="${U(n)}"`),e.push(` hdrgm:HDRCapacityMax="${U(a)}"`),e.push(' hdrgm:BaseRenditionIsHDR="False"'),e.push(' rdf:about=""/>'),e.push(" </rdf:RDF>"),e.push("</x:xmpmeta>"),e.push('<?xpacket end="w"?>'),e.join("\n")}(T),R=(new TextEncoder).encode(S),G=(new TextEncoder).encode("http://ns.adobe.com/xap/1.0/\0"),D=6+G.length+R.length+(w.data.length-2),N=function(t,e){const n=[];return n.push('<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>'),n.push('<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.2">'),n.push(' <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">'),n.push(" <rdf:Description"),n.push(' xmlns:Container="http://ns.google.com/photos/1.0/container/"'),n.push(' xmlns:Item="http://ns.google.com/photos/1.0/container/item/"'),n.push(' xmlns:hdrgm="http://ns.adobe.com/hdr-gain-map/1.0/"'),n.push(` hdrgm:Version="${U(e.version)}"`),n.push(' rdf:about="">'),n.push(" <Container:Directory>"),n.push(" <rdf:Seq>"),n.push(' <rdf:li rdf:parseType="Resource">'),n.push(" <Container:Item"),n.push(` Item:Semantic="${f}"`),n.push(` Item:Mime="${M}"/>`),n.push(" </rdf:li>"),n.push(' <rdf:li rdf:parseType="Resource">'),n.push(" <Container:Item"),n.push(` Item:Semantic="${l}"`),n.push(` Item:Mime="${M}"`),n.push(` Item:Length="${t}"/>`),n.push(" </rdf:li>"),n.push(" </rdf:Seq>"),n.push(" </Container:Directory>"),n.push(" </rdf:Description>"),n.push(" </rdf:RDF>"),n.push("</x:xmpmeta>"),n.push('<?xpacket end="w"?>'),n.join("\n")}(D,T),_=(new TextEncoder).encode(N),P=new Uint8Array(G.length+_.length);P.set(G,0),P.set(_,G.length);const $=m();let F=2;C&&(F+=4+C.length),F+=4+P.length,I&&(F+=4+I.length),F+=4+$,F+=b.length-2,F+=D;const j=F-D,k=function(t,e,n,a){const r=m(),f=new ArrayBuffer(r),l=new DataView(f),M=new Uint8Array(f);let U=0;M.set(i.SIGNATURE,U),U+=i.SIGNATURE.length,M.set(i.BIG_ENDIAN,U);const x=!1;U+=2,l.setUint16(U,i.TIFF_MAGIC,x),U+=2,l.setUint32(U,8,x),U+=4,l.setUint16(U,i.TAG_COUNT,x),U+=2,l.setUint16(U,s,x),U+=2,l.setUint16(U,h,x),U+=2,l.setUint32(U,c.length,x),U+=4,M.set(c,U),U+=4,l.setUint16(U,p,x),U+=2,l.setUint16(U,g,x),U+=2,l.setUint32(U,1,x),U+=4,l.setUint32(U,i.NUM_PICTURES,x),U+=4,l.setUint16(U,o,x),U+=2,l.setUint16(U,h,x),U+=2,l.setUint32(U,i.MP_ENTRY_SIZE*i.NUM_PICTURES,x),U+=4;const y=U-i.SIGNATURE.length+4+4;return l.setUint32(U,y,x),U+=4,l.setUint32(U,0,x),U+=4,l.setUint32(U,d|u,x),U+=4,l.setUint32(U,t,x),U+=4,l.setUint32(U,e,x),U+=4,l.setUint16(U,0,x),U+=2,l.setUint16(U,0,x),U+=2,l.setUint32(U,d,x),U+=4,l.setUint32(U,n,x),U+=4,l.setUint32(U,a,x),U+=4,l.setUint16(U,0,x),U+=2,l.setUint16(U,0,x),M}(j,0,D,j-(2+(C?4+C.length:0)+2+2+P.length+(I?4+I.length:0)+2+2+4)),H=new Uint8Array(F);let z=0;z=x(H,z,e),C&&(z=x(H,z,n,C)),z=x(H,z,n,P),I&&(z=x(H,z,a,I)),z=x(H,z,a,k),H.set(b.subarray(2),z),z+=b.length-2,z=x(H,z,e);const O=new Uint8Array(G.length+R.length);return O.set(G,0),O.set(R,G.length),z=x(H,z,n,O),H.set(w.data.subarray(2),z),H}t.encodeJPEGMetadata=t=>{if("image/jpeg"!==t.sdr.mimeType)throw new Error("This function expects an SDR image compressed in jpeg");if("image/jpeg"!==t.gainMap.mimeType)throw new Error("This function expects a GainMap image compressed in jpeg");const e={version:"1.0",gainMapMin:t.gainMapMin,gainMapMax:t.gainMapMax,gamma:t.gamma,offsetSdr:t.offsetSdr,offsetHdr:t.offsetHdr,hdrCapacityMin:t.hdrCapacityMin,hdrCapacityMax:t.hdrCapacityMax,minContentBoost:Array.isArray(t.gainMapMin)?Math.pow(2,t.gainMapMin.reduce((t,e)=>t+e,0)/t.gainMapMin.length):Math.pow(2,t.gainMapMin),maxContentBoost:Array.isArray(t.gainMapMax)?Math.pow(2,t.gainMapMax.reduce((t,e)=>t+e,0)/t.gainMapMax.length):Math.pow(2,t.gainMapMax)};return y({sdr:t.sdr,gainMap:t.gainMap,metadata:e})}});
@@ -0,0 +1,301 @@
1
+ Name: is-promise
2
+ Version: 2.2.2
3
+ License: MIT
4
+ Private: false
5
+ Description: Test whether an object looks like a promises-a+ promise
6
+ Repository: https://github.com/then/is-promise.git
7
+ Author: ForbesLindesay
8
+ License Copyright:
9
+ ===
10
+
11
+ Copyright (c) 2014 Forbes Lindesay
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
30
+
31
+ ---
32
+
33
+ Name: promise-worker-transferable
34
+ Version: 1.0.4
35
+ License: Apache-2.0
36
+ Private: false
37
+ Description: Communicate with a Web Worker using Promises, allowing transferList
38
+ Repository: git+https://github.com/terikon/promise-worker-transferable.git
39
+ Homepage: https://github.com/terikon/promise-worker-transferable#readme
40
+ Author: Roman Viskin <npm@terikon.com>
41
+ License Copyright:
42
+ ===
43
+
44
+
45
+ Apache License
46
+ Version 2.0, January 2004
47
+ http://www.apache.org/licenses/
48
+
49
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
50
+
51
+ 1. Definitions.
52
+
53
+ "License" shall mean the terms and conditions for use, reproduction,
54
+ and distribution as defined by Sections 1 through 9 of this document.
55
+
56
+ "Licensor" shall mean the copyright owner or entity authorized by
57
+ the copyright owner that is granting the License.
58
+
59
+ "Legal Entity" shall mean the union of the acting entity and all
60
+ other entities that control, are controlled by, or are under common
61
+ control with that entity. For the purposes of this definition,
62
+ "control" means (i) the power, direct or indirect, to cause the
63
+ direction or management of such entity, whether by contract or
64
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
65
+ outstanding shares, or (iii) beneficial ownership of such entity.
66
+
67
+ "You" (or "Your") shall mean an individual or Legal Entity
68
+ exercising permissions granted by this License.
69
+
70
+ "Source" form shall mean the preferred form for making modifications,
71
+ including but not limited to software source code, documentation
72
+ source, and configuration files.
73
+
74
+ "Object" form shall mean any form resulting from mechanical
75
+ transformation or translation of a Source form, including but
76
+ not limited to compiled object code, generated documentation,
77
+ and conversions to other media types.
78
+
79
+ "Work" shall mean the work of authorship, whether in Source or
80
+ Object form, made available under the License, as indicated by a
81
+ copyright notice that is included in or attached to the work
82
+ (an example is provided in the Appendix below).
83
+
84
+ "Derivative Works" shall mean any work, whether in Source or Object
85
+ form, that is based on (or derived from) the Work and for which the
86
+ editorial revisions, annotations, elaborations, or other modifications
87
+ represent, as a whole, an original work of authorship. For the purposes
88
+ of this License, Derivative Works shall not include works that remain
89
+ separable from, or merely link (or bind by name) to the interfaces of,
90
+ the Work and Derivative Works thereof.
91
+
92
+ "Contribution" shall mean any work of authorship, including
93
+ the original version of the Work and any modifications or additions
94
+ to that Work or Derivative Works thereof, that is intentionally
95
+ submitted to Licensor for inclusion in the Work by the copyright owner
96
+ or by an individual or Legal Entity authorized to submit on behalf of
97
+ the copyright owner. For the purposes of this definition, "submitted"
98
+ means any form of electronic, verbal, or written communication sent
99
+ to the Licensor or its representatives, including but not limited to
100
+ communication on electronic mailing lists, source code control systems,
101
+ and issue tracking systems that are managed by, or on behalf of, the
102
+ Licensor for the purpose of discussing and improving the Work, but
103
+ excluding communication that is conspicuously marked or otherwise
104
+ designated in writing by the copyright owner as "Not a Contribution."
105
+
106
+ "Contributor" shall mean Licensor and any individual or Legal Entity
107
+ on behalf of whom a Contribution has been received by Licensor and
108
+ subsequently incorporated within the Work.
109
+
110
+ 2. Grant of Copyright License. Subject to the terms and conditions of
111
+ this License, each Contributor hereby grants to You a perpetual,
112
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
113
+ copyright license to reproduce, prepare Derivative Works of,
114
+ publicly display, publicly perform, sublicense, and distribute the
115
+ Work and such Derivative Works in Source or Object form.
116
+
117
+ 3. Grant of Patent License. Subject to the terms and conditions of
118
+ this License, each Contributor hereby grants to You a perpetual,
119
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
120
+ (except as stated in this section) patent license to make, have made,
121
+ use, offer to sell, sell, import, and otherwise transfer the Work,
122
+ where such license applies only to those patent claims licensable
123
+ by such Contributor that are necessarily infringed by their
124
+ Contribution(s) alone or by combination of their Contribution(s)
125
+ with the Work to which such Contribution(s) was submitted. If You
126
+ institute patent litigation against any entity (including a
127
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
128
+ or a Contribution incorporated within the Work constitutes direct
129
+ or contributory patent infringement, then any patent licenses
130
+ granted to You under this License for that Work shall terminate
131
+ as of the date such litigation is filed.
132
+
133
+ 4. Redistribution. You may reproduce and distribute copies of the
134
+ Work or Derivative Works thereof in any medium, with or without
135
+ modifications, and in Source or Object form, provided that You
136
+ meet the following conditions:
137
+
138
+ (a) You must give any other recipients of the Work or
139
+ Derivative Works a copy of this License; and
140
+
141
+ (b) You must cause any modified files to carry prominent notices
142
+ stating that You changed the files; and
143
+
144
+ (c) You must retain, in the Source form of any Derivative Works
145
+ that You distribute, all copyright, patent, trademark, and
146
+ attribution notices from the Source form of the Work,
147
+ excluding those notices that do not pertain to any part of
148
+ the Derivative Works; and
149
+
150
+ (d) If the Work includes a "NOTICE" text file as part of its
151
+ distribution, then any Derivative Works that You distribute must
152
+ include a readable copy of the attribution notices contained
153
+ within such NOTICE file, excluding those notices that do not
154
+ pertain to any part of the Derivative Works, in at least one
155
+ of the following places: within a NOTICE text file distributed
156
+ as part of the Derivative Works; within the Source form or
157
+ documentation, if provided along with the Derivative Works; or,
158
+ within a display generated by the Derivative Works, if and
159
+ wherever such third-party notices normally appear. The contents
160
+ of the NOTICE file are for informational purposes only and
161
+ do not modify the License. You may add Your own attribution
162
+ notices within Derivative Works that You distribute, alongside
163
+ or as an addendum to the NOTICE text from the Work, provided
164
+ that such additional attribution notices cannot be construed
165
+ as modifying the License.
166
+
167
+ You may add Your own copyright statement to Your modifications and
168
+ may provide additional or different license terms and conditions
169
+ for use, reproduction, or distribution of Your modifications, or
170
+ for any such Derivative Works as a whole, provided Your use,
171
+ reproduction, and distribution of the Work otherwise complies with
172
+ the conditions stated in this License.
173
+
174
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
175
+ any Contribution intentionally submitted for inclusion in the Work
176
+ by You to the Licensor shall be under the terms and conditions of
177
+ this License, without any additional terms or conditions.
178
+ Notwithstanding the above, nothing herein shall supersede or modify
179
+ the terms of any separate license agreement you may have executed
180
+ with Licensor regarding such Contributions.
181
+
182
+ 6. Trademarks. This License does not grant permission to use the trade
183
+ names, trademarks, service marks, or product names of the Licensor,
184
+ except as required for reasonable and customary use in describing the
185
+ origin of the Work and reproducing the content of the NOTICE file.
186
+
187
+ 7. Disclaimer of Warranty. Unless required by applicable law or
188
+ agreed to in writing, Licensor provides the Work (and each
189
+ Contributor provides its Contributions) on an "AS IS" BASIS,
190
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
191
+ implied, including, without limitation, any warranties or conditions
192
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
193
+ PARTICULAR PURPOSE. You are solely responsible for determining the
194
+ appropriateness of using or redistributing the Work and assume any
195
+ risks associated with Your exercise of permissions under this License.
196
+
197
+ 8. Limitation of Liability. In no event and under no legal theory,
198
+ whether in tort (including negligence), contract, or otherwise,
199
+ unless required by applicable law (such as deliberate and grossly
200
+ negligent acts) or agreed to in writing, shall any Contributor be
201
+ liable to You for damages, including any direct, indirect, special,
202
+ incidental, or consequential damages of any character arising as a
203
+ result of this License or out of the use or inability to use the
204
+ Work (including but not limited to damages for loss of goodwill,
205
+ work stoppage, computer failure or malfunction, or any and all
206
+ other commercial damages or losses), even if such Contributor
207
+ has been advised of the possibility of such damages.
208
+
209
+ 9. Accepting Warranty or Additional Liability. While redistributing
210
+ the Work or Derivative Works thereof, You may choose to offer,
211
+ and charge a fee for, acceptance of support, warranty, indemnity,
212
+ or other liability obligations and/or rights consistent with this
213
+ License. However, in accepting such obligations, You may act only
214
+ on Your own behalf and on Your sole responsibility, not on behalf
215
+ of any other Contributor, and only if You agree to indemnify,
216
+ defend, and hold each Contributor harmless for any liability
217
+ incurred by, or claims asserted against, such Contributor by reason
218
+ of your accepting any such warranty or additional liability.
219
+
220
+ END OF TERMS AND CONDITIONS
221
+
222
+ APPENDIX: How to apply the Apache License to your work.
223
+
224
+ To apply the Apache License to your work, attach the following
225
+ boilerplate notice, with the fields enclosed by brackets "[]"
226
+ replaced with your own identifying information. (Don't include
227
+ the brackets!) The text should be enclosed in the appropriate
228
+ comment syntax for the file format. We also recommend that a
229
+ file or class name and description of purpose be included on the
230
+ same "printed page" as the copyright notice for easier
231
+ identification within third-party archives.
232
+
233
+ Copyright [yyyy] [name of copyright owner]
234
+
235
+ Licensed under the Apache License, Version 2.0 (the "License");
236
+ you may not use this file except in compliance with the License.
237
+ You may obtain a copy of the License at
238
+
239
+ http://www.apache.org/licenses/LICENSE-2.0
240
+
241
+ Unless required by applicable law or agreed to in writing, software
242
+ distributed under the License is distributed on an "AS IS" BASIS,
243
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244
+ See the License for the specific language governing permissions and
245
+ limitations under the License.
246
+
247
+ ---
248
+
249
+ Name: immediate
250
+ Version: 3.0.6
251
+ License: MIT
252
+ Private: false
253
+ Description: A cross browser microtask library
254
+ Repository: git://github.com/calvinmetcalf/immediate.git
255
+ Contributors:
256
+ Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)
257
+ Donavon West <github@donavon.com> (http://donavon.com)
258
+ Yaffle
259
+ Calvin Metcalf <calvin.metcalf@gmail.com>
260
+ License Copyright:
261
+ ===
262
+
263
+ Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, Domenic Denicola, Brian Cavalier
264
+
265
+ Permission is hereby granted, free of charge, to any person obtaining
266
+ a copy of this software and associated documentation files (the
267
+ "Software"), to deal in the Software without restriction, including
268
+ without limitation the rights to use, copy, modify, merge, publish,
269
+ distribute, sublicense, and/or sell copies of the Software, and to
270
+ permit persons to whom the Software is furnished to do so, subject to
271
+ the following conditions:
272
+
273
+ The above copyright notice and this permission notice shall be
274
+ included in all copies or substantial portions of the Software.
275
+
276
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
277
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
278
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
279
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
280
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
281
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
282
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
283
+
284
+ ---
285
+
286
+ Name: lie
287
+ Version: 3.3.0
288
+ License: MIT
289
+ Private: false
290
+ Description: A basic but performant promise implementation
291
+ Repository: https://github.com/calvinmetcalf/lie.git
292
+ License Copyright:
293
+ ===
294
+
295
+ #Copyright (c) 2014-2018 Calvin Metcalf, Jordan Harband
296
+
297
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
298
+
299
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
300
+
301
+ **THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @monogrid/gainmap-js v3.1.0
3
- * With ❤️, by MONOGRID <rnd@monogrid.com>
2
+ * @monogrid/gainmap-js v3.3.0
3
+ * With ❤️, by MONOGRID <gainmap@monogrid.com>
4
4
  */
5
5
 
6
- import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-DeBGiDfT.js';
6
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-C2Rq7Bzs.js';
7
7
 
8
8
  var lib$1;
9
9
  var hasRequiredLib$1;
@@ -392,79 +392,89 @@ function requireLib () {
392
392
  return lib;
393
393
  }
394
394
 
395
- /* istanbul ignore next */
396
- var MyPromise = typeof Promise !== 'undefined' ? Promise : requireLib();
395
+ var promiseWorkerTransferable;
396
+ var hasRequiredPromiseWorkerTransferable;
397
+
398
+ function requirePromiseWorkerTransferable () {
399
+ if (hasRequiredPromiseWorkerTransferable) return promiseWorkerTransferable;
400
+ hasRequiredPromiseWorkerTransferable = 1;
401
+
402
+ /* istanbul ignore next */
403
+ var MyPromise = typeof Promise !== 'undefined' ? Promise : requireLib();
397
404
 
398
- var messageIds = 0;
405
+ var messageIds = 0;
399
406
 
400
- function onMessage(self, e) {
401
- var message = e.data;
402
- if (!Array.isArray(message) || message.length < 2) {
403
- // Ignore - this message is not for us.
404
- return;
405
- }
406
- var messageId = message[0];
407
- var error = message[1];
408
- var result = message[2];
407
+ function onMessage(self, e) {
408
+ var message = e.data;
409
+ if (!Array.isArray(message) || message.length < 2) {
410
+ // Ignore - this message is not for us.
411
+ return;
412
+ }
413
+ var messageId = message[0];
414
+ var error = message[1];
415
+ var result = message[2];
409
416
 
410
- var callback = self._callbacks[messageId];
417
+ var callback = self._callbacks[messageId];
411
418
 
412
- if (!callback) {
413
- // Ignore - user might have created multiple PromiseWorkers.
414
- // This message is not for us.
415
- return;
416
- }
419
+ if (!callback) {
420
+ // Ignore - user might have created multiple PromiseWorkers.
421
+ // This message is not for us.
422
+ return;
423
+ }
417
424
 
418
- delete self._callbacks[messageId];
419
- callback(error, result);
420
- }
425
+ delete self._callbacks[messageId];
426
+ callback(error, result);
427
+ }
421
428
 
422
- function PromiseWorker(worker) {
423
- var self = this;
424
- self._worker = worker;
425
- self._callbacks = {};
429
+ function PromiseWorker(worker) {
430
+ var self = this;
431
+ self._worker = worker;
432
+ self._callbacks = {};
426
433
 
427
- worker.addEventListener('message', function (e) {
428
- onMessage(self, e);
429
- });
430
- }
434
+ worker.addEventListener('message', function (e) {
435
+ onMessage(self, e);
436
+ });
437
+ }
431
438
 
432
- PromiseWorker.prototype.postMessage = function (userMessage, transferList) {
433
- var self = this;
434
- var messageId = messageIds++;
439
+ PromiseWorker.prototype.postMessage = function (userMessage, transferList) {
440
+ var self = this;
441
+ var messageId = messageIds++;
435
442
 
436
- var messageToSend = [messageId, userMessage];
443
+ var messageToSend = [messageId, userMessage];
437
444
 
438
- return new MyPromise(function (resolve, reject) {
439
- self._callbacks[messageId] = function (error, result) {
440
- if (error) {
441
- return reject(new Error(error.message));
442
- }
443
- resolve(result);
444
- };
445
- /* istanbul ignore if */
446
- if (typeof self._worker.controller !== 'undefined') {
447
- // service worker, use MessageChannels because e.source is broken in Chrome < 51:
448
- // https://bugs.chromium.org/p/chromium/issues/detail?id=543198
449
- var channel = new MessageChannel();
450
- channel.port1.onmessage = function (e) {
451
- onMessage(self, e);
452
- };
453
- self._worker.controller.postMessage(messageToSend, [channel.port2].concat(transferList));
454
- } else {
455
- // web worker
456
- self._worker.postMessage(messageToSend, transferList);
457
- }
458
- });
459
- };
445
+ return new MyPromise(function (resolve, reject) {
446
+ self._callbacks[messageId] = function (error, result) {
447
+ if (error) {
448
+ return reject(new Error(error.message));
449
+ }
450
+ resolve(result);
451
+ };
452
+ /* istanbul ignore if */
453
+ if (typeof self._worker.controller !== 'undefined') {
454
+ // service worker, use MessageChannels because e.source is broken in Chrome < 51:
455
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=543198
456
+ var channel = new MessageChannel();
457
+ channel.port1.onmessage = function (e) {
458
+ onMessage(self, e);
459
+ };
460
+ self._worker.controller.postMessage(messageToSend, [channel.port2].concat(transferList));
461
+ } else {
462
+ // web worker
463
+ self._worker.postMessage(messageToSend, transferList);
464
+ }
465
+ });
466
+ };
460
467
 
461
- PromiseWorker.prototype.terminate = function () {
462
- this._worker.terminate();
463
- };
468
+ PromiseWorker.prototype.terminate = function () {
469
+ this._worker.terminate();
470
+ };
464
471
 
465
- var promiseWorkerTransferable = PromiseWorker;
472
+ promiseWorkerTransferable = PromiseWorker;
473
+ return promiseWorkerTransferable;
474
+ }
466
475
 
467
- var PromiseWorker$1 = /*@__PURE__*/getDefaultExportFromCjs(promiseWorkerTransferable);
476
+ var promiseWorkerTransferableExports = requirePromiseWorkerTransferable();
477
+ var PromiseWorker = /*@__PURE__*/getDefaultExportFromCjs(promiseWorkerTransferableExports);
468
478
 
469
479
  // @ts-expect-error untyped lib
470
480
  /**
@@ -475,7 +485,7 @@ var PromiseWorker$1 = /*@__PURE__*/getDefaultExportFromCjs(promiseWorkerTransfer
475
485
  */
476
486
  const getPromiseWorker = (worker) => {
477
487
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
478
- return new PromiseWorker$1(worker);
488
+ return new PromiseWorker(worker);
479
489
  };
480
490
  /**
481
491
  * Returns an interface where methods of the worker can be called by the host site
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @monogrid/gainmap-js v3.3.0
3
+ * With ❤️, by MONOGRID <gainmap@monogrid.com>
4
+ */
5
+ import{c as e,g as t}from"./_commonjsHelpers-FnzxO7yL.js";var r,n,o,s,i,c;function u(){if(s)return o;s=1;var t=function(){if(n)return r;n=1;var t,o,s=e.MutationObserver||e.WebKitMutationObserver;if(process.browser)if(s){var i=0,c=new s(f),u=e.document.createTextNode("");c.observe(u,{characterData:!0}),t=function(){u.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var a=new e.MessageChannel;a.port1.onmessage=f,t=function(){a.port2.postMessage(0)}}else t=function(){process.nextTick(f)};var l=[];function f(){var e,t;o=!0;for(var r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}o=!1}return r=function(e){1!==l.push(e)||o||t()}}();function i(){}var c={},u=["REJECTED"],a=["FULFILLED"],l=["PENDING"];if(!process.browser)var f=["UNHANDLED"];function h(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,process.browser||(this.handled=f),e!==i&&m(this,e)}function p(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function v(e,r,n){t(function(){var t;try{t=r(n)}catch(t){return c.reject(e,t)}t===e?c.reject(e,new TypeError("Cannot resolve promise with itself")):c.resolve(e,t)})}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function m(e,t){var r=!1;function n(t){r||(r=!0,c.reject(e,t))}function o(t){r||(r=!0,c.resolve(e,t))}var s=y(function(){t(o,n)});"error"===s.status&&n(s.value)}function y(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}return o=h,h.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},h.prototype.catch=function(e){return this.then(null,e)},h.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===u)return this;var r=new this.constructor(i);(process.browser||this.handled===f&&(this.handled=null),this.state!==l)?v(r,this.state===a?e:t,this.outcome):this.queue.push(new p(r,e,t));return r},p.prototype.callFulfilled=function(e){c.resolve(this.promise,e)},p.prototype.otherCallFulfilled=function(e){v(this.promise,this.onFulfilled,e)},p.prototype.callRejected=function(e){c.reject(this.promise,e)},p.prototype.otherCallRejected=function(e){v(this.promise,this.onRejected,e)},c.resolve=function(e,t){var r=y(d,t);if("error"===r.status)return c.reject(e,r.value);var n=r.value;if(n)m(e,n);else{e.state=a,e.outcome=t;for(var o=-1,s=e.queue.length;++o<s;)e.queue[o].callFulfilled(t)}return e},c.reject=function(e,r){e.state=u,e.outcome=r,process.browser||e.handled===f&&t(function(){e.handled===f&&process.emit("unhandledRejection",r,e)});for(var n=-1,o=e.queue.length;++n<o;)e.queue[n].callRejected(r);return e},h.resolve=function(e){if(e instanceof this)return e;return c.resolve(new this(i),e)},h.reject=function(e){var t=new this(i);return c.reject(t,e)},h.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var o=new Array(r),s=0,u=-1,a=new this(i);for(;++u<r;)l(e[u],u);return a;function l(e,i){t.resolve(e).then(function(e){o[i]=e,++s!==r||n||(n=!0,c.resolve(a,o))},function(e){n||(n=!0,c.reject(a,e))})}},h.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var o=-1,s=new this(i);for(;++o<r;)u(e[o]);return s;function u(e){t.resolve(e).then(function(e){n||(n=!0,c.resolve(s,e))},function(e){n||(n=!0,c.reject(s,e))})}},o}var a=function(){if(c)return i;c=1;var e="undefined"!=typeof Promise?Promise:u(),t=0;function r(e,t){var r=t.data;if(Array.isArray(r)&&!(r.length<2)){var n=r[0],o=r[1],s=r[2],i=e._callbacks[n];i&&(delete e._callbacks[n],i(o,s))}}function n(e){var t=this;t._worker=e,t._callbacks={},e.addEventListener("message",function(e){r(t,e)})}return n.prototype.postMessage=function(n,o){var s=this,i=t++,c=[i,n];return new e(function(e,t){if(s._callbacks[i]=function(r,n){if(r)return t(new Error(r.message));e(n)},void 0!==s._worker.controller){var n=new MessageChannel;n.port1.onmessage=function(e){r(s,e)},s._worker.controller.postMessage(c,[n.port2].concat(o))}else s._worker.postMessage(c,o)})},n.prototype.terminate=function(){this._worker.terminate()},i=n}(),l=t(a);const f=e=>new l(e),h=e=>({compress:t=>e.postMessage({type:"compress",payload:t})});export{f as getPromiseWorker,h as getWorkerInterface};