@monogrid/gainmap-js 3.0.0 → 3.0.1
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 +8 -0
- package/README.md +14 -12
- package/dist/{QuadRenderer-LVKXL-q4.js → QuadRenderer-pEe6Kzcn.js} +3 -3
- package/dist/{_commonjsHelpers-7LfDr0XA.js → _commonjsHelpers-Gkwpb-h5.js} +1 -1
- package/dist/{compress-AzvRyeg9.js → compress-6L6-d1aM.js} +1 -1
- package/dist/decode/index.d.ts +2 -0
- package/dist/decode/loaders/GainMapLoader.d.ts +7 -7
- package/dist/decode/loaders/HDRJPGLoader.d.ts +7 -7
- package/dist/decode.js +17 -17
- package/dist/decode.umd.js +19 -17
- package/dist/encode.js +13 -8
- package/dist/encode.umd.js +14 -9
- package/dist/libultrahdr.js +1 -1
- package/dist/libultrahdr.umd.js +1 -1
- package/dist/worker-interface.js +2 -2
- package/dist/worker-interface.umd.js +1 -1
- package/dist/worker.js +3 -3
- package/dist/worker.umd.js +1 -1
- package/package.json +25 -24
- /package/dist/decode/utils/{extract-metadata-from-jpeg.d.ts → extractXMP.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [3.0.1](https://github.com/MONOGRID/gainmap-js/compare/v3.0.0...v3.0.1) (2023-12-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **encode:** hdrCapacityMax correctly computed in output metadata ([f5f2215](https://github.com/MONOGRID/gainmap-js/commit/f5f22152eb236831cb9f23646445e6459be18285))
|
|
7
|
+
* **encode:** findTextureMinMax correctly finds min values in textures ([fd94680](https://github.com/MONOGRID/gainmap-js/commit/fd94680a76fdb04b5aa85b4210f3aec21b45a727))
|
|
8
|
+
|
|
1
9
|
# [3.0.0](https://github.com/MONOGRID/gainmap-js/compare/v2.0.7...v3.0.0) (2023-11-29)
|
|
2
10
|
|
|
3
11
|
|
package/README.md
CHANGED
|
@@ -90,14 +90,15 @@ const mesh = new Mesh(
|
|
|
90
90
|
scene.add(mesh)
|
|
91
91
|
renderer.render(scene, new PerspectiveCamera())
|
|
92
92
|
|
|
93
|
-
// `result.renderTarget.texture` must be
|
|
94
|
-
// converted to `DataTexture` in order
|
|
95
|
-
// to use it as Equirectangular scene background
|
|
96
|
-
// if needed
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
// Starting from three.js r159
|
|
95
|
+
// `result.renderTarget.texture` can
|
|
96
|
+
// also be used as Equirectangular scene background
|
|
97
|
+
//
|
|
98
|
+
// it was previously needed to convert it
|
|
99
|
+
// to a DataTexture with `result.toDataTexture()`
|
|
100
|
+
scene.background = result.renderTarget.texture
|
|
99
101
|
scene.background.mapping = EquirectangularReflectionMapping
|
|
100
|
-
scene.background.minFilter = LinearFilter
|
|
101
102
|
|
|
102
103
|
|
|
103
104
|
// result must be manually disposed
|
|
@@ -143,14 +144,15 @@ const mesh = new Mesh(
|
|
|
143
144
|
scene.add(mesh)
|
|
144
145
|
renderer.render(scene, new PerspectiveCamera())
|
|
145
146
|
|
|
146
|
-
// `result.renderTarget.texture` must be
|
|
147
|
-
// converted to `DataTexture` in order
|
|
148
|
-
// to use it as Equirectangular scene background
|
|
149
|
-
// if needed
|
|
150
147
|
|
|
151
|
-
|
|
148
|
+
// Starting from three.js r159
|
|
149
|
+
// `result.renderTarget.texture` can
|
|
150
|
+
// also be used as Equirectangular scene background
|
|
151
|
+
//
|
|
152
|
+
// it was previously needed to convert it
|
|
153
|
+
// to a DataTexture with `result.toDataTexture()`
|
|
154
|
+
scene.background = result.renderTarget.texture
|
|
152
155
|
scene.background.mapping = EquirectangularReflectionMapping
|
|
153
|
-
scene.background.minFilter = LinearFilter
|
|
154
156
|
|
|
155
157
|
// result must be manually disposed
|
|
156
158
|
// when you are done using it
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -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,
|
package/dist/decode/index.d.ts
CHANGED
|
@@ -36,14 +36,14 @@ import { LoaderBase } from './LoaderBase';
|
|
|
36
36
|
* scene.add(mesh)
|
|
37
37
|
* renderer.render(scene, new PerspectiveCamera())
|
|
38
38
|
*
|
|
39
|
-
* //
|
|
40
|
-
* //
|
|
41
|
-
* //
|
|
42
|
-
* //
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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
|
-
* //
|
|
40
|
-
* //
|
|
41
|
-
* //
|
|
42
|
-
* //
|
|
43
|
-
*
|
|
44
|
-
*
|
|
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
|
package/dist/decode.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { Q as QuadRenderer } from './QuadRenderer-
|
|
6
|
+
import { Q as QuadRenderer } from './QuadRenderer-pEe6Kzcn.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 */ `
|
|
@@ -676,14 +676,14 @@ class LoaderBase extends Loader {
|
|
|
676
676
|
* scene.add(mesh)
|
|
677
677
|
* renderer.render(scene, new PerspectiveCamera())
|
|
678
678
|
*
|
|
679
|
-
* //
|
|
680
|
-
* //
|
|
681
|
-
* //
|
|
682
|
-
* //
|
|
683
|
-
*
|
|
684
|
-
*
|
|
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
|
|
@@ -853,14 +853,14 @@ class GainMapLoader extends LoaderBase {
|
|
|
853
853
|
* scene.add(mesh)
|
|
854
854
|
* renderer.render(scene, new PerspectiveCamera())
|
|
855
855
|
*
|
|
856
|
-
* //
|
|
857
|
-
* //
|
|
858
|
-
* //
|
|
859
|
-
* //
|
|
860
|
-
*
|
|
861
|
-
*
|
|
856
|
+
* // Starting from three.js r159
|
|
857
|
+
* // `result.renderTarget.texture` can
|
|
858
|
+
* // also be used as Equirectangular scene background
|
|
859
|
+
* //
|
|
860
|
+
* // it was previously needed to convert it
|
|
861
|
+
* // to a DataTexture with `result.toDataTexture()`
|
|
862
|
+
* scene.background = result.renderTarget.texture
|
|
862
863
|
* scene.background.mapping = EquirectangularReflectionMapping
|
|
863
|
-
* scene.background.minFilter = LinearFilter
|
|
864
864
|
*
|
|
865
865
|
* // result must be manually disposed
|
|
866
866
|
* // when you are done using it
|
|
@@ -943,4 +943,4 @@ class HDRJPGLoader extends LoaderBase {
|
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
-
export { GainMapDecoderMaterial, GainMapLoader, HDRJPGLoader, HDRJPGLoader as JPEGRLoader, QuadRenderer, decode, extractGainmapFromJPEG };
|
|
946
|
+
export { GainMapDecoderMaterial, GainMapLoader, HDRJPGLoader, HDRJPGLoader as JPEGRLoader, MPFExtractor, QuadRenderer, decode, extractGainmapFromJPEG, extractXMP };
|
package/dist/decode.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -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,
|
|
@@ -972,14 +972,14 @@ void main() {
|
|
|
972
972
|
* scene.add(mesh)
|
|
973
973
|
* renderer.render(scene, new PerspectiveCamera())
|
|
974
974
|
*
|
|
975
|
-
* //
|
|
976
|
-
* //
|
|
977
|
-
* //
|
|
978
|
-
* //
|
|
979
|
-
*
|
|
980
|
-
*
|
|
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
|
|
@@ -1149,14 +1149,14 @@ void main() {
|
|
|
1149
1149
|
* scene.add(mesh)
|
|
1150
1150
|
* renderer.render(scene, new PerspectiveCamera())
|
|
1151
1151
|
*
|
|
1152
|
-
* //
|
|
1153
|
-
* //
|
|
1154
|
-
* //
|
|
1155
|
-
* //
|
|
1156
|
-
*
|
|
1157
|
-
*
|
|
1152
|
+
* // Starting from three.js r159
|
|
1153
|
+
* // `result.renderTarget.texture` can
|
|
1154
|
+
* // also be used as Equirectangular scene background
|
|
1155
|
+
* //
|
|
1156
|
+
* // it was previously needed to convert it
|
|
1157
|
+
* // to a DataTexture with `result.toDataTexture()`
|
|
1158
|
+
* scene.background = result.renderTarget.texture
|
|
1158
1159
|
* scene.background.mapping = EquirectangularReflectionMapping
|
|
1159
|
-
* scene.background.minFilter = LinearFilter
|
|
1160
1160
|
*
|
|
1161
1161
|
* // result must be manually disposed
|
|
1162
1162
|
* // when you are done using it
|
|
@@ -1243,8 +1243,10 @@ void main() {
|
|
|
1243
1243
|
exports.GainMapLoader = GainMapLoader;
|
|
1244
1244
|
exports.HDRJPGLoader = HDRJPGLoader;
|
|
1245
1245
|
exports.JPEGRLoader = HDRJPGLoader;
|
|
1246
|
+
exports.MPFExtractor = MPFExtractor;
|
|
1246
1247
|
exports.QuadRenderer = QuadRenderer;
|
|
1247
1248
|
exports.decode = decode;
|
|
1248
1249
|
exports.extractGainmapFromJPEG = extractGainmapFromJPEG;
|
|
1250
|
+
exports.extractXMP = extractXMP;
|
|
1249
1251
|
|
|
1250
1252
|
}));
|
package/dist/encode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { c as compress } from './compress-
|
|
6
|
+
import { c as compress } from './compress-6L6-d1aM.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-
|
|
8
|
+
import { Q as QuadRenderer } from './QuadRenderer-pEe6Kzcn.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.
|
|
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
|
/**
|
|
@@ -518,7 +518,7 @@ const encode = (params) => {
|
|
|
518
518
|
gainMap: gainMapRenderer,
|
|
519
519
|
hdr: dataTexture,
|
|
520
520
|
getMetadata: () => {
|
|
521
|
-
|
|
521
|
+
return {
|
|
522
522
|
gainMapMax: gainMapRenderer.material.gainMapMax,
|
|
523
523
|
gainMapMin: gainMapRenderer.material.gainMapMin,
|
|
524
524
|
gamma: gainMapRenderer.material.gamma,
|
|
@@ -527,7 +527,6 @@ const encode = (params) => {
|
|
|
527
527
|
offsetHdr: gainMapRenderer.material.offsetHdr,
|
|
528
528
|
offsetSdr: gainMapRenderer.material.offsetSdr
|
|
529
529
|
};
|
|
530
|
-
return meta;
|
|
531
530
|
}
|
|
532
531
|
};
|
|
533
532
|
};
|
|
@@ -652,6 +651,10 @@ precision mediump float;
|
|
|
652
651
|
#define COMPARE_FUNCTION max
|
|
653
652
|
#endif
|
|
654
653
|
|
|
654
|
+
#ifndef INITIAL_VALUE
|
|
655
|
+
#define INITIAL_VALUE 0
|
|
656
|
+
#endif
|
|
657
|
+
|
|
655
658
|
uniform sampler2D map;
|
|
656
659
|
uniform vec2 u_srcResolution;
|
|
657
660
|
|
|
@@ -667,7 +670,8 @@ void main() {
|
|
|
667
670
|
// uv for first pixel in cell. +0.5 for center of pixel
|
|
668
671
|
vec2 uv = (srcPixel + 0.5) * onePixel;
|
|
669
672
|
|
|
670
|
-
vec4 resultColor = vec4(
|
|
673
|
+
vec4 resultColor = vec4(INITIAL_VALUE);
|
|
674
|
+
|
|
671
675
|
for (int y = 0; y < CELL_SIZE; ++y) {
|
|
672
676
|
for (int x = 0; x < CELL_SIZE; ++x) {
|
|
673
677
|
resultColor = COMPARE_FUNCTION(resultColor, texture2D(map, uv + vec2(x, y) * onePixel));
|
|
@@ -699,7 +703,8 @@ const findTextureMinMax = (image, mode = 'max', renderer) => {
|
|
|
699
703
|
},
|
|
700
704
|
defines: {
|
|
701
705
|
CELL_SIZE: cellSize,
|
|
702
|
-
COMPARE_FUNCTION: mode
|
|
706
|
+
COMPARE_FUNCTION: mode,
|
|
707
|
+
INITIAL_VALUE: mode === 'max' ? 0 : 65504 // max half float value
|
|
703
708
|
}
|
|
704
709
|
});
|
|
705
710
|
srcTex.needsUpdate = true;
|
package/dist/encode.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.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
|
|
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
|
/**
|
|
@@ -212,8 +212,8 @@
|
|
|
212
212
|
depthBuffer: false,
|
|
213
213
|
stencilBuffer: false,
|
|
214
214
|
// user options
|
|
215
|
-
type: this._type,
|
|
216
|
-
colorSpace: this._colorSpace,
|
|
215
|
+
type: this._type, // set in class property
|
|
216
|
+
colorSpace: this._colorSpace, // set in class property
|
|
217
217
|
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
218
|
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
219
|
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 +548,7 @@ void main() {
|
|
|
548
548
|
* @see {@link GainMapMetadata.hdrCapacityMax}
|
|
549
549
|
* @remarks Logarithmic space
|
|
550
550
|
*/
|
|
551
|
-
get hdrCapacityMax() { return Math.
|
|
551
|
+
get hdrCapacityMax() { return Math.max(Math.max(0, this.gainMapMax[0]), Math.max(0, this.gainMapMax[1]), Math.max(0, this.gainMapMax[2])); }
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
/**
|
|
@@ -889,7 +889,7 @@ void main() {
|
|
|
889
889
|
gainMap: gainMapRenderer,
|
|
890
890
|
hdr: dataTexture,
|
|
891
891
|
getMetadata: () => {
|
|
892
|
-
|
|
892
|
+
return {
|
|
893
893
|
gainMapMax: gainMapRenderer.material.gainMapMax,
|
|
894
894
|
gainMapMin: gainMapRenderer.material.gainMapMin,
|
|
895
895
|
gamma: gainMapRenderer.material.gamma,
|
|
@@ -898,7 +898,6 @@ void main() {
|
|
|
898
898
|
offsetHdr: gainMapRenderer.material.offsetHdr,
|
|
899
899
|
offsetSdr: gainMapRenderer.material.offsetSdr
|
|
900
900
|
};
|
|
901
|
-
return meta;
|
|
902
901
|
}
|
|
903
902
|
};
|
|
904
903
|
};
|
|
@@ -1023,6 +1022,10 @@ precision mediump float;
|
|
|
1023
1022
|
#define COMPARE_FUNCTION max
|
|
1024
1023
|
#endif
|
|
1025
1024
|
|
|
1025
|
+
#ifndef INITIAL_VALUE
|
|
1026
|
+
#define INITIAL_VALUE 0
|
|
1027
|
+
#endif
|
|
1028
|
+
|
|
1026
1029
|
uniform sampler2D map;
|
|
1027
1030
|
uniform vec2 u_srcResolution;
|
|
1028
1031
|
|
|
@@ -1038,7 +1041,8 @@ void main() {
|
|
|
1038
1041
|
// uv for first pixel in cell. +0.5 for center of pixel
|
|
1039
1042
|
vec2 uv = (srcPixel + 0.5) * onePixel;
|
|
1040
1043
|
|
|
1041
|
-
vec4 resultColor = vec4(
|
|
1044
|
+
vec4 resultColor = vec4(INITIAL_VALUE);
|
|
1045
|
+
|
|
1042
1046
|
for (int y = 0; y < CELL_SIZE; ++y) {
|
|
1043
1047
|
for (int x = 0; x < CELL_SIZE; ++x) {
|
|
1044
1048
|
resultColor = COMPARE_FUNCTION(resultColor, texture2D(map, uv + vec2(x, y) * onePixel));
|
|
@@ -1070,7 +1074,8 @@ void main() {
|
|
|
1070
1074
|
},
|
|
1071
1075
|
defines: {
|
|
1072
1076
|
CELL_SIZE: cellSize,
|
|
1073
|
-
COMPARE_FUNCTION: mode
|
|
1077
|
+
COMPARE_FUNCTION: mode,
|
|
1078
|
+
INITIAL_VALUE: mode === 'max' ? 0 : 65504 // max half float value
|
|
1074
1079
|
}
|
|
1075
1080
|
});
|
|
1076
1081
|
srcTex.needsUpdate = true;
|
package/dist/libultrahdr.js
CHANGED
package/dist/libultrahdr.umd.js
CHANGED
package/dist/worker-interface.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-
|
|
6
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-Gkwpb-h5.js';
|
|
7
7
|
|
|
8
8
|
var lib$1;
|
|
9
9
|
var hasRequiredLib$1;
|
package/dist/worker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @monogrid/gainmap-js
|
|
2
|
+
* @monogrid/gainmap-js v3.0.1
|
|
3
3
|
* With ❤️, by MONOGRID <hello@mono-grid.com>
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-
|
|
7
|
-
import { c as compress } from './compress-
|
|
6
|
+
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-Gkwpb-h5.js';
|
|
7
|
+
import { c as compress } from './compress-6L6-d1aM.js';
|
|
8
8
|
|
|
9
9
|
var isPromise$2 = {exports: {}};
|
|
10
10
|
|
package/dist/worker.umd.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monogrid/gainmap-js",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
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": {
|
|
@@ -76,32 +76,37 @@
|
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build": "rollup -c",
|
|
79
|
-
"dev": "rollup -c -w",
|
|
80
|
-
"
|
|
81
|
-
"
|
|
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": "playwright test",
|
|
82
|
+
"test:startserver": "rollup -c && servez",
|
|
83
|
+
"test:report-coverage": "nyc report --reporter=text --reporter=cobertura --reporter=html --reporter=json-summary",
|
|
84
|
+
"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",
|
|
85
|
+
"test:codegen": "playwright codegen http://localhost:8080",
|
|
86
|
+
"prepack": "npm run build",
|
|
82
87
|
"check": "concurrently -c auto npm:check:*",
|
|
83
88
|
"check:typecheck-src": "tsc -p src",
|
|
84
89
|
"check:eslint-src": "eslint \"src/**/*.ts\"",
|
|
85
90
|
"check:typecheck-examples": "tsc -p examples",
|
|
86
91
|
"check:eslint-examples": "eslint \"examples/**/*.{ts,html}\"",
|
|
87
92
|
"check:typecheck-tests": "tsc -p tests",
|
|
88
|
-
"check:eslint-tests": "eslint \"tests/**/*.
|
|
89
|
-
"ci:test": "JEST_JUNIT_OUTPUT_DIR=reports jest --ci --reporters=default --reporters=jest-junit",
|
|
93
|
+
"check:eslint-tests": "eslint \"tests/**/*.ts\"",
|
|
90
94
|
"ci:check": "concurrently npm:ci:check:*",
|
|
91
95
|
"ci:check:typecheck-src": "tsc --pretty false > reports/typecheck.log",
|
|
92
96
|
"ci:check:eslint-src": "eslint --format json --output-file reports/eslint-src.json \"src/**/*.ts\"",
|
|
93
97
|
"ci:check:typecheck-examples": "tsc --pretty false -p examples > reports/typecheck-examples.log",
|
|
94
98
|
"ci:check:eslint-examples": "eslint --format json --output-file reports/eslint-examples.json \"examples/**/*.{ts,html}\"",
|
|
95
99
|
"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/**/*.
|
|
100
|
+
"ci:check:eslint-tests": "eslint --format json --output-file reports/eslint-tests.json \"tests/**/*.ts\""
|
|
97
101
|
},
|
|
98
102
|
"peerDependencies": {
|
|
99
|
-
"three": ">= 0.
|
|
103
|
+
"three": ">= 0.159.0"
|
|
100
104
|
},
|
|
101
105
|
"dependencies": {
|
|
102
106
|
"promise-worker-transferable": "^1.0.4"
|
|
103
107
|
},
|
|
104
108
|
"devDependencies": {
|
|
109
|
+
"@playwright/test": "^1.40.1",
|
|
105
110
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
106
111
|
"@rollup/plugin-json": "^6.0.1",
|
|
107
112
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
@@ -110,15 +115,13 @@
|
|
|
110
115
|
"@semantic-release/changelog": "^6.0.3",
|
|
111
116
|
"@semantic-release/commit-analyzer": "^11.1.0",
|
|
112
117
|
"@semantic-release/git": "github:semantic-release/git",
|
|
113
|
-
"@semantic-release/github": "^9.2.
|
|
118
|
+
"@semantic-release/github": "^9.2.4",
|
|
114
119
|
"@semantic-release/npm": "^11.0.1",
|
|
115
120
|
"@semantic-release/release-notes-generator": "^12.1.0",
|
|
116
|
-
"@types/jest": "^29.5.8",
|
|
117
121
|
"@types/node": "^20.9.0",
|
|
118
122
|
"@types/three": "^0.158.2",
|
|
119
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
120
|
-
"@typescript-eslint/parser": "^6.
|
|
121
|
-
"babel-jest": "^29.7.0",
|
|
123
|
+
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
|
124
|
+
"@typescript-eslint/parser": "^6.13.1",
|
|
122
125
|
"concurrently": "^8.2.2",
|
|
123
126
|
"conventional-changelog-conventionalcommits": "^7.0.2",
|
|
124
127
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -128,27 +131,25 @@
|
|
|
128
131
|
"eslint-plugin-compat": "^4.2.0",
|
|
129
132
|
"eslint-plugin-html": "^7.1.0",
|
|
130
133
|
"eslint-plugin-import": "^2.29.0",
|
|
131
|
-
"eslint-plugin-jest-extended": "^2.0.0",
|
|
132
134
|
"eslint-plugin-n": "^16.3.1",
|
|
133
135
|
"eslint-plugin-promise": "^6.0.0",
|
|
134
136
|
"eslint-plugin-quasar": "^1.1.0",
|
|
135
137
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
136
138
|
"eslint-plugin-unused-imports": "^3.0.0",
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"jest-extended": "^4.0.2",
|
|
140
|
-
"jest-junit": "^16.0.0",
|
|
141
|
-
"puppeteer": "^21.5.2",
|
|
142
|
-
"rollup": "^4.5.0",
|
|
139
|
+
"nyc": "^15.1.0",
|
|
140
|
+
"rollup": "^4.6.1",
|
|
143
141
|
"rollup-plugin-copy": "^3.5.0",
|
|
142
|
+
"rollup-plugin-delete": "^2.0.0",
|
|
143
|
+
"rollup-plugin-istanbul": "^5.0.0",
|
|
144
144
|
"rollup-plugin-license": "^3.2.0",
|
|
145
145
|
"semantic-release": "^22.0.8",
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
146
|
+
"servez": "^2.1.2",
|
|
147
|
+
"sharp": "^0.33.0",
|
|
148
|
+
"three": "^0.159.0",
|
|
149
|
+
"typedoc": "^0.25.4",
|
|
149
150
|
"typedoc-github-wiki-theme": "^1.1.0",
|
|
150
151
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
151
|
-
"typescript": "^5.
|
|
152
|
+
"typescript": "^5.3.2"
|
|
152
153
|
},
|
|
153
154
|
"browserslist": [
|
|
154
155
|
"> 1%, not dead, not ie 11, not op_mini all"
|
|
File without changes
|