@monogrid/gainmap-js 3.0.6 → 3.2.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 (57) 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 +106 -2
  5. package/dist/Loader-BZcKUVaX.js +424 -0
  6. package/dist/{QuadRenderer-B3h-sJtp.js → QuadRenderer-Y5tm-R3m.js} +39 -30
  7. package/dist/{_commonjsHelpers-UqyNh5ZN.js → _commonjsHelpers-CuGYGi_5.js} +2 -2
  8. package/dist/{compress-CAiPfiRr.js → compress-BaKKOAXI.js} +2 -3
  9. package/dist/core/QuadRenderer.d.ts +2 -2
  10. package/dist/core/get-data-texture.d.ts +4 -3
  11. package/dist/core/types.d.ts +2 -1
  12. package/dist/decode/index.d.ts +1 -11
  13. package/dist/decode/shared/Loader.d.ts +59 -0
  14. package/dist/decode/shared/decode.d.ts +24 -0
  15. package/dist/decode/{extract.d.ts → shared/extract.d.ts} +4 -4
  16. package/dist/decode/shared/index.d.ts +8 -0
  17. package/dist/decode/shared/types.d.ts +53 -0
  18. package/dist/decode/{utils → shared/utils}/MPFExtractor.d.ts +1 -1
  19. package/dist/decode/shared/utils/extractXMP.d.ts +2 -0
  20. package/dist/decode/{decode.d.ts → webgl/decode.d.ts} +6 -6
  21. package/dist/decode/webgl/index.d.ts +8 -0
  22. package/dist/decode/{loaders → webgl/loaders}/GainMapLoader.d.ts +5 -6
  23. package/dist/decode/{loaders → webgl/loaders}/HDRJPGLoader.d.ts +6 -7
  24. package/dist/decode/webgl/loaders/LoaderBaseWebGL.d.ts +20 -0
  25. package/dist/decode/{materials → webgl/materials}/GainMapDecoderMaterial.d.ts +2 -2
  26. package/dist/decode/webgpu/core/QuadRenderer.d.ts +153 -0
  27. package/dist/decode/webgpu/decode.d.ts +60 -0
  28. package/dist/decode/webgpu/index.d.ts +8 -0
  29. package/dist/decode/webgpu/loaders/GainMapLoader.d.ts +69 -0
  30. package/dist/decode/webgpu/loaders/HDRJPGLoader.d.ts +65 -0
  31. package/dist/decode/webgpu/loaders/LoaderBaseWebGPU.d.ts +20 -0
  32. package/dist/decode/webgpu/materials/GainMapDecoderMaterial.d.ts +78 -0
  33. package/dist/decode.js +45 -442
  34. package/dist/decode.umd.cjs +388 -358
  35. package/dist/decode.webgpu.js +814 -0
  36. package/dist/decode.webgpu.umd.cjs +1244 -0
  37. package/dist/encode/encode-and-compress.d.ts +3 -3
  38. package/dist/encode/encode.d.ts +3 -3
  39. package/dist/encode/find-texture-min-max.d.ts +4 -3
  40. package/dist/encode/types.d.ts +4 -3
  41. package/dist/encode.js +32 -11
  42. package/dist/encode.umd.cjs +67 -38
  43. package/dist/libultrahdr/decode-jpeg-metadata.d.ts +0 -3
  44. package/dist/libultrahdr/encode-jpeg-metadata.d.ts +2 -2
  45. package/dist/libultrahdr.js +42 -75
  46. package/dist/libultrahdr.umd.cjs +46 -79
  47. package/dist/worker-interface.js +74 -64
  48. package/dist/worker-interface.umd.cjs +73 -63
  49. package/dist/worker.js +103 -88
  50. package/dist/worker.umd.cjs +103 -89
  51. package/package.json +79 -72
  52. package/dist/decode/loaders/LoaderBase.d.ts +0 -45
  53. package/dist/decode/types.d.ts +0 -42
  54. package/dist/decode/utils/extractXMP.d.ts +0 -7
  55. /package/dist/decode/{errors → shared/errors}/GainMapNotFoundError.d.ts +0 -0
  56. /package/dist/decode/{errors → shared/errors}/XMPMetadataNotFoundError.d.ts +0 -0
  57. /package/dist/decode/{utils → shared/utils}/get-html-image-from-blob.d.ts +0 -0
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "@monogrid/gainmap-js",
3
- "version": "3.0.6",
3
+ "version": "3.2.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": "^28.0.9",
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.168.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.168.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,7 +0,0 @@
1
- import { GainMapMetadata } from '../../core/types';
2
- /**
3
- *
4
- * @param input
5
- * @returns
6
- */
7
- export declare const extractXMP: (input: Uint8Array) => GainMapMetadata | undefined;