@monogrid/gainmap-js 3.0.0 → 3.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [3.0.2](https://github.com/MONOGRID/gainmap-js/compare/v3.0.1...v3.0.2) (2024-01-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **encode:** encodes a valid image when an invalid tonemapping value was provided as input ([94cec23](https://github.com/MONOGRID/gainmap-js/commit/94cec2363aa0dcb3cc46fca048c68ed7e555ebd0))
7
+
8
+ ## [3.0.1](https://github.com/MONOGRID/gainmap-js/compare/v3.0.0...v3.0.1) (2023-12-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **encode:** hdrCapacityMax correctly computed in output metadata ([f5f2215](https://github.com/MONOGRID/gainmap-js/commit/f5f22152eb236831cb9f23646445e6459be18285))
14
+ * **encode:** findTextureMinMax correctly finds min values in textures ([fd94680](https://github.com/MONOGRID/gainmap-js/commit/fd94680a76fdb04b5aa85b4210f3aec21b45a727))
15
+
1
16
  # [3.0.0](https://github.com/MONOGRID/gainmap-js/compare/v2.0.7...v3.0.0) (2023-11-29)
2
17
 
3
18
 
@@ -60,7 +60,7 @@ representative at an online or offline event.
60
60
 
61
61
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
62
  reported to the community leaders responsible for enforcement at
63
- rnd@mono-grid.com.
63
+ rnd@monogrid.com.
64
64
  All complaints will be reviewed and investigated promptly and fairly.
65
65
 
66
66
  All community leaders are obligated to respect the privacy and security of the
package/CONTRIBUTING.md CHANGED
@@ -81,7 +81,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform
81
81
  <!-- omit in toc -->
82
82
  #### How Do I Submit a Good Bug Report?
83
83
 
84
- > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <rnd@mono-grid.com>.
84
+ > You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <rnd@monogrid.com>.
85
85
  <!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
86
86
 
87
87
  We use GitHub issues to track bugs and errors. If you run into an issue with the project:
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  # gainmap-js
2
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMONOGRID%2Fgainmap-js.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMONOGRID%2Fgainmap-js?ref=badge_shield)
3
+
2
4
  A Javascript (TypeScript) Encoder/Decoder Implementation of Adobe's Gain Map Technology for storing HDR Images using an SDR Image + a "Gain map"
3
5
 
4
6
  > :warning: This library **is primarily intended** for encoding and decoding gain map images for the [three.js](https://github.com/mrdoob/three.js/) 3D Library
@@ -14,7 +16,7 @@ Compares loading:
14
16
  2. a `webp` sdr file + a `webp` gain map + metadata JSON
15
17
  3. a comparable size `.hdr` file for comparison
16
18
 
17
- ## [Free online encoder](https://gainmap-creator.mono-grid.com)
19
+ ## [Free online encoder](https://gainmap-creator.monogrid.com)
18
20
 
19
21
  Use it to convert `.hdr` and `.exr` files into gain maps. It's free and the whole process happens in your browser.
20
22
 
@@ -90,14 +92,15 @@ const mesh = new Mesh(
90
92
  scene.add(mesh)
91
93
  renderer.render(scene, new PerspectiveCamera())
92
94
 
93
- // `result.renderTarget.texture` must be
94
- // converted to `DataTexture` in order
95
- // to use it as Equirectangular scene background
96
- // if needed
97
95
 
98
- scene.background = result.toDataTexture()
96
+ // Starting from three.js r159
97
+ // `result.renderTarget.texture` can
98
+ // also be used as Equirectangular scene background
99
+ //
100
+ // it was previously needed to convert it
101
+ // to a DataTexture with `result.toDataTexture()`
102
+ scene.background = result.renderTarget.texture
99
103
  scene.background.mapping = EquirectangularReflectionMapping
100
- scene.background.minFilter = LinearFilter
101
104
 
102
105
 
103
106
  // result must be manually disposed
@@ -143,14 +146,15 @@ const mesh = new Mesh(
143
146
  scene.add(mesh)
144
147
  renderer.render(scene, new PerspectiveCamera())
145
148
 
146
- // `result.renderTarget.texture` must be
147
- // converted to `DataTexture` in order
148
- // to use it as Equirectangular scene background
149
- // if needed
150
149
 
151
- scene.background = result.toDataTexture()
150
+ // Starting from three.js r159
151
+ // `result.renderTarget.texture` can
152
+ // also be used as Equirectangular scene background
153
+ //
154
+ // it was previously needed to convert it
155
+ // to a DataTexture with `result.toDataTexture()`
156
+ scene.background = result.renderTarget.texture
152
157
  scene.background.mapping = EquirectangularReflectionMapping
153
- scene.background.minFilter = LinearFilter
154
158
 
155
159
  // result must be manually disposed
156
160
  // when you are done using it
@@ -252,3 +256,7 @@ module.exports = defineConfig({
252
256
 
253
257
  * [Adobe Gainmap Specification](https://helpx.adobe.com/camera-raw/using/gain-map.html)
254
258
  * [Ultra HDR Image Format v1.0](https://developer.android.com/guide/topics/media/platform/hdr-image-format)
259
+
260
+
261
+ ## License
262
+ [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMONOGRID%2Fgainmap-js.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FMONOGRID%2Fgainmap-js?ref=badge_large)
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  import { RGBAFormat, LinearFilter, ClampToEdgeWrapping, Scene, OrthographicCamera, HalfFloatType, FloatType, Mesh, PlaneGeometry, WebGLRenderTarget, UVMapping, WebGLRenderer, DataTexture, LinearSRGBColorSpace, ShaderMaterial, Texture, IntType, ShortType, ByteType, UnsignedIntType, UnsignedByteType, MeshBasicMaterial } from 'three';
@@ -103,8 +103,8 @@ class QuadRenderer {
103
103
  depthBuffer: false,
104
104
  stencilBuffer: false,
105
105
  // user options
106
- type: this._type,
107
- colorSpace: this._colorSpace,
106
+ type: this._type, // set in class property
107
+ colorSpace: this._colorSpace, // set in class property
108
108
  anisotropy: ((_a = options.renderTargetOptions) === null || _a === void 0 ? void 0 : _a.anisotropy) !== undefined ? (_b = options.renderTargetOptions) === null || _b === void 0 ? void 0 : _b.anisotropy : 1,
109
109
  generateMipmaps: ((_c = options.renderTargetOptions) === null || _c === void 0 ? void 0 : _c.generateMipmaps) !== undefined ? (_d = options.renderTargetOptions) === null || _d === void 0 ? void 0 : _d.generateMipmaps : false,
110
110
  magFilter: ((_e = options.renderTargetOptions) === null || _e === void 0 ? void 0 : _e.magFilter) !== undefined ? (_f = options.renderTargetOptions) === null || _f === void 0 ? void 0 : _f.magFilter : LinearFilter,
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  /**
@@ -13,17 +13,24 @@
13
13
  * @returns
14
14
  */
15
15
  const canvasToBlob = async (canvas, mimeType, quality) => {
16
- if (canvas instanceof OffscreenCanvas) {
16
+ if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {
17
17
  return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 });
18
18
  }
19
- return new Promise((resolve, reject) => {
20
- canvas.toBlob((res) => {
21
- if (res)
22
- resolve(res);
23
- else
24
- reject(new Error('Failed to convert canvas to blob'));
25
- }, mimeType, quality || 0.9);
26
- });
19
+ else if (canvas instanceof HTMLCanvasElement) {
20
+ return new Promise((resolve, reject) => {
21
+ canvas.toBlob((res) => {
22
+ if (res)
23
+ resolve(res);
24
+ else
25
+ reject(new Error('Failed to convert canvas to blob'));
26
+ }, mimeType, quality || 0.9);
27
+ });
28
+ }
29
+ /* istanbul ignore next
30
+ as long as this function is not exported this is only here
31
+ to satisfy TS strict mode internally
32
+ */
33
+ throw new Error('Unsupported canvas element');
27
34
  };
28
35
  /**
29
36
  * Converts a RAW RGBA image buffer into the provided `mimeType` using the provided `quality`
@@ -59,6 +66,8 @@ const compress = async (params) => {
59
66
  }
60
67
  else {
61
68
  canvas = document.createElement('canvas');
69
+ canvas.width = width;
70
+ canvas.height = height;
62
71
  }
63
72
  const ctx = canvas.getContext('2d');
64
73
  if (!ctx)
@@ -7,3 +7,5 @@ export * from './loaders/HDRJPGLoader';
7
7
  export { HDRJPGLoader as JPEGRLoader } from './loaders/HDRJPGLoader';
8
8
  export * from './materials/GainMapDecoderMaterial';
9
9
  export * from './types';
10
+ export * from './utils/extractXMP';
11
+ export * from './utils/MPFExtractor';
@@ -36,14 +36,14 @@ import { LoaderBase } from './LoaderBase';
36
36
  * scene.add(mesh)
37
37
  * renderer.render(scene, new PerspectiveCamera())
38
38
  *
39
- * // `result.renderTarget.texture` must be
40
- * // converted to `DataTexture` in order
41
- * // to use it as Equirectangular scene background
42
- * // if needed
43
- *
44
- * scene.background = result.toDataTexture()
39
+ * // Starting from three.js r159
40
+ * // `result.renderTarget.texture` can
41
+ * // also be used as Equirectangular scene background
42
+ * //
43
+ * // it was previously needed to convert it
44
+ * // to a DataTexture with `result.toDataTexture()`
45
+ * scene.background = result.renderTarget.texture
45
46
  * scene.background.mapping = EquirectangularReflectionMapping
46
- * scene.background.minFilter = LinearFilter
47
47
  *
48
48
  * // result must be manually disposed
49
49
  * // when you are done using it
@@ -36,14 +36,14 @@ import { LoaderBase } from './LoaderBase';
36
36
  * scene.add(mesh)
37
37
  * renderer.render(scene, new PerspectiveCamera())
38
38
  *
39
- * // `result.renderTarget.texture` must be
40
- * // converted to `DataTexture` in order
41
- * // to use it as Equirectangular scene background
42
- * // if needed
43
- *
44
- * scene.background = result.toDataTexture()
39
+ * // Starting from three.js r159
40
+ * // `result.renderTarget.texture` can
41
+ * // also be used as Equirectangular scene background
42
+ * //
43
+ * // it was previously needed to convert it
44
+ * // to a DataTexture with `result.toDataTexture()`
45
+ * scene.background = result.renderTarget.texture
45
46
  * scene.background.mapping = EquirectangularReflectionMapping
46
- * scene.background.minFilter = LinearFilter
47
47
  *
48
48
  * // result must be manually disposed
49
49
  * // when you are done using it
@@ -1,4 +1,4 @@
1
- type MPFExtractorOptions = {
1
+ export type MPFExtractorOptions = {
2
2
  debug: boolean;
3
3
  extractFII: boolean;
4
4
  extractNonFII: boolean;
@@ -19,4 +19,3 @@ export declare class MPFExtractor {
19
19
  constructor(options?: Partial<MPFExtractorOptions>);
20
20
  extract(imageArrayBuffer: Uint8Array): Promise<Blob[]>;
21
21
  }
22
- export {};
package/dist/decode.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
- import { Q as QuadRenderer } from './QuadRenderer-LVKXL-q4.js';
6
+ import { Q as QuadRenderer } from './QuadRenderer-Nn9ZcWDa.js';
7
7
  import { ShaderMaterial, Vector3, NoBlending, SRGBColorSpace, LinearSRGBColorSpace, HalfFloatType, Loader, LoadingManager, Texture, UVMapping, ClampToEdgeWrapping, LinearFilter, LinearMipMapLinearFilter, RGBAFormat, UnsignedByteType, FileLoader } from 'three';
8
8
 
9
9
  const vertexShader = /* glsl */ `
@@ -212,7 +212,7 @@ const decode = (params) => {
212
212
  }
213
213
  sdr.needsUpdate = true;
214
214
  if (gainMap.colorSpace !== LinearSRGBColorSpace) {
215
- console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*');
215
+ console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically');
216
216
  gainMap.colorSpace = LinearSRGBColorSpace;
217
217
  }
218
218
  gainMap.needsUpdate = true;
@@ -676,14 +676,14 @@ class LoaderBase extends Loader {
676
676
  * scene.add(mesh)
677
677
  * renderer.render(scene, new PerspectiveCamera())
678
678
  *
679
- * // `result.renderTarget.texture` must be
680
- * // converted to `DataTexture` in order
681
- * // to use it as Equirectangular scene background
682
- * // if needed
683
- *
684
- * scene.background = result.toDataTexture()
679
+ * // Starting from three.js r159
680
+ * // `result.renderTarget.texture` can
681
+ * // also be used as Equirectangular scene background
682
+ * //
683
+ * // it was previously needed to convert it
684
+ * // to a DataTexture with `result.toDataTexture()`
685
+ * scene.background = result.renderTarget.texture
685
686
  * scene.background.mapping = EquirectangularReflectionMapping
686
- * scene.background.minFilter = LinearFilter
687
687
  *
688
688
  * // result must be manually disposed
689
689
  * // when you are done using it
@@ -759,6 +759,9 @@ class GainMapLoader extends LoaderBase {
759
759
  sdrLoader.setPath(this.path);
760
760
  sdrLoader.setWithCredentials(this.withCredentials);
761
761
  sdrLoader.load(sdrUrl, async (buffer) => {
762
+ /* istanbul ignore if
763
+ this condition exists only because of three.js types + strict mode
764
+ */
762
765
  if (typeof buffer === 'string')
763
766
  throw new Error('Invalid sdr buffer');
764
767
  sdr = buffer;
@@ -779,6 +782,9 @@ class GainMapLoader extends LoaderBase {
779
782
  gainMapLoader.setPath(this.path);
780
783
  gainMapLoader.setWithCredentials(this.withCredentials);
781
784
  gainMapLoader.load(gainMapUrl, async (buffer) => {
785
+ /* istanbul ignore if
786
+ this condition exists only because of three.js types + strict mode
787
+ */
782
788
  if (typeof buffer === 'string')
783
789
  throw new Error('Invalid gainmap buffer');
784
790
  gainMap = buffer;
@@ -799,6 +805,9 @@ class GainMapLoader extends LoaderBase {
799
805
  metadataLoader.setPath(this.path);
800
806
  metadataLoader.setWithCredentials(this.withCredentials);
801
807
  metadataLoader.load(metadataUrl, async (json) => {
808
+ /* istanbul ignore if
809
+ this condition exists only because of three.js types + strict mode
810
+ */
802
811
  if (typeof json !== 'string')
803
812
  throw new Error('Invalid metadata string');
804
813
  // TODO: implement check on JSON file and remove this eslint disable
@@ -853,14 +862,14 @@ class GainMapLoader extends LoaderBase {
853
862
  * scene.add(mesh)
854
863
  * renderer.render(scene, new PerspectiveCamera())
855
864
  *
856
- * // `result.renderTarget.texture` must be
857
- * // converted to `DataTexture` in order
858
- * // to use it as Equirectangular scene background
859
- * // if needed
860
- *
861
- * scene.background = result.toDataTexture()
865
+ * // Starting from three.js r159
866
+ * // `result.renderTarget.texture` can
867
+ * // also be used as Equirectangular scene background
868
+ * //
869
+ * // it was previously needed to convert it
870
+ * // to a DataTexture with `result.toDataTexture()`
871
+ * scene.background = result.renderTarget.texture
862
872
  * scene.background.mapping = EquirectangularReflectionMapping
863
- * scene.background.minFilter = LinearFilter
864
873
  *
865
874
  * // result must be manually disposed
866
875
  * // when you are done using it
@@ -887,6 +896,9 @@ class HDRJPGLoader extends LoaderBase {
887
896
  loader.setWithCredentials(this.withCredentials);
888
897
  this.manager.itemStart(url);
889
898
  loader.load(url, async (jpeg) => {
899
+ /* istanbul ignore if
900
+ this condition exists only because of three.js types + strict mode
901
+ */
890
902
  if (typeof jpeg === 'string')
891
903
  throw new Error('Invalid buffer, received [string], was expecting [ArrayBuffer]');
892
904
  const jpegBuffer = new Uint8Array(jpeg);
@@ -943,4 +955,4 @@ class HDRJPGLoader extends LoaderBase {
943
955
  }
944
956
  }
945
957
 
946
- export { GainMapDecoderMaterial, GainMapLoader, HDRJPGLoader, HDRJPGLoader as JPEGRLoader, QuadRenderer, decode, extractGainmapFromJPEG };
958
+ export { GainMapDecoderMaterial, GainMapLoader, HDRJPGLoader, HDRJPGLoader as JPEGRLoader, MPFExtractor, QuadRenderer, decode, extractGainmapFromJPEG, extractXMP };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  (function (global, factory) {
@@ -107,8 +107,8 @@
107
107
  depthBuffer: false,
108
108
  stencilBuffer: false,
109
109
  // user options
110
- type: this._type,
111
- colorSpace: this._colorSpace,
110
+ type: this._type, // set in class property
111
+ colorSpace: this._colorSpace, // set in class property
112
112
  anisotropy: ((_a = options.renderTargetOptions) === null || _a === void 0 ? void 0 : _a.anisotropy) !== undefined ? (_b = options.renderTargetOptions) === null || _b === void 0 ? void 0 : _b.anisotropy : 1,
113
113
  generateMipmaps: ((_c = options.renderTargetOptions) === null || _c === void 0 ? void 0 : _c.generateMipmaps) !== undefined ? (_d = options.renderTargetOptions) === null || _d === void 0 ? void 0 : _d.generateMipmaps : false,
114
114
  magFilter: ((_e = options.renderTargetOptions) === null || _e === void 0 ? void 0 : _e.magFilter) !== undefined ? (_f = options.renderTargetOptions) === null || _f === void 0 ? void 0 : _f.magFilter : three.LinearFilter,
@@ -508,7 +508,7 @@ void main() {
508
508
  }
509
509
  sdr.needsUpdate = true;
510
510
  if (gainMap.colorSpace !== three.LinearSRGBColorSpace) {
511
- console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*');
511
+ console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically');
512
512
  gainMap.colorSpace = three.LinearSRGBColorSpace;
513
513
  }
514
514
  gainMap.needsUpdate = true;
@@ -972,14 +972,14 @@ void main() {
972
972
  * scene.add(mesh)
973
973
  * renderer.render(scene, new PerspectiveCamera())
974
974
  *
975
- * // `result.renderTarget.texture` must be
976
- * // converted to `DataTexture` in order
977
- * // to use it as Equirectangular scene background
978
- * // if needed
979
- *
980
- * scene.background = result.toDataTexture()
975
+ * // Starting from three.js r159
976
+ * // `result.renderTarget.texture` can
977
+ * // also be used as Equirectangular scene background
978
+ * //
979
+ * // it was previously needed to convert it
980
+ * // to a DataTexture with `result.toDataTexture()`
981
+ * scene.background = result.renderTarget.texture
981
982
  * scene.background.mapping = EquirectangularReflectionMapping
982
- * scene.background.minFilter = LinearFilter
983
983
  *
984
984
  * // result must be manually disposed
985
985
  * // when you are done using it
@@ -1055,6 +1055,9 @@ void main() {
1055
1055
  sdrLoader.setPath(this.path);
1056
1056
  sdrLoader.setWithCredentials(this.withCredentials);
1057
1057
  sdrLoader.load(sdrUrl, async (buffer) => {
1058
+ /* istanbul ignore if
1059
+ this condition exists only because of three.js types + strict mode
1060
+ */
1058
1061
  if (typeof buffer === 'string')
1059
1062
  throw new Error('Invalid sdr buffer');
1060
1063
  sdr = buffer;
@@ -1075,6 +1078,9 @@ void main() {
1075
1078
  gainMapLoader.setPath(this.path);
1076
1079
  gainMapLoader.setWithCredentials(this.withCredentials);
1077
1080
  gainMapLoader.load(gainMapUrl, async (buffer) => {
1081
+ /* istanbul ignore if
1082
+ this condition exists only because of three.js types + strict mode
1083
+ */
1078
1084
  if (typeof buffer === 'string')
1079
1085
  throw new Error('Invalid gainmap buffer');
1080
1086
  gainMap = buffer;
@@ -1095,6 +1101,9 @@ void main() {
1095
1101
  metadataLoader.setPath(this.path);
1096
1102
  metadataLoader.setWithCredentials(this.withCredentials);
1097
1103
  metadataLoader.load(metadataUrl, async (json) => {
1104
+ /* istanbul ignore if
1105
+ this condition exists only because of three.js types + strict mode
1106
+ */
1098
1107
  if (typeof json !== 'string')
1099
1108
  throw new Error('Invalid metadata string');
1100
1109
  // TODO: implement check on JSON file and remove this eslint disable
@@ -1149,14 +1158,14 @@ void main() {
1149
1158
  * scene.add(mesh)
1150
1159
  * renderer.render(scene, new PerspectiveCamera())
1151
1160
  *
1152
- * // `result.renderTarget.texture` must be
1153
- * // converted to `DataTexture` in order
1154
- * // to use it as Equirectangular scene background
1155
- * // if needed
1156
- *
1157
- * scene.background = result.toDataTexture()
1161
+ * // Starting from three.js r159
1162
+ * // `result.renderTarget.texture` can
1163
+ * // also be used as Equirectangular scene background
1164
+ * //
1165
+ * // it was previously needed to convert it
1166
+ * // to a DataTexture with `result.toDataTexture()`
1167
+ * scene.background = result.renderTarget.texture
1158
1168
  * scene.background.mapping = EquirectangularReflectionMapping
1159
- * scene.background.minFilter = LinearFilter
1160
1169
  *
1161
1170
  * // result must be manually disposed
1162
1171
  * // when you are done using it
@@ -1183,6 +1192,9 @@ void main() {
1183
1192
  loader.setWithCredentials(this.withCredentials);
1184
1193
  this.manager.itemStart(url);
1185
1194
  loader.load(url, async (jpeg) => {
1195
+ /* istanbul ignore if
1196
+ this condition exists only because of three.js types + strict mode
1197
+ */
1186
1198
  if (typeof jpeg === 'string')
1187
1199
  throw new Error('Invalid buffer, received [string], was expecting [ArrayBuffer]');
1188
1200
  const jpegBuffer = new Uint8Array(jpeg);
@@ -1243,8 +1255,10 @@ void main() {
1243
1255
  exports.GainMapLoader = GainMapLoader;
1244
1256
  exports.HDRJPGLoader = HDRJPGLoader;
1245
1257
  exports.JPEGRLoader = HDRJPGLoader;
1258
+ exports.MPFExtractor = MPFExtractor;
1246
1259
  exports.QuadRenderer = QuadRenderer;
1247
1260
  exports.decode = decode;
1248
1261
  exports.extractGainmapFromJPEG = extractGainmapFromJPEG;
1262
+ exports.extractXMP = extractXMP;
1249
1263
 
1250
1264
  }));
package/dist/encode.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
- import { c as compress } from './compress-AzvRyeg9.js';
6
+ import { c as compress } from './compress-_yA6snVA.js';
7
7
  import { DataTexture, RGBAFormat, UVMapping, RepeatWrapping, LinearFilter, LinearSRGBColorSpace, ShaderMaterial, Vector3, NoBlending, UnsignedByteType, ACESFilmicToneMapping, LinearToneMapping, CineonToneMapping, ReinhardToneMapping, SRGBColorSpace, Vector2, WebGLRenderTarget, NearestFilter, ClampToEdgeWrapping, FloatType, DataUtils } from 'three';
8
- import { Q as QuadRenderer } from './QuadRenderer-LVKXL-q4.js';
8
+ import { Q as QuadRenderer } from './QuadRenderer-Nn9ZcWDa.js';
9
9
 
10
10
  /**
11
11
  * Utility function to obtain a `DataTexture` from various input formats
@@ -177,7 +177,7 @@ class GainMapEncoderMaterial extends ShaderMaterial {
177
177
  * @see {@link GainMapMetadata.hdrCapacityMax}
178
178
  * @remarks Logarithmic space
179
179
  */
180
- get hdrCapacityMax() { return Math.min(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])); }
180
+ get hdrCapacityMax() { return Math.max(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])); }
181
181
  }
182
182
 
183
183
  /**
@@ -370,24 +370,32 @@ class SDRMaterial extends ShaderMaterial {
370
370
  }
371
371
  get toneMapping() { return this._toneMapping; }
372
372
  set toneMapping(value) {
373
+ let valid = false;
373
374
  switch (value) {
374
375
  case ACESFilmicToneMapping:
375
376
  this.defines.TONEMAPPING_FUNCTION = 'ACESFilmicToneMapping';
377
+ valid = true;
376
378
  break;
377
379
  case ReinhardToneMapping:
378
380
  this.defines.TONEMAPPING_FUNCTION = 'ReinhardToneMapping';
381
+ valid = true;
379
382
  break;
380
383
  case CineonToneMapping:
381
384
  this.defines.TONEMAPPING_FUNCTION = 'CineonToneMapping';
385
+ valid = true;
382
386
  break;
383
387
  case LinearToneMapping:
384
388
  this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping';
389
+ valid = true;
385
390
  break;
386
391
  default:
387
- console.error('Unsupported toneMapping');
388
- return;
392
+ console.error(`Unsupported toneMapping: ${value}. Using LinearToneMapping.`);
393
+ this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping';
394
+ this._toneMapping = LinearToneMapping;
395
+ }
396
+ if (valid) {
397
+ this._toneMapping = value;
389
398
  }
390
- this._toneMapping = value;
391
399
  this.needsUpdate = true;
392
400
  }
393
401
  get brightness() { return this._brightness; }
@@ -518,7 +526,7 @@ const encode = (params) => {
518
526
  gainMap: gainMapRenderer,
519
527
  hdr: dataTexture,
520
528
  getMetadata: () => {
521
- const meta = {
529
+ return {
522
530
  gainMapMax: gainMapRenderer.material.gainMapMax,
523
531
  gainMapMin: gainMapRenderer.material.gainMapMin,
524
532
  gamma: gainMapRenderer.material.gamma,
@@ -527,7 +535,6 @@ const encode = (params) => {
527
535
  offsetHdr: gainMapRenderer.material.offsetHdr,
528
536
  offsetSdr: gainMapRenderer.material.offsetSdr
529
537
  };
530
- return meta;
531
538
  }
532
539
  };
533
540
  };
@@ -652,6 +659,10 @@ precision mediump float;
652
659
  #define COMPARE_FUNCTION max
653
660
  #endif
654
661
 
662
+ #ifndef INITIAL_VALUE
663
+ #define INITIAL_VALUE 0
664
+ #endif
665
+
655
666
  uniform sampler2D map;
656
667
  uniform vec2 u_srcResolution;
657
668
 
@@ -667,7 +678,8 @@ void main() {
667
678
  // uv for first pixel in cell. +0.5 for center of pixel
668
679
  vec2 uv = (srcPixel + 0.5) * onePixel;
669
680
 
670
- vec4 resultColor = vec4(0);
681
+ vec4 resultColor = vec4(INITIAL_VALUE);
682
+
671
683
  for (int y = 0; y < CELL_SIZE; ++y) {
672
684
  for (int x = 0; x < CELL_SIZE; ++x) {
673
685
  resultColor = COMPARE_FUNCTION(resultColor, texture2D(map, uv + vec2(x, y) * onePixel));
@@ -699,7 +711,8 @@ const findTextureMinMax = (image, mode = 'max', renderer) => {
699
711
  },
700
712
  defines: {
701
713
  CELL_SIZE: cellSize,
702
- COMPARE_FUNCTION: mode
714
+ COMPARE_FUNCTION: mode,
715
+ INITIAL_VALUE: mode === 'max' ? 0 : 65504 // max half float value
703
716
  }
704
717
  });
705
718
  srcTex.needsUpdate = true;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  (function (global, factory) {
7
7
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three')) :
8
8
  typeof define === 'function' && define.amd ? define(['exports', 'three'], factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@monogrid/gainmap-js"] = {}, global.three));
9
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.encode = {}, global.three));
10
10
  })(this, (function (exports, three) { 'use strict';
11
11
 
12
12
  /**
@@ -19,17 +19,24 @@
19
19
  * @returns
20
20
  */
21
21
  const canvasToBlob = async (canvas, mimeType, quality) => {
22
- if (canvas instanceof OffscreenCanvas) {
22
+ if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {
23
23
  return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 });
24
24
  }
25
- return new Promise((resolve, reject) => {
26
- canvas.toBlob((res) => {
27
- if (res)
28
- resolve(res);
29
- else
30
- reject(new Error('Failed to convert canvas to blob'));
31
- }, mimeType, quality || 0.9);
32
- });
25
+ else if (canvas instanceof HTMLCanvasElement) {
26
+ return new Promise((resolve, reject) => {
27
+ canvas.toBlob((res) => {
28
+ if (res)
29
+ resolve(res);
30
+ else
31
+ reject(new Error('Failed to convert canvas to blob'));
32
+ }, mimeType, quality || 0.9);
33
+ });
34
+ }
35
+ /* istanbul ignore next
36
+ as long as this function is not exported this is only here
37
+ to satisfy TS strict mode internally
38
+ */
39
+ throw new Error('Unsupported canvas element');
33
40
  };
34
41
  /**
35
42
  * Converts a RAW RGBA image buffer into the provided `mimeType` using the provided `quality`
@@ -65,6 +72,8 @@
65
72
  }
66
73
  else {
67
74
  canvas = document.createElement('canvas');
75
+ canvas.width = width;
76
+ canvas.height = height;
68
77
  }
69
78
  const ctx = canvas.getContext('2d');
70
79
  if (!ctx)
@@ -212,8 +221,8 @@
212
221
  depthBuffer: false,
213
222
  stencilBuffer: false,
214
223
  // user options
215
- type: this._type,
216
- colorSpace: this._colorSpace,
224
+ type: this._type, // set in class property
225
+ colorSpace: this._colorSpace, // set in class property
217
226
  anisotropy: ((_a = options.renderTargetOptions) === null || _a === void 0 ? void 0 : _a.anisotropy) !== undefined ? (_b = options.renderTargetOptions) === null || _b === void 0 ? void 0 : _b.anisotropy : 1,
218
227
  generateMipmaps: ((_c = options.renderTargetOptions) === null || _c === void 0 ? void 0 : _c.generateMipmaps) !== undefined ? (_d = options.renderTargetOptions) === null || _d === void 0 ? void 0 : _d.generateMipmaps : false,
219
228
  magFilter: ((_e = options.renderTargetOptions) === null || _e === void 0 ? void 0 : _e.magFilter) !== undefined ? (_f = options.renderTargetOptions) === null || _f === void 0 ? void 0 : _f.magFilter : three.LinearFilter,
@@ -548,7 +557,7 @@ void main() {
548
557
  * @see {@link GainMapMetadata.hdrCapacityMax}
549
558
  * @remarks Logarithmic space
550
559
  */
551
- get hdrCapacityMax() { return Math.min(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])); }
560
+ get hdrCapacityMax() { return Math.max(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])); }
552
561
  }
553
562
 
554
563
  /**
@@ -741,24 +750,32 @@ void main() {
741
750
  }
742
751
  get toneMapping() { return this._toneMapping; }
743
752
  set toneMapping(value) {
753
+ let valid = false;
744
754
  switch (value) {
745
755
  case three.ACESFilmicToneMapping:
746
756
  this.defines.TONEMAPPING_FUNCTION = 'ACESFilmicToneMapping';
757
+ valid = true;
747
758
  break;
748
759
  case three.ReinhardToneMapping:
749
760
  this.defines.TONEMAPPING_FUNCTION = 'ReinhardToneMapping';
761
+ valid = true;
750
762
  break;
751
763
  case three.CineonToneMapping:
752
764
  this.defines.TONEMAPPING_FUNCTION = 'CineonToneMapping';
765
+ valid = true;
753
766
  break;
754
767
  case three.LinearToneMapping:
755
768
  this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping';
769
+ valid = true;
756
770
  break;
757
771
  default:
758
- console.error('Unsupported toneMapping');
759
- return;
772
+ console.error(`Unsupported toneMapping: ${value}. Using LinearToneMapping.`);
773
+ this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping';
774
+ this._toneMapping = three.LinearToneMapping;
775
+ }
776
+ if (valid) {
777
+ this._toneMapping = value;
760
778
  }
761
- this._toneMapping = value;
762
779
  this.needsUpdate = true;
763
780
  }
764
781
  get brightness() { return this._brightness; }
@@ -889,7 +906,7 @@ void main() {
889
906
  gainMap: gainMapRenderer,
890
907
  hdr: dataTexture,
891
908
  getMetadata: () => {
892
- const meta = {
909
+ return {
893
910
  gainMapMax: gainMapRenderer.material.gainMapMax,
894
911
  gainMapMin: gainMapRenderer.material.gainMapMin,
895
912
  gamma: gainMapRenderer.material.gamma,
@@ -898,7 +915,6 @@ void main() {
898
915
  offsetHdr: gainMapRenderer.material.offsetHdr,
899
916
  offsetSdr: gainMapRenderer.material.offsetSdr
900
917
  };
901
- return meta;
902
918
  }
903
919
  };
904
920
  };
@@ -1023,6 +1039,10 @@ precision mediump float;
1023
1039
  #define COMPARE_FUNCTION max
1024
1040
  #endif
1025
1041
 
1042
+ #ifndef INITIAL_VALUE
1043
+ #define INITIAL_VALUE 0
1044
+ #endif
1045
+
1026
1046
  uniform sampler2D map;
1027
1047
  uniform vec2 u_srcResolution;
1028
1048
 
@@ -1038,7 +1058,8 @@ void main() {
1038
1058
  // uv for first pixel in cell. +0.5 for center of pixel
1039
1059
  vec2 uv = (srcPixel + 0.5) * onePixel;
1040
1060
 
1041
- vec4 resultColor = vec4(0);
1061
+ vec4 resultColor = vec4(INITIAL_VALUE);
1062
+
1042
1063
  for (int y = 0; y < CELL_SIZE; ++y) {
1043
1064
  for (int x = 0; x < CELL_SIZE; ++x) {
1044
1065
  resultColor = COMPARE_FUNCTION(resultColor, texture2D(map, uv + vec2(x, y) * onePixel));
@@ -1070,7 +1091,8 @@ void main() {
1070
1091
  },
1071
1092
  defines: {
1072
1093
  CELL_SIZE: cellSize,
1073
- COMPARE_FUNCTION: mode
1094
+ COMPARE_FUNCTION: mode,
1095
+ INITIAL_VALUE: mode === 'max' ? 0 : 65504 // max half float value
1074
1096
  }
1075
1097
  });
1076
1098
  srcTex.needsUpdate = true;
@@ -4,7 +4,7 @@ import { GainMapMetadata } from '../core/types';
4
4
  *
5
5
  * @category Decoding
6
6
  * @group Decoding
7
- *
7
+ * @deprecated
8
8
  * @example
9
9
  * import { decodeJPEGMetadata } from '@monogrid/gainmap-js/libultrahdr'
10
10
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  var Module = (() => {
@@ -6546,12 +6546,13 @@ const getLibrary = async () => {
6546
6546
  };
6547
6547
 
6548
6548
  /**
6549
- *
6549
+ * @deprecated
6550
6550
  * @param description
6551
6551
  * @param name
6552
6552
  * @param defaultValue
6553
6553
  * @returns
6554
6554
  */
6555
+ /* istanbul ignore next */
6555
6556
  const getAttribute = (description, name, defaultValue) => {
6556
6557
  var _a;
6557
6558
  let returnValue;
@@ -6584,7 +6585,7 @@ const getAttribute = (description, name, defaultValue) => {
6584
6585
  *
6585
6586
  * @category Decoding
6586
6587
  * @group Decoding
6587
- *
6588
+ * @deprecated
6588
6589
  * @example
6589
6590
  * import { decodeJPEGMetadata } from '@monogrid/gainmap-js/libultrahdr'
6590
6591
  *
@@ -6598,6 +6599,7 @@ const getAttribute = (description, name, defaultValue) => {
6598
6599
  * @returns The decoded data
6599
6600
  * @throws {Error} if the provided file cannot be parsed or does not contain a valid Gainmap
6600
6601
  */
6602
+ /* istanbul ignore next */
6601
6603
  const decodeJPEGMetadata = async (file) => {
6602
6604
  var _a, _b;
6603
6605
  const lib = await getLibrary();
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  (function (global, factory) {
@@ -6553,12 +6553,13 @@
6553
6553
  };
6554
6554
 
6555
6555
  /**
6556
- *
6556
+ * @deprecated
6557
6557
  * @param description
6558
6558
  * @param name
6559
6559
  * @param defaultValue
6560
6560
  * @returns
6561
6561
  */
6562
+ /* istanbul ignore next */
6562
6563
  const getAttribute = (description, name, defaultValue) => {
6563
6564
  var _a;
6564
6565
  let returnValue;
@@ -6591,7 +6592,7 @@
6591
6592
  *
6592
6593
  * @category Decoding
6593
6594
  * @group Decoding
6594
- *
6595
+ * @deprecated
6595
6596
  * @example
6596
6597
  * import { decodeJPEGMetadata } from '@monogrid/gainmap-js/libultrahdr'
6597
6598
  *
@@ -6605,6 +6606,7 @@
6605
6606
  * @returns The decoded data
6606
6607
  * @throws {Error} if the provided file cannot be parsed or does not contain a valid Gainmap
6607
6608
  */
6609
+ /* istanbul ignore next */
6608
6610
  const decodeJPEGMetadata = async (file) => {
6609
6611
  var _a, _b;
6610
6612
  const lib = await getLibrary();
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
- import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-7LfDr0XA.js';
6
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-A76t2eR6.js';
7
7
 
8
8
  var lib$1;
9
9
  var hasRequiredLib$1;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  (function (global, factory) {
package/dist/worker.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
- import { g as getDefaultExportFromCjs } from './_commonjsHelpers-7LfDr0XA.js';
7
- import { c as compress } from './compress-AzvRyeg9.js';
6
+ import { g as getDefaultExportFromCjs } from './_commonjsHelpers-A76t2eR6.js';
7
+ import { c as compress } from './compress-_yA6snVA.js';
8
8
 
9
9
  var isPromise$2 = {exports: {}};
10
10
 
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @monogrid/gainmap-js v2.0.7
3
- * With ❤️, by MONOGRID <hello@mono-grid.com>
2
+ * @monogrid/gainmap-js v3.0.2
3
+ * With ❤️, by MONOGRID <rnd@monogrid.com>
4
4
  */
5
5
 
6
6
  (function (factory) {
@@ -124,17 +124,24 @@
124
124
  * @returns
125
125
  */
126
126
  const canvasToBlob = async (canvas, mimeType, quality) => {
127
- if (canvas instanceof OffscreenCanvas) {
127
+ if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) {
128
128
  return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 });
129
129
  }
130
- return new Promise((resolve, reject) => {
131
- canvas.toBlob((res) => {
132
- if (res)
133
- resolve(res);
134
- else
135
- reject(new Error('Failed to convert canvas to blob'));
136
- }, mimeType, quality || 0.9);
137
- });
130
+ else if (canvas instanceof HTMLCanvasElement) {
131
+ return new Promise((resolve, reject) => {
132
+ canvas.toBlob((res) => {
133
+ if (res)
134
+ resolve(res);
135
+ else
136
+ reject(new Error('Failed to convert canvas to blob'));
137
+ }, mimeType, quality || 0.9);
138
+ });
139
+ }
140
+ /* istanbul ignore next
141
+ as long as this function is not exported this is only here
142
+ to satisfy TS strict mode internally
143
+ */
144
+ throw new Error('Unsupported canvas element');
138
145
  };
139
146
  /**
140
147
  * Converts a RAW RGBA image buffer into the provided `mimeType` using the provided `quality`
@@ -170,6 +177,8 @@
170
177
  }
171
178
  else {
172
179
  canvas = document.createElement('canvas');
180
+ canvas.width = width;
181
+ canvas.height = height;
173
182
  }
174
183
  const ctx = canvas.getContext('2d');
175
184
  if (!ctx)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monogrid/gainmap-js",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gain map",
5
5
  "homepage": "https://github.com/MONOGRID/gainmap-js#readme",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "three",
15
15
  "threejs"
16
16
  ],
17
- "author": "MONOGRID <hello@mono-grid.com>",
17
+ "author": "MONOGRID <rnd@monogrid.com>",
18
18
  "license": "MIT",
19
19
  "bugs": {
20
20
  "url": "https://github.com/MONOGRID/gainmap-js/issues"
@@ -76,32 +76,36 @@
76
76
  },
77
77
  "scripts": {
78
78
  "build": "rollup -c",
79
- "dev": "rollup -c -w",
80
- "test": "jest",
81
- "pretest": "npm run build",
79
+ "dev": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
80
+ "start": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"",
81
+ "test": "nyc --reporter=text --reporter=lcov playwright test",
82
+ "test:startserver": "rollup -c && servez",
83
+ "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.40.0-jammy /bin/bash",
84
+ "test:codegen": "playwright codegen http://localhost:8080",
85
+ "prepack": "npm run build",
82
86
  "check": "concurrently -c auto npm:check:*",
83
87
  "check:typecheck-src": "tsc -p src",
84
88
  "check:eslint-src": "eslint \"src/**/*.ts\"",
85
89
  "check:typecheck-examples": "tsc -p examples",
86
90
  "check:eslint-examples": "eslint \"examples/**/*.{ts,html}\"",
87
91
  "check:typecheck-tests": "tsc -p tests",
88
- "check:eslint-tests": "eslint \"tests/**/*.{ts,html}\"",
89
- "ci:test": "JEST_JUNIT_OUTPUT_DIR=reports jest --ci --reporters=default --reporters=jest-junit",
92
+ "check:eslint-tests": "eslint \"tests/**/*.ts\"",
90
93
  "ci:check": "concurrently npm:ci:check:*",
91
94
  "ci:check:typecheck-src": "tsc --pretty false > reports/typecheck.log",
92
95
  "ci:check:eslint-src": "eslint --format json --output-file reports/eslint-src.json \"src/**/*.ts\"",
93
96
  "ci:check:typecheck-examples": "tsc --pretty false -p examples > reports/typecheck-examples.log",
94
97
  "ci:check:eslint-examples": "eslint --format json --output-file reports/eslint-examples.json \"examples/**/*.{ts,html}\"",
95
98
  "ci:check:typecheck-tests": "tsc --pretty false -p tests > reports/typecheck-tests.log",
96
- "ci:check:eslint-tests": "eslint --format json --output-file reports/eslint-tests.json \"tests/**/*.{ts,html}\""
99
+ "ci:check:eslint-tests": "eslint --format json --output-file reports/eslint-tests.json \"tests/**/*.ts\""
97
100
  },
98
101
  "peerDependencies": {
99
- "three": ">= 0.157.0 < 0.159.0"
102
+ "three": ">= 0.159.0"
100
103
  },
101
104
  "dependencies": {
102
105
  "promise-worker-transferable": "^1.0.4"
103
106
  },
104
107
  "devDependencies": {
108
+ "@playwright/test": "^1.40.1",
105
109
  "@rollup/plugin-commonjs": "^25.0.7",
106
110
  "@rollup/plugin-json": "^6.0.1",
107
111
  "@rollup/plugin-node-resolve": "^15.2.3",
@@ -110,45 +114,40 @@
110
114
  "@semantic-release/changelog": "^6.0.3",
111
115
  "@semantic-release/commit-analyzer": "^11.1.0",
112
116
  "@semantic-release/git": "github:semantic-release/git",
113
- "@semantic-release/github": "^9.2.3",
117
+ "@semantic-release/github": "^9.2.4",
114
118
  "@semantic-release/npm": "^11.0.1",
115
119
  "@semantic-release/release-notes-generator": "^12.1.0",
116
- "@types/jest": "^29.5.8",
117
120
  "@types/node": "^20.9.0",
118
- "@types/three": "^0.158.2",
119
- "@typescript-eslint/eslint-plugin": "^6.11.0",
120
- "@typescript-eslint/parser": "^6.11.0",
121
- "babel-jest": "^29.7.0",
121
+ "@types/three": "^0.160.0",
122
+ "@typescript-eslint/eslint-plugin": "^6.13.1",
123
+ "@typescript-eslint/parser": "^6.13.1",
122
124
  "concurrently": "^8.2.2",
123
125
  "conventional-changelog-conventionalcommits": "^7.0.2",
124
126
  "cz-conventional-changelog": "^3.3.0",
125
- "eslint": "^8.54.0",
127
+ "eslint": "^8.55.0",
126
128
  "eslint-config-mdcs": "^5.0.0",
127
129
  "eslint-config-standard": "^17.0.0",
128
130
  "eslint-plugin-compat": "^4.2.0",
129
131
  "eslint-plugin-html": "^7.1.0",
130
132
  "eslint-plugin-import": "^2.29.0",
131
- "eslint-plugin-jest-extended": "^2.0.0",
132
133
  "eslint-plugin-n": "^16.3.1",
133
134
  "eslint-plugin-promise": "^6.0.0",
134
- "eslint-plugin-quasar": "^1.1.0",
135
135
  "eslint-plugin-simple-import-sort": "^10.0.0",
136
136
  "eslint-plugin-unused-imports": "^3.0.0",
137
- "jest": "^29.7.0",
138
- "jest-environment-jsdom": "^29.7.0",
139
- "jest-extended": "^4.0.2",
140
- "jest-junit": "^16.0.0",
141
- "puppeteer": "^21.5.2",
142
- "rollup": "^4.5.0",
137
+ "nyc": "^15.1.0",
138
+ "rollup": "^4.6.1",
143
139
  "rollup-plugin-copy": "^3.5.0",
140
+ "rollup-plugin-delete": "^2.0.0",
141
+ "rollup-plugin-istanbul": "^5.0.0",
144
142
  "rollup-plugin-license": "^3.2.0",
145
143
  "semantic-release": "^22.0.8",
146
- "three": "^0.158.0",
147
- "ts-jest": "^29.1.1",
148
- "typedoc": "^0.25.3",
144
+ "servez": "^2.1.2",
145
+ "sharp": "^0.33.0",
146
+ "three": "^0.160.1",
147
+ "typedoc": "^0.25.4",
149
148
  "typedoc-github-wiki-theme": "^1.1.0",
150
149
  "typedoc-plugin-markdown": "^3.17.1",
151
- "typescript": "^5.2.2"
150
+ "typescript": "^5.3.2"
152
151
  },
153
152
  "browserslist": [
154
153
  "> 1%, not dead, not ie 11, not op_mini all"