@monogrid/gainmap-js
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -0,1 +1,8 @@ | ||
## [3.0.2](https://github.com/MONOGRID/gainmap-js/compare/v3.0.1...v3.0.2) (2024-01-31) | ||
### Bug Fixes | ||
* **encode:** encodes a valid image when an invalid tonemapping value was provided as input ([94cec23](https://github.com/MONOGRID/gainmap-js/commit/94cec2363aa0dcb3cc46fca048c68ed7e555ebd0)) | ||
## [3.0.1](https://github.com/MONOGRID/gainmap-js/compare/v3.0.0...v3.0.1) (2023-12-03) | ||
@@ -2,0 +9,0 @@ |
@@ -63,3 +63,3 @@ # Contributor Covenant Code of Conduct | ||
reported to the community leaders responsible for enforcement at | ||
rnd@mono-grid.com. | ||
rnd@monogrid.com. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
@@ -66,0 +66,0 @@ |
@@ -84,3 +84,3 @@ <!-- omit in toc --> | ||
> 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>. | ||
> 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>. | ||
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. --> | ||
@@ -87,0 +87,0 @@ |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
import { Q as QuadRenderer } from './QuadRenderer-pEe6Kzcn.js'; | ||
import { Q as QuadRenderer } from './QuadRenderer-Nn9ZcWDa.js'; | ||
import { ShaderMaterial, Vector3, NoBlending, SRGBColorSpace, LinearSRGBColorSpace, HalfFloatType, Loader, LoadingManager, Texture, UVMapping, ClampToEdgeWrapping, LinearFilter, LinearMipMapLinearFilter, RGBAFormat, UnsignedByteType, FileLoader } from 'three'; | ||
@@ -215,3 +215,3 @@ | ||
if (gainMap.colorSpace !== LinearSRGBColorSpace) { | ||
console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*'); | ||
console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically'); | ||
gainMap.colorSpace = LinearSRGBColorSpace; | ||
@@ -763,2 +763,5 @@ } | ||
sdrLoader.load(sdrUrl, async (buffer) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof buffer === 'string') | ||
@@ -784,2 +787,5 @@ throw new Error('Invalid sdr buffer'); | ||
gainMapLoader.load(gainMapUrl, async (buffer) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof buffer === 'string') | ||
@@ -805,2 +811,5 @@ throw new Error('Invalid gainmap buffer'); | ||
metadataLoader.load(metadataUrl, async (json) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof json !== 'string') | ||
@@ -894,2 +903,5 @@ throw new Error('Invalid metadata string'); | ||
loader.load(url, async (jpeg) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof jpeg === 'string') | ||
@@ -896,0 +908,0 @@ throw new Error('Invalid buffer, received [string], was expecting [ArrayBuffer]'); |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
@@ -511,3 +511,3 @@ | ||
if (gainMap.colorSpace !== three.LinearSRGBColorSpace) { | ||
console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*'); | ||
console.warn('Gainmap Colorspace needs to be *LinearSRGBColorSpace*, setting it automatically'); | ||
gainMap.colorSpace = three.LinearSRGBColorSpace; | ||
@@ -1059,2 +1059,5 @@ } | ||
sdrLoader.load(sdrUrl, async (buffer) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof buffer === 'string') | ||
@@ -1080,2 +1083,5 @@ throw new Error('Invalid sdr buffer'); | ||
gainMapLoader.load(gainMapUrl, async (buffer) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof buffer === 'string') | ||
@@ -1101,2 +1107,5 @@ throw new Error('Invalid gainmap buffer'); | ||
metadataLoader.load(metadataUrl, async (json) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof json !== 'string') | ||
@@ -1190,2 +1199,5 @@ throw new Error('Invalid metadata string'); | ||
loader.load(url, async (jpeg) => { | ||
/* istanbul ignore if | ||
this condition exists only because of three.js types + strict mode | ||
*/ | ||
if (typeof jpeg === 'string') | ||
@@ -1192,0 +1204,0 @@ throw new Error('Invalid buffer, received [string], was expecting [ArrayBuffer]'); |
@@ -1,2 +0,2 @@ | ||
type MPFExtractorOptions = { | ||
export type MPFExtractorOptions = { | ||
debug: boolean; | ||
@@ -22,2 +22,1 @@ extractFII: boolean; | ||
} | ||
export {}; |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
import { c as compress } from './compress-6L6-d1aM.js'; | ||
import { c as compress } from './compress-_yA6snVA.js'; | ||
import { DataTexture, RGBAFormat, UVMapping, RepeatWrapping, LinearFilter, LinearSRGBColorSpace, ShaderMaterial, Vector3, NoBlending, UnsignedByteType, ACESFilmicToneMapping, LinearToneMapping, CineonToneMapping, ReinhardToneMapping, SRGBColorSpace, Vector2, WebGLRenderTarget, NearestFilter, ClampToEdgeWrapping, FloatType, DataUtils } from 'three'; | ||
import { Q as QuadRenderer } from './QuadRenderer-pEe6Kzcn.js'; | ||
import { Q as QuadRenderer } from './QuadRenderer-Nn9ZcWDa.js'; | ||
@@ -373,20 +373,28 @@ /** | ||
set toneMapping(value) { | ||
let valid = false; | ||
switch (value) { | ||
case ACESFilmicToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'ACESFilmicToneMapping'; | ||
valid = true; | ||
break; | ||
case ReinhardToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'ReinhardToneMapping'; | ||
valid = true; | ||
break; | ||
case CineonToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'CineonToneMapping'; | ||
valid = true; | ||
break; | ||
case LinearToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping'; | ||
valid = true; | ||
break; | ||
default: | ||
console.error('Unsupported toneMapping'); | ||
return; | ||
console.error(`Unsupported toneMapping: ${value}. Using LinearToneMapping.`); | ||
this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping'; | ||
this._toneMapping = LinearToneMapping; | ||
} | ||
this._toneMapping = value; | ||
if (valid) { | ||
this._toneMapping = value; | ||
} | ||
this.needsUpdate = true; | ||
@@ -393,0 +401,0 @@ } |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
@@ -22,13 +22,20 @@ | ||
const canvasToBlob = async (canvas, mimeType, quality) => { | ||
if (canvas instanceof OffscreenCanvas) { | ||
if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) { | ||
return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 }); | ||
} | ||
return new Promise((resolve, reject) => { | ||
canvas.toBlob((res) => { | ||
if (res) | ||
resolve(res); | ||
else | ||
reject(new Error('Failed to convert canvas to blob')); | ||
}, mimeType, quality || 0.9); | ||
}); | ||
else if (canvas instanceof HTMLCanvasElement) { | ||
return new Promise((resolve, reject) => { | ||
canvas.toBlob((res) => { | ||
if (res) | ||
resolve(res); | ||
else | ||
reject(new Error('Failed to convert canvas to blob')); | ||
}, mimeType, quality || 0.9); | ||
}); | ||
} | ||
/* istanbul ignore next | ||
as long as this function is not exported this is only here | ||
to satisfy TS strict mode internally | ||
*/ | ||
throw new Error('Unsupported canvas element'); | ||
}; | ||
@@ -69,2 +76,4 @@ /** | ||
canvas = document.createElement('canvas'); | ||
canvas.width = width; | ||
canvas.height = height; | ||
} | ||
@@ -746,20 +755,28 @@ const ctx = canvas.getContext('2d'); | ||
set toneMapping(value) { | ||
let valid = false; | ||
switch (value) { | ||
case three.ACESFilmicToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'ACESFilmicToneMapping'; | ||
valid = true; | ||
break; | ||
case three.ReinhardToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'ReinhardToneMapping'; | ||
valid = true; | ||
break; | ||
case three.CineonToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'CineonToneMapping'; | ||
valid = true; | ||
break; | ||
case three.LinearToneMapping: | ||
this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping'; | ||
valid = true; | ||
break; | ||
default: | ||
console.error('Unsupported toneMapping'); | ||
return; | ||
console.error(`Unsupported toneMapping: ${value}. Using LinearToneMapping.`); | ||
this.defines.TONEMAPPING_FUNCTION = 'LinearToneMapping'; | ||
this._toneMapping = three.LinearToneMapping; | ||
} | ||
this._toneMapping = value; | ||
if (valid) { | ||
this._toneMapping = value; | ||
} | ||
this.needsUpdate = true; | ||
@@ -766,0 +783,0 @@ } |
@@ -7,3 +7,3 @@ import { GainMapMetadata } from '../core/types'; | ||
* @group Decoding | ||
* | ||
* @deprecated | ||
* @example | ||
@@ -10,0 +10,0 @@ * import { decodeJPEGMetadata } from '@monogrid/gainmap-js/libultrahdr' |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-Gkwpb-h5.js'; | ||
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-A76t2eR6.js'; | ||
@@ -8,0 +8,0 @@ var lib$1; |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-Gkwpb-h5.js'; | ||
import { c as compress } from './compress-6L6-d1aM.js'; | ||
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-A76t2eR6.js'; | ||
import { c as compress } from './compress-_yA6snVA.js'; | ||
@@ -9,0 +9,0 @@ var isPromise$2 = {exports: {}}; |
/** | ||
* @monogrid/gainmap-js v3.0.1 | ||
* With ❤️, by MONOGRID <hello@mono-grid.com> | ||
* @monogrid/gainmap-js v3.0.2 | ||
* With ❤️, by MONOGRID <rnd@monogrid.com> | ||
*/ | ||
@@ -127,13 +127,20 @@ | ||
const canvasToBlob = async (canvas, mimeType, quality) => { | ||
if (canvas instanceof OffscreenCanvas) { | ||
if (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas) { | ||
return canvas.convertToBlob({ type: mimeType, quality: quality || 0.9 }); | ||
} | ||
return new Promise((resolve, reject) => { | ||
canvas.toBlob((res) => { | ||
if (res) | ||
resolve(res); | ||
else | ||
reject(new Error('Failed to convert canvas to blob')); | ||
}, mimeType, quality || 0.9); | ||
}); | ||
else if (canvas instanceof HTMLCanvasElement) { | ||
return new Promise((resolve, reject) => { | ||
canvas.toBlob((res) => { | ||
if (res) | ||
resolve(res); | ||
else | ||
reject(new Error('Failed to convert canvas to blob')); | ||
}, mimeType, quality || 0.9); | ||
}); | ||
} | ||
/* istanbul ignore next | ||
as long as this function is not exported this is only here | ||
to satisfy TS strict mode internally | ||
*/ | ||
throw new Error('Unsupported canvas element'); | ||
}; | ||
@@ -174,2 +181,4 @@ /** | ||
canvas = document.createElement('canvas'); | ||
canvas.width = width; | ||
canvas.height = height; | ||
} | ||
@@ -176,0 +185,0 @@ const ctx = canvas.getContext('2d'); |
{ | ||
"name": "@monogrid/gainmap-js", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gain map", | ||
@@ -17,3 +17,3 @@ "homepage": "https://github.com/MONOGRID/gainmap-js#readme", | ||
], | ||
"author": "MONOGRID <hello@mono-grid.com>", | ||
"author": "MONOGRID <rnd@monogrid.com>", | ||
"license": "MIT", | ||
@@ -82,5 +82,4 @@ "bugs": { | ||
"start": "concurrently -n rollup,servez -c magenta,green \"rollup -c -w\" \"servez\"", | ||
"test": "playwright test", | ||
"test": "nyc --reporter=text --reporter=lcov playwright test", | ||
"test:startserver": "rollup -c && servez", | ||
"test:report-coverage": "nyc report --reporter=text --reporter=cobertura --reporter=html --reporter=json-summary", | ||
"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", | ||
@@ -124,3 +123,3 @@ "test:codegen": "playwright codegen http://localhost:8080", | ||
"@types/node": "^20.9.0", | ||
"@types/three": "^0.158.2", | ||
"@types/three": "^0.160.0", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
@@ -131,3 +130,3 @@ "@typescript-eslint/parser": "^6.13.1", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"eslint": "^8.54.0", | ||
"eslint": "^8.55.0", | ||
"eslint-config-mdcs": "^5.0.0", | ||
@@ -140,3 +139,2 @@ "eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-promise": "^6.0.0", | ||
"eslint-plugin-quasar": "^1.1.0", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
@@ -153,3 +151,3 @@ "eslint-plugin-unused-imports": "^3.0.0", | ||
"sharp": "^0.33.0", | ||
"three": "^0.159.0", | ||
"three": "^0.160.1", | ||
"typedoc": "^0.25.4", | ||
@@ -156,0 +154,0 @@ "typedoc-github-wiki-theme": "^1.1.0", |
# gainmap-js | ||
[![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) | ||
A Javascript (TypeScript) Encoder/Decoder Implementation of Adobe's Gain Map Technology for storing HDR Images using an SDR Image + a "Gain map" | ||
@@ -17,3 +19,3 @@ | ||
## [Free online encoder](https://gainmap-creator.mono-grid.com) | ||
## [Free online encoder](https://gainmap-creator.monogrid.com) | ||
@@ -258,1 +260,5 @@ Use it to convert `.hdr` and `.exr` files into gain maps. It's free and the whole process happens in your browser. | ||
* [Ultra HDR Image Format v1.0](https://developer.android.com/guide/topics/media/platform/hdr-image-format) | ||
## License | ||
[![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) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4359691
43
38146
262