@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
@@ -1,6 +1,6 @@
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
6
  (function (factory) {
@@ -12,107 +12,122 @@
12
12
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
13
13
  }
14
14
 
15
- var isPromise$2 = {exports: {}};
15
+ var isPromise = {exports: {}};
16
16
 
17
- isPromise$2.exports = isPromise$1;
18
- isPromise$2.exports.default = isPromise$1;
17
+ var hasRequiredIsPromise;
19
18
 
20
- function isPromise$1(obj) {
21
- return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
19
+ function requireIsPromise () {
20
+ if (hasRequiredIsPromise) return isPromise.exports;
21
+ hasRequiredIsPromise = 1;
22
+ isPromise.exports = isPromise$1;
23
+ isPromise.exports.default = isPromise$1;
24
+
25
+ function isPromise$1(obj) {
26
+ return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
27
+ }
28
+ return isPromise.exports;
22
29
  }
23
30
 
24
- var isPromiseExports = isPromise$2.exports;
31
+ var register;
32
+ var hasRequiredRegister;
25
33
 
26
- var isPromise = isPromiseExports;
34
+ function requireRegister () {
35
+ if (hasRequiredRegister) return register;
36
+ hasRequiredRegister = 1;
37
+
38
+ var isPromise = requireIsPromise();
27
39
 
28
- function registerPromiseWorker(callback) {
40
+ function registerPromiseWorker(callback) {
29
41
 
30
- function postOutgoingMessage(e, messageId, error, result) {
31
- function postMessage(msg, transferList) {
32
- /* istanbul ignore if */
33
- if (typeof self.postMessage !== 'function') { // service worker
34
- e.ports[0].postMessage(msg, transferList);
35
- } else { // web worker
36
- self.postMessage(msg, transferList);
37
- }
38
- }
39
- if (error) {
40
- /* istanbul ignore else */
41
- if (typeof console !== 'undefined' && 'error' in console) {
42
- // This is to make errors easier to debug. I think it's important
43
- // enough to just leave here without giving the user an option
44
- // to silence it.
45
- console.error('Worker caught an error:', error);
46
- }
47
- postMessage([messageId, {
48
- message: error.message
49
- }]);
50
- } else {
51
- if (result instanceof MessageWithTransferList) {
52
- postMessage([messageId, null, result.message], result.transferList);
53
- } else {
54
- postMessage([messageId, null, result]);
55
- }
56
- }
57
- }
42
+ function postOutgoingMessage(e, messageId, error, result) {
43
+ function postMessage(msg, transferList) {
44
+ /* istanbul ignore if */
45
+ if (typeof self.postMessage !== 'function') { // service worker
46
+ e.ports[0].postMessage(msg, transferList);
47
+ } else { // web worker
48
+ self.postMessage(msg, transferList);
49
+ }
50
+ }
51
+ if (error) {
52
+ /* istanbul ignore else */
53
+ if (typeof console !== 'undefined' && 'error' in console) {
54
+ // This is to make errors easier to debug. I think it's important
55
+ // enough to just leave here without giving the user an option
56
+ // to silence it.
57
+ console.error('Worker caught an error:', error);
58
+ }
59
+ postMessage([messageId, {
60
+ message: error.message
61
+ }]);
62
+ } else {
63
+ if (result instanceof MessageWithTransferList) {
64
+ postMessage([messageId, null, result.message], result.transferList);
65
+ } else {
66
+ postMessage([messageId, null, result]);
67
+ }
68
+ }
69
+ }
58
70
 
59
- function tryCatchFunc(callback, message) {
60
- try {
61
- return {res: callback(message, withTransferList)};
62
- } catch (e) {
63
- return {err: e};
64
- }
65
- }
71
+ function tryCatchFunc(callback, message) {
72
+ try {
73
+ return {res: callback(message, withTransferList)};
74
+ } catch (e) {
75
+ return {err: e};
76
+ }
77
+ }
66
78
 
67
- function withTransferList(resMessage, transferList) {
68
- return new MessageWithTransferList(resMessage, transferList);
69
- }
79
+ function withTransferList(resMessage, transferList) {
80
+ return new MessageWithTransferList(resMessage, transferList);
81
+ }
70
82
 
71
- function handleIncomingMessage(e, callback, messageId, message) {
83
+ function handleIncomingMessage(e, callback, messageId, message) {
72
84
 
73
- var result = tryCatchFunc(callback, message);
85
+ var result = tryCatchFunc(callback, message);
74
86
 
75
- if (result.err) {
76
- postOutgoingMessage(e, messageId, result.err);
77
- } else if (!isPromise(result.res)) {
78
- postOutgoingMessage(e, messageId, null, result.res);
79
- } else {
80
- result.res.then(function (finalResult) {
81
- postOutgoingMessage(e, messageId, null, finalResult);
82
- }, function (finalError) {
83
- postOutgoingMessage(e, messageId, finalError);
84
- });
85
- }
86
- }
87
+ if (result.err) {
88
+ postOutgoingMessage(e, messageId, result.err);
89
+ } else if (!isPromise(result.res)) {
90
+ postOutgoingMessage(e, messageId, null, result.res);
91
+ } else {
92
+ result.res.then(function (finalResult) {
93
+ postOutgoingMessage(e, messageId, null, finalResult);
94
+ }, function (finalError) {
95
+ postOutgoingMessage(e, messageId, finalError);
96
+ });
97
+ }
98
+ }
87
99
 
88
- function onIncomingMessage(e) {
89
- var payload = e.data;
90
- if (!Array.isArray(payload) || payload.length !== 2) {
91
- // message doens't match communication format; ignore
92
- return;
93
- }
94
- var messageId = payload[0];
95
- var message = payload[1];
100
+ function onIncomingMessage(e) {
101
+ var payload = e.data;
102
+ if (!Array.isArray(payload) || payload.length !== 2) {
103
+ // message doens't match communication format; ignore
104
+ return;
105
+ }
106
+ var messageId = payload[0];
107
+ var message = payload[1];
96
108
 
97
- if (typeof callback !== 'function') {
98
- postOutgoingMessage(e, messageId, new Error(
99
- 'Please pass a function into register().'));
100
- } else {
101
- handleIncomingMessage(e, callback, messageId, message);
102
- }
103
- }
109
+ if (typeof callback !== 'function') {
110
+ postOutgoingMessage(e, messageId, new Error(
111
+ 'Please pass a function into register().'));
112
+ } else {
113
+ handleIncomingMessage(e, callback, messageId, message);
114
+ }
115
+ }
104
116
 
105
- function MessageWithTransferList(message, transferList) {
106
- this.message = message;
107
- this.transferList = transferList;
108
- }
117
+ function MessageWithTransferList(message, transferList) {
118
+ this.message = message;
119
+ this.transferList = transferList;
120
+ }
109
121
 
110
- self.addEventListener('message', onIncomingMessage);
111
- }
122
+ self.addEventListener('message', onIncomingMessage);
123
+ }
112
124
 
113
- var register = registerPromiseWorker;
125
+ register = registerPromiseWorker;
126
+ return register;
127
+ }
114
128
 
115
- var registerPromiseWorker$1 = /*@__PURE__*/getDefaultExportFromCjs(register);
129
+ var registerExports = requireRegister();
130
+ var registerPromiseWorker = /*@__PURE__*/getDefaultExportFromCjs(registerExports);
116
131
 
117
132
  /**
118
133
  * Used internally
@@ -125,7 +140,7 @@
125
140
  */
126
141
  const canvasToBlob = async (canvas, mimeType, quality) => {
127
142
  if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {
128
- return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 });
143
+ return canvas.convertToBlob({ type: mimeType, quality: quality });
129
144
  }
130
145
  else if (canvas instanceof HTMLCanvasElement) {
131
146
  return new Promise((resolve, reject) => {
@@ -134,7 +149,7 @@
134
149
  resolve(res);
135
150
  else
136
151
  reject(new Error('Failed to convert canvas to blob'));
137
- }, mimeType, quality || 0.9);
152
+ }, mimeType, quality);
138
153
  });
139
154
  }
140
155
  /* istanbul ignore next
@@ -157,7 +172,6 @@
157
172
  if (typeof createImageBitmap === 'undefined')
158
173
  throw new Error('createImageBitmap() not supported.');
159
174
  const { source, mimeType, quality, flipY } = params;
160
- // eslint-disable-next-line no-undef
161
175
  let imageBitmapSource;
162
176
  if ((source instanceof Uint8Array || source instanceof Uint8ClampedArray) && 'sourceMimeType' in params) {
163
177
  imageBitmapSource = new Blob([source], { type: params.sourceMimeType });
@@ -180,6 +194,8 @@
180
194
  canvas.width = width;
181
195
  canvas.height = height;
182
196
  }
197
+ // apparently we do need to assert the type here for npx tsc to be happy
198
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
183
199
  const ctx = canvas.getContext('2d');
184
200
  if (!ctx)
185
201
  throw new Error('Failed to create canvas Context');
@@ -208,7 +224,7 @@
208
224
  }, [result.data.buffer, message.payload.source instanceof ImageData ? message.payload.source.data.buffer : message.payload.source.buffer]);
209
225
  };
210
226
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
211
- registerPromiseWorker$1(async (message, withTransferList) => {
227
+ registerPromiseWorker(async (message, withTransferList) => {
212
228
  switch (message.type) {
213
229
  // case 'encode-gainmap-buffers':
214
230
  // return encodeGainmapBuffers(message, withTransferList)
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @monogrid/gainmap-js v3.3.0
3
+ * With ❤️, by MONOGRID <gainmap@monogrid.com>
4
+ */
5
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,n,r,a={exports:{}};function o(){if(t)return a.exports;function e(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}return t=1,a.exports=e,a.exports.default=e,a.exports}var s=function(){if(r)return n;r=1;var e=o();return n=function(t){function n(e,t,n,r){function a(t,n){"function"!=typeof self.postMessage?e.ports[0].postMessage(t,n):self.postMessage(t,n)}n?("undefined"!=typeof console&&"error"in console&&console.error("Worker caught an error:",n),a([t,{message:n.message}])):r instanceof o?a([t,null,r.message],r.transferList):a([t,null,r])}function r(e,t){return new o(e,t)}function a(t,a,o,s){var i=function(e,t){try{return{res:e(t,r)}}catch(e){return{err:e}}}(a,s);i.err?n(t,o,i.err):e(i.res)?i.res.then(function(e){n(t,o,null,e)},function(e){n(t,o,e)}):n(t,o,null,i.res)}function o(e,t){this.message=e,this.transferList=t}self.addEventListener("message",function(e){var r=e.data;if(Array.isArray(r)&&2===r.length){var o=r[0],s=r[1];"function"!=typeof t?n(e,o,new Error("Please pass a function into register().")):a(e,t,o,s)}})}}();const i=async e=>{if("undefined"==typeof createImageBitmap)throw new Error("createImageBitmap() not supported.");const{source:t,mimeType:n,quality:r,flipY:a}=e;let o;if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&"sourceMimeType"in e)o=new Blob([t],{type:e.sourceMimeType});else{if(!(t instanceof ImageData))throw new Error("Invalid source image");o=t}const s=await createImageBitmap(o),i=s.width,f=s.height;let c;"undefined"!=typeof OffscreenCanvas?c=new OffscreenCanvas(i,f):(c=document.createElement("canvas"),c.width=i,c.height=f);const u=c.getContext("2d");if(!u)throw new Error("Failed to create canvas Context");!0===a&&(u.translate(0,f),u.scale(1,-1)),u.drawImage(s,0,0,i,f);const l=await(async(e,t,n)=>{if("undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:n});if(e instanceof HTMLCanvasElement)return new Promise((r,a)=>{e.toBlob(e=>{e?r(e):a(new Error("Failed to convert canvas to blob"))},t,n)});throw new Error("Unsupported canvas element")})(c,n,r||.9);return{data:new Uint8Array(await l.arrayBuffer()),mimeType:n,width:i,height:f}};e(s)(async(e,t)=>{if("compress"===e.type)return(async(e,t)=>{const n=await i(e.payload);return t({...n,source:e.payload.source instanceof ImageData?e.payload.source.data:new Uint8ClampedArray(e.payload.source)},[n.data.buffer,e.payload.source instanceof ImageData?e.payload.source.data.buffer:e.payload.source.buffer])})(e,t)})});
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "@monogrid/gainmap-js",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gain map",
5
- "homepage": "https://github.com/MONOGRID/gainmap-js#readme",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+ssh://git@github.com/MONOGRID/gainmap-js.git"
9
- },
10
5
  "keywords": [
11
6
  "hdr",
12
7
  "gain map",
@@ -14,23 +9,16 @@
14
9
  "three",
15
10
  "threejs"
16
11
  ],
17
- "author": "MONOGRID <rnd@monogrid.com>",
18
- "license": "MIT",
12
+ "homepage": "https://github.com/MONOGRID/gainmap-js#readme",
19
13
  "bugs": {
20
14
  "url": "https://github.com/MONOGRID/gainmap-js/issues"
21
15
  },
22
- "publishConfig": {
23
- "access": "public",
24
- "registry": "https://registry.npmjs.org/"
25
- },
26
- "config": {
27
- "commitizen": {
28
- "path": "./node_modules/cz-conventional-changelog"
29
- }
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+ssh://git@github.com/MONOGRID/gainmap-js.git"
30
19
  },
31
- "main": "dist/decode.umd.cjs",
32
- "module": "dist/decode.js",
33
- "types": "dist/decode.d.ts",
20
+ "license": "MIT",
21
+ "author": "MONOGRID <gainmap@monogrid.com>",
34
22
  "sideEffects": false,
35
23
  "type": "module",
36
24
  "exports": {
@@ -39,6 +27,11 @@
39
27
  "import": "./dist/decode.js",
40
28
  "default": "./dist/decode.umd.cjs"
41
29
  },
30
+ "./webgpu": {
31
+ "types": "./dist/decode/webgpu/index.d.ts",
32
+ "import": "./dist/decode.webgpu.js",
33
+ "default": "./dist/decode.webgpu.umd.cjs"
34
+ },
42
35
  "./encode": {
43
36
  "types": "./dist/encode.d.ts",
44
37
  "import": "./dist/encode.js",
@@ -60,11 +53,20 @@
60
53
  "default": "./dist/worker-interface.umd.cjs"
61
54
  }
62
55
  },
56
+ "main": "dist/decode.umd.cjs",
57
+ "module": "dist/decode.js",
58
+ "types": "dist/decode.d.ts",
63
59
  "typesVersions": {
64
60
  "*": {
65
61
  ".": [
66
62
  "./dist/decode.d.ts"
67
63
  ],
64
+ "decode/webgpu": [
65
+ "./dist/decode/webgpu/index.d.ts"
66
+ ],
67
+ "decode/webgl": [
68
+ "./dist/decode/webgl/index.d.ts"
69
+ ],
68
70
  "encode": [
69
71
  "./dist/encode.d.ts"
70
72
  ],
@@ -81,80 +83,85 @@
81
83
  },
82
84
  "scripts": {
83
85
  "build": "rollup -c",
84
- "dev": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
85
- "start": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
86
- "test": "nyc --reporter=text --reporter=lcov playwright test",
87
- "test:startserver": "rollup -c && servez",
88
- "test:docker": "docker run --rm --network host -v $(pwd):/work -w /work -it -u $(id -u ${USER}):$(id -g ${USER}) mcr.microsoft.com/playwright:v1.46.0-jammy /bin/bash",
89
- "test:codegen": "playwright codegen http://localhost:8080",
90
- "prepack": "npm run build",
91
86
  "check": "concurrently -c auto npm:check:*",
92
- "check:typecheck-src": "tsc -p src",
87
+ "check:eslint-examples": "eslint \"examples/**/*.{ts,html}\"",
93
88
  "check:eslint-src": "eslint \"src/**/*.ts\"",
89
+ "check:eslint-tests": "eslint \"tests/**/*.ts\"",
94
90
  "check:typecheck-examples": "tsc -p examples",
95
- "check:eslint-examples": "eslint \"examples/**/*.{ts,html}\"",
91
+ "check:typecheck-src": "tsc -p src",
96
92
  "check:typecheck-tests": "tsc -p tests",
97
- "check:eslint-tests": "eslint \"tests/**/*.ts\"",
98
93
  "ci:check": "concurrently npm:ci:check:*",
99
- "ci:check:typecheck-src": "tsc --pretty false -p src > reports/typecheck.log",
94
+ "ci:check:eslint-examples": "eslint --format json --output-file reports/eslint-examples.json \"examples/**/*.{ts,html}\"",
100
95
  "ci:check:eslint-src": "eslint --format json --output-file reports/eslint-src.json \"src/**/*.ts\"",
96
+ "ci:check:eslint-tests": "eslint --format json --output-file reports/eslint-tests.json \"tests/**/*.ts\"",
101
97
  "ci:check:typecheck-examples": "tsc --pretty false -p examples > reports/typecheck-examples.log",
102
- "ci:check:eslint-examples": "eslint --format json --output-file reports/eslint-examples.json \"examples/**/*.{ts,html}\"",
98
+ "ci:check:typecheck-src": "tsc --pretty false -p src > reports/typecheck.log",
103
99
  "ci:check:typecheck-tests": "tsc --pretty false -p tests > reports/typecheck-tests.log",
104
- "ci:check:eslint-tests": "eslint --format json --output-file reports/eslint-tests.json \"tests/**/*.ts\""
100
+ "dev": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
101
+ "prepack": "npm run build",
102
+ "start": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
103
+ "test": "nyc --reporter=text --reporter=lcov playwright test",
104
+ "test:codegen": "playwright codegen http://localhost:8080",
105
+ "test:docker": "docker run --rm --network host -v $(pwd):/work -w /work -it -u $(id -u ${USER}):$(id -g ${USER}) mcr.microsoft.com/playwright:v1.56.1-jammy /bin/bash",
106
+ "test:startserver": "rollup -c && servez"
105
107
  },
106
- "peerDependencies": {
107
- "three": ">= 0.159.0"
108
+ "config": {
109
+ "commitizen": {
110
+ "path": "./node_modules/cz-conventional-changelog"
111
+ }
108
112
  },
113
+ "browserslist": [
114
+ "> 1%, not dead, not ie 11, not op_mini all"
115
+ ],
109
116
  "dependencies": {
110
117
  "promise-worker-transferable": "^1.0.4"
111
118
  },
112
119
  "devDependencies": {
113
- "@playwright/test": "^1.46.0",
114
- "@rollup/plugin-commonjs": "^26.0.1",
120
+ "@eslint/eslintrc": "^3.3.1",
121
+ "@playwright/test": "^1.56.1",
122
+ "@rollup/plugin-commonjs": "^29.0.0",
115
123
  "@rollup/plugin-json": "^6.1.0",
116
- "@rollup/plugin-node-resolve": "^15.2.3",
124
+ "@rollup/plugin-node-resolve": "^16.0.3",
117
125
  "@rollup/plugin-terser": "^0.4.4",
118
- "@rollup/plugin-typescript": "^11.1.6",
126
+ "@rollup/plugin-typescript": "^12.3.0",
119
127
  "@semantic-release/changelog": "^6.0.3",
120
- "@semantic-release/commit-analyzer": "^13.0.0",
128
+ "@semantic-release/commit-analyzer": "^13.0.1",
121
129
  "@semantic-release/git": "github:semantic-release/git",
122
- "@semantic-release/github": "^10.1.3",
123
- "@semantic-release/npm": "^12.0.1",
124
- "@semantic-release/release-notes-generator": "^14.0.1",
125
- "@types/node": "^20.14.9",
126
- "@types/three": "^0.170.0",
127
- "@typescript-eslint/eslint-plugin": "^7.15.0",
128
- "@typescript-eslint/parser": "^7.15.0",
129
- "concurrently": "^8.2.2",
130
- "conventional-changelog-conventionalcommits": "^8.0.0",
130
+ "@semantic-release/github": "^12.0.0",
131
+ "@semantic-release/npm": "^13.1.1",
132
+ "@semantic-release/release-notes-generator": "^14.1.0",
133
+ "@types/node": "^22.18.12",
134
+ "@types/three": "^0.181.0",
135
+ "concurrently": "^9.2.1",
136
+ "conventional-changelog-conventionalcommits": "^9.1.0",
131
137
  "cz-conventional-changelog": "^3.3.0",
132
- "eslint": "^8.56.0",
138
+ "eslint": "^9.38.0",
133
139
  "eslint-config-mdcs": "^5.0.0",
134
- "eslint-config-standard": "^17.1.0",
135
- "eslint-plugin-compat": "^4.2.0",
136
- "eslint-plugin-html": "^8.0.0",
137
- "eslint-plugin-import": "^2.29.1",
138
- "eslint-plugin-n": "^16.6.2",
139
- "eslint-plugin-promise": "^6.4.0",
140
- "eslint-plugin-simple-import-sort": "^12.0.0",
141
- "eslint-plugin-unused-imports": "^3.2.0",
142
- "nyc": "^17.0.0",
143
- "rollup": "^4.20.0",
140
+ "eslint-plugin-html": "^8.1.3",
141
+ "eslint-plugin-simple-import-sort": "^12.1.1",
142
+ "eslint-plugin-unused-imports": "^4.3.0",
143
+ "globals": "^16.4.0",
144
+ "neostandard": "^0.12.2",
145
+ "nyc": "^17.1.0",
146
+ "rollup": "^4.52.5",
144
147
  "rollup-plugin-copy": "^3.5.0",
145
- "rollup-plugin-delete": "^2.0.0",
148
+ "rollup-plugin-delete": "^3.0.1",
146
149
  "rollup-plugin-istanbul": "^5.0.0",
147
- "rollup-plugin-license": "^3.5.2",
148
- "semantic-release": "^24.0.0",
149
- "servez": "^2.2.3",
150
- "sharp": "^0.33.4",
151
- "three": "^0.170.0",
152
- "typedoc": "^0.26.5",
153
- "typedoc-github-wiki-theme": "^2.0.0",
154
- "typedoc-plugin-markdown": "^4.2.3",
155
- "typescript": "^5.5.4"
150
+ "rollup-plugin-license": "^3.6.0",
151
+ "semantic-release": "^25.0.1",
152
+ "servez": "^2.3.2",
153
+ "sharp": "^0.34.4",
154
+ "three": "^0.181.1",
155
+ "typedoc": "^0.28.14",
156
+ "typedoc-github-wiki-theme": "^2.1.0",
157
+ "typedoc-plugin-markdown": "^4.9.0",
158
+ "typescript": "~5.9.0"
156
159
  },
157
- "browserslist": [
158
- "> 1%, not dead, not ie 11, not op_mini all"
159
- ]
160
+ "peerDependencies": {
161
+ "three": ">= 0.159.0"
162
+ },
163
+ "publishConfig": {
164
+ "access": "public",
165
+ "registry": "https://registry.npmjs.org/"
166
+ }
160
167
  }
@@ -1,45 +0,0 @@
1
- import { HalfFloatType, Loader, LoadingManager, WebGLRenderer } from 'three';
2
- import { QuadRenderer } from '../../core/QuadRenderer';
3
- import { type GainMapMetadata, QuadRendererTextureOptions } from '../../core/types';
4
- import { GainMapDecoderMaterial } from '../materials/GainMapDecoderMaterial';
5
- export declare class LoaderBase<TUrl = string> extends Loader<QuadRenderer<typeof HalfFloatType, GainMapDecoderMaterial>, TUrl> {
6
- private _renderer?;
7
- private _renderTargetOptions?;
8
- /**
9
- * @private
10
- */
11
- protected _internalLoadingManager: LoadingManager;
12
- /**
13
- *
14
- * @param renderer
15
- * @param manager
16
- */
17
- constructor(renderer?: WebGLRenderer, manager?: LoadingManager);
18
- /**
19
- * Specify the renderer to use when rendering the gain map
20
- *
21
- * @param renderer
22
- * @returns
23
- */
24
- setRenderer(renderer: WebGLRenderer): this;
25
- /**
26
- * Specify the renderTarget options to use when rendering the gain map
27
- *
28
- * @param options
29
- * @returns
30
- */
31
- setRenderTargetOptions(options: QuadRendererTextureOptions): this;
32
- /**
33
- * @private
34
- * @returns
35
- */
36
- protected prepareQuadRenderer(): QuadRenderer<1016, GainMapDecoderMaterial>;
37
- /**
38
- * @private
39
- * @param quadRenderer
40
- * @param metadata
41
- * @param sdrBuffer
42
- * @param gainMapBuffer
43
- */
44
- protected render(quadRenderer: QuadRenderer<typeof HalfFloatType, GainMapDecoderMaterial>, metadata: GainMapMetadata, sdrBuffer: ArrayBuffer, gainMapBuffer?: ArrayBuffer): Promise<void>;
45
- }
@@ -1,42 +0,0 @@
1
- import { type Texture, type WebGLRenderer } from 'three';
2
- import { type GainMapMetadata, type QuadRendererTextureOptions } from '../core/types';
3
- /**
4
- * Necessary parameters for decoding a Gainmap
5
- *
6
- * @category Specs
7
- * @group Specs
8
- */
9
- export type GainmapDecodingParameters = {
10
- /**
11
- * The maximum available boost supported by a display, at a given point in time.
12
- *
13
- * @remarks
14
- * This value can change over time based on device settings and other factors,
15
- * such as ambient light conditions, or how many bright pixels are on the screen.
16
- *
17
- * Non Logarithmic space
18
- */
19
- maxDisplayBoost: number;
20
- };
21
- /**
22
- * @category Decoding Functions
23
- * @group Decoding Functions
24
- */
25
- export type DecodeParameters = {
26
- /**
27
- * An Texture containing the SDR Rendition
28
- */
29
- sdr: Texture;
30
- /**
31
- * An Texture containing the GainMap recovery image
32
- */
33
- gainMap: Texture;
34
- /**
35
- * WebGLRenderer used to decode the GainMap
36
- */
37
- renderer?: WebGLRenderer;
38
- /**
39
- * Options to use when creating the output renderTarget
40
- */
41
- renderTargetOptions?: QuadRendererTextureOptions;
42
- } & GainmapDecodingParameters & GainMapMetadata;
@@ -1,28 +0,0 @@
1
- import { GainMapMetadata } from '../core/types';
2
- /**
3
- * Decodes a JPEG file with an embedded Gainmap and XMP Metadata (aka JPEG-R)
4
- *
5
- * @category Decoding
6
- * @group Decoding
7
- * @deprecated
8
- * @example
9
- * import { decodeJPEGMetadata } from '@monogrid/gainmap-js/libultrahdr'
10
- *
11
- * // fetch a JPEG image containing a gainmap as ArrayBuffer
12
- * const gainmap = new Uint8Array(await (await fetch('gainmap.jpeg')).arrayBuffer())
13
- *
14
- * // extract data from the JPEG
15
- * const { gainMap, sdr, parsedMetadata } = await decodeJPEGMetadata(gainmap)
16
- *
17
- * @param file A Jpeg file Uint8Array.
18
- * @returns The decoded data
19
- * @throws {Error} if the provided file cannot be parsed or does not contain a valid Gainmap
20
- */
21
- export declare const decodeJPEGMetadata: (file: Uint8Array) => Promise<{
22
- parsedMetadata: GainMapMetadata;
23
- metadata: ArrayBuffer | Uint8Array | Uint8ClampedArray | Int8Array | string;
24
- success: boolean;
25
- errorMessage: any;
26
- sdr: any;
27
- gainMap: any;
28
- }>;
@@ -1,9 +0,0 @@
1
- import { MainModule } from '../../libultrahdr-wasm/build/libultrahdr';
2
- /**
3
- * Instances the WASM module and returns it, only one module will be created upon multiple calls.
4
- * @category WASM
5
- * @group WASM
6
- *
7
- * @returns
8
- */
9
- export declare const getLibrary: () => Promise<MainModule>;
Binary file