Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@monogrid/gainmap-js

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monogrid/gainmap-js - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

dist/_commonjsHelpers-bdHH9bEd.js

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [2.0.5](https://github.com/MONOGRID/gainmap-js/compare/v2.0.4...v2.0.5) (2023-11-16)
### Bug Fixes
* **jpegrloader:** rename JPEGRLoader to HDRJPEGLoader, old name kept for compatibility ([ac6e386](https://github.com/MONOGRID/gainmap-js/commit/ac6e38610886b7adec5806a7ad301bff1ec00d62))
## [2.0.4](https://github.com/MONOGRID/gainmap-js/compare/v2.0.3...v2.0.4) (2023-11-15)

@@ -2,0 +9,0 @@

4

dist/core/get-data-texture.d.ts

@@ -8,4 +8,4 @@ import { DataTexture } from 'three';

*
* @category General
* @group General
* @category Utility
* @group Utility
*

@@ -12,0 +12,0 @@ * @param image

import { ByteType, ColorSpace, DataTexture, FloatType, HalfFloatType, IntType, Material, ShortType, TextureDataType, UnsignedByteType, UnsignedIntType, WebGLRenderer, WebGLRenderTarget } from 'three';
/**
* @category General
* @group General
* Utility Type that translates `three` texture types to their TypedArray counterparts.
*
* @category Utility
* @group Utility
*/
export type TextureDataTypeToBufferType<TType extends TextureDataType> = TType extends typeof UnsignedByteType ? Uint8ClampedArray : TType extends typeof HalfFloatType ? Uint16Array : TType extends typeof UnsignedIntType ? Uint32Array : TType extends typeof ByteType ? Int8Array : TType extends typeof ShortType ? Int16Array : TType extends typeof IntType ? Int32Array : TType extends typeof FloatType ? Float32Array : never;
/**
* Utility structure used for rendering a texture with a material
* Utility class used for rendering a texture with a material
*
* @category General
* @group General
* @category Core
* @group Core
*/

@@ -13,0 +15,0 @@ export declare class QuadRenderer<TType extends TextureDataType, TMaterial extends Material> {

@@ -5,4 +5,4 @@ /**

*
* @category Gainmap Specifications
* @group Gainmap Specifications
* @category Specs
* @group Specs
*/

@@ -9,0 +9,0 @@ export type GainMapMetadata = {

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>
*/
import { Q as QuadRenderer } from './QuadRenderer-lU9EAEKl.js';
import { Q as QuadRenderer } from './QuadRenderer-bEJB0XFk.js';
import { ShaderMaterial, Vector3, NoBlending, SRGBColorSpace, NoColorSpace, HalfFloatType, Loader, Texture, UVMapping, ClampToEdgeWrapping, LinearFilter, LinearMipMapLinearFilter, RGBAFormat, UnsignedByteType, FileLoader } from 'three';

@@ -155,4 +155,4 @@

*
* @category Decoding
* @group Decoding
* @category Decoding Functions
* @group Decoding Functions
* @example

@@ -219,2 +219,4 @@ * import { decode } from '@monogrid/gainmap-js'

gainMap }));
// TODO: three types are generic, eslint complains here, see how we can solve
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
const quadRenderer = new QuadRenderer(sdr.image.width, sdr.image.height, HalfFloatType, NoColorSpace, material, renderer);

@@ -471,5 +473,20 @@ try {

/**
* Extracts XMP Metadata and the gain map recovery image
* from a single JPEG file.
*
* @param jpegFile
* @returns
* @category Decoding Functions
* @group Decoding Functions
* @param jpegFile an `Uint8Array` containing and encoded JPEG file
* @returns an sdr `Uint8Array` compressed in JPEG, a gainMap `Uint8Array` compressed in JPEG and the XMP parsed XMP metadata
* @throws Error if XMP Metadata is not found
* @throws Error if Gain map image is not found
* @example
* import { FileLoader } from 'three'
* import { extractGainmapFromJPEG } from '@monogrid/gainmap-js'
*
* const jpegFile = await new FileLoader()
* .setResponseType('arraybuffer')
* .loadAsync('image.jpg')
*
* const { sdr, gainMap, metadata } = extractGainmapFromJPEG(jpegFile)
*/

@@ -632,3 +649,2 @@ const extractGainmapFromJPEG = async (jpegFile) => {

*
*
*/

@@ -644,8 +660,6 @@ class GainMapLoader extends LoaderBase {

*
* @param sdrUrl
* @param gainMapUrl
* @param metadataUrl
* @param onLoad
* @param onProgress
* @param onError
* @param urls An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
* @param onLoad Load complete callback, will receive the result
* @param onProgress Progress callback, will receive a {@link ProgressEvent}
* @param onError Error callback
* @returns

@@ -692,3 +706,3 @@ */

sdr = buffer;
loadCheck();
await loadCheck();
}, (e) => {

@@ -709,3 +723,3 @@ sdrLengthComputable = e.lengthComputable;

gainMap = buffer;
loadCheck();
await loadCheck();
}, (e) => {

@@ -725,4 +739,6 @@ gainMapLengthComputable = e.lengthComputable;

throw new Error('Invalid metadata string');
// TODO: implement check on JSON file and remove this eslint disable
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
metadata = JSON.parse(json);
loadCheck();
await loadCheck();
}, (e) => {

@@ -783,9 +799,10 @@ metadataLengthComputable = e.lengthComputable;

*/
class JPEGRLoader extends LoaderBase {
class HDRJPGLoader extends LoaderBase {
/**
* Loads a JPEGR Image
*
* @param url
* @param onLoad
* @param onProgress
* @param onError
* @param url An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
* @param onLoad Load complete callback, will receive the result
* @param onProgress Progress callback, will receive a {@link ProgressEvent}
* @param onError Error callback
* @returns

@@ -813,2 +830,2 @@ */

export { GainMapDecoderMaterial, GainMapLoader, JPEGRLoader, QuadRenderer, decode, extractGainmapFromJPEG };
export { GainMapDecoderMaterial, GainMapLoader, HDRJPGLoader, HDRJPGLoader as JPEGRLoader, QuadRenderer, decode, extractGainmapFromJPEG };
/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>

@@ -81,6 +81,6 @@ */

/**
* Utility structure used for rendering a texture with a material
* Utility class used for rendering a texture with a material
*
* @category General
* @group General
* @category Core
* @group Core
*/

@@ -389,4 +389,4 @@ class QuadRenderer {

*
* @category Decoding
* @group Decoding
* @category Decoding Functions
* @group Decoding Functions
* @example

@@ -453,2 +453,4 @@ * import { decode } from '@monogrid/gainmap-js'

gainMap }));
// TODO: three types are generic, eslint complains here, see how we can solve
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
const quadRenderer = new QuadRenderer(sdr.image.width, sdr.image.height, three.HalfFloatType, three.NoColorSpace, material, renderer);

@@ -705,5 +707,20 @@ try {

/**
* Extracts XMP Metadata and the gain map recovery image
* from a single JPEG file.
*
* @param jpegFile
* @returns
* @category Decoding Functions
* @group Decoding Functions
* @param jpegFile an `Uint8Array` containing and encoded JPEG file
* @returns an sdr `Uint8Array` compressed in JPEG, a gainMap `Uint8Array` compressed in JPEG and the XMP parsed XMP metadata
* @throws Error if XMP Metadata is not found
* @throws Error if Gain map image is not found
* @example
* import { FileLoader } from 'three'
* import { extractGainmapFromJPEG } from '@monogrid/gainmap-js'
*
* const jpegFile = await new FileLoader()
* .setResponseType('arraybuffer')
* .loadAsync('image.jpg')
*
* const { sdr, gainMap, metadata } = extractGainmapFromJPEG(jpegFile)
*/

@@ -866,3 +883,2 @@ const extractGainmapFromJPEG = async (jpegFile) => {

*
*
*/

@@ -878,8 +894,6 @@ class GainMapLoader extends LoaderBase {

*
* @param sdrUrl
* @param gainMapUrl
* @param metadataUrl
* @param onLoad
* @param onProgress
* @param onError
* @param urls An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
* @param onLoad Load complete callback, will receive the result
* @param onProgress Progress callback, will receive a {@link ProgressEvent}
* @param onError Error callback
* @returns

@@ -926,3 +940,3 @@ */

sdr = buffer;
loadCheck();
await loadCheck();
}, (e) => {

@@ -943,3 +957,3 @@ sdrLengthComputable = e.lengthComputable;

gainMap = buffer;
loadCheck();
await loadCheck();
}, (e) => {

@@ -959,4 +973,6 @@ gainMapLengthComputable = e.lengthComputable;

throw new Error('Invalid metadata string');
// TODO: implement check on JSON file and remove this eslint disable
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
metadata = JSON.parse(json);
loadCheck();
await loadCheck();
}, (e) => {

@@ -1017,9 +1033,10 @@ metadataLengthComputable = e.lengthComputable;

*/
class JPEGRLoader extends LoaderBase {
class HDRJPGLoader extends LoaderBase {
/**
* Loads a JPEGR Image
*
* @param url
* @param onLoad
* @param onProgress
* @param onError
* @param url An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
* @param onLoad Load complete callback, will receive the result
* @param onProgress Progress callback, will receive a {@link ProgressEvent}
* @param onError Error callback
* @returns

@@ -1049,3 +1066,4 @@ */

exports.GainMapLoader = GainMapLoader;
exports.JPEGRLoader = JPEGRLoader;
exports.HDRJPGLoader = HDRJPGLoader;
exports.JPEGRLoader = HDRJPGLoader;
exports.QuadRenderer = QuadRenderer;

@@ -1052,0 +1070,0 @@ exports.decode = decode;

@@ -7,4 +7,4 @@ import { QuadRenderer } from '../core/QuadRenderer';

*
* @category Decoding
* @group Decoding
* @category Decoding Functions
* @group Decoding Functions
* @example

@@ -11,0 +11,0 @@ * import { decode } from '@monogrid/gainmap-js'

/**
* Extracts XMP Metadata and the gain map recovery image
* from a single JPEG file.
*
* @param jpegFile
* @returns
* @category Decoding Functions
* @group Decoding Functions
* @param jpegFile an `Uint8Array` containing and encoded JPEG file
* @returns an sdr `Uint8Array` compressed in JPEG, a gainMap `Uint8Array` compressed in JPEG and the XMP parsed XMP metadata
* @throws Error if XMP Metadata is not found
* @throws Error if Gain map image is not found
* @example
* import { FileLoader } from 'three'
* import { extractGainmapFromJPEG } from '@monogrid/gainmap-js'
*
* const jpegFile = await new FileLoader()
* .setResponseType('arraybuffer')
* .loadAsync('image.jpg')
*
* const { sdr, gainMap, metadata } = extractGainmapFromJPEG(jpegFile)
*/

@@ -6,0 +21,0 @@ export declare const extractGainmapFromJPEG: (jpegFile: Uint8Array) => Promise<{

@@ -6,4 +6,5 @@ export * from '../core/QuadRenderer';

export * from './loaders/GainMapLoader';
export * from './loaders/JPEGRLoader';
export * from './loaders/HDRJPGLoader';
export { HDRJPGLoader as JPEGRLoader } from './loaders/HDRJPGLoader';
export * from './materials/GainMapDecoderMaterial';
export * from './types';

@@ -48,3 +48,2 @@ import { HalfFloatType } from 'three';

*
*
*/

@@ -60,8 +59,6 @@ export declare class GainMapLoader extends LoaderBase<[string, string, string]> {

*
* @param sdrUrl
* @param gainMapUrl
* @param metadataUrl
* @param onLoad
* @param onProgress
* @param onError
* @param urls An array in the form of [sdr.jpg, gainmap.jpg, metadata.json]
* @param onLoad Load complete callback, will receive the result
* @param onProgress Progress callback, will receive a {@link ProgressEvent}
* @param onError Error callback
* @returns

@@ -68,0 +65,0 @@ */

import { type Texture, type WebGLRenderer } from 'three';
import { type GainMapMetadata } from '../core/types';
/**
* Parameters for decoding a Gainmap
* Necessary parameters for decoding a Gainmap
*
* @category Gainmap Specifications
* @group Gainmap Specifications
* @category Specs
* @group Specs
*/

@@ -22,4 +22,4 @@ export type GainmapDecodingParameters = {

/**
* @category Decoding
* @group Decoding
* @category Decoding Functions
* @group Decoding Functions
*/

@@ -26,0 +26,0 @@ export type DecodeParameters = {

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>
*/
import { c as compress } from './compress-RL9UE9ww.js';
import { c as compress } from './compress-aBsBfoFB.js';
import { DataTexture, RGBAFormat, UVMapping, RepeatWrapping, LinearFilter, NoColorSpace, ShaderMaterial, Vector3, NoBlending, UnsignedByteType, ACESFilmicToneMapping, LinearToneMapping, CineonToneMapping, ReinhardToneMapping, SRGBColorSpace, Vector2, WebGLRenderTarget, NearestFilter, ClampToEdgeWrapping, FloatType, DataUtils } from 'three';
import { Q as QuadRenderer } from './QuadRenderer-lU9EAEKl.js';
import { Q as QuadRenderer } from './QuadRenderer-bEJB0XFk.js';

@@ -13,4 +13,4 @@ /**

*
* @category General
* @group General
* @category Utility
* @group Utility
*

@@ -649,4 +649,4 @@ * @param image

*
* @category Encoding Functions
* @group Encoding Functions
* @category Utility
* @group Utility
*

@@ -704,3 +704,5 @@ * @param srcTex

mat.uniforms.map.value = fbi.texture;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
mat.uniforms.u_srcResolution.value.x = w;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
mat.uniforms.u_srcResolution.value.y = h;

@@ -707,0 +709,0 @@ });

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>

@@ -91,4 +91,4 @@ */

*
* @category General
* @group General
* @category Utility
* @group Utility
*

@@ -187,6 +187,6 @@ * @param image

/**
* Utility structure used for rendering a texture with a material
* Utility class used for rendering a texture with a material
*
* @category General
* @group General
* @category Core
* @group Core
*/

@@ -958,4 +958,4 @@ class QuadRenderer {

*
* @category Encoding Functions
* @group Encoding Functions
* @category Utility
* @group Utility
*

@@ -1013,3 +1013,5 @@ * @param srcTex

mat.uniforms.map.value = fbi.texture;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
mat.uniforms.u_srcResolution.value.x = w;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
mat.uniforms.u_srcResolution.value.y = h;

@@ -1016,0 +1018,0 @@ });

@@ -7,4 +7,4 @@ import { DataTexture, WebGLRenderer } from 'three';

*
* @category Encoding Functions
* @group Encoding Functions
* @category Utility
* @group Utility
*

@@ -11,0 +11,0 @@ * @param srcTex

@@ -8,4 +8,4 @@ import { type DataTexture, ToneMapping, WebGLRenderer } from 'three';

* Parameters used by content Creators in order to create a GainMap
* @category Gainmap Specifications
* @group Gainmap Specifications
* @category Specs
* @group Specs
*/

@@ -97,4 +97,4 @@ export type GainmapEncodingParameters = {

*
* @category General
* @group General
* @category Utility
* @group Utility
*/

@@ -105,4 +105,4 @@ export type HDRRawImageBuffer = EXR['data'] | RGBE['data'] | LogLuv['data'];

*
* @category General
* @group General
* @category Utility
* @group Utility
*/

@@ -109,0 +109,0 @@ export type HDRRawImage = {

import { MainModule } from '../../libultrahdr-wasm/build/libultrahdr';
/**
* Instances the WASM module and returns it, only one module will be created upon multiple calls.
* @category General
* @group General
* @category WASM
* @group WASM
*

@@ -7,0 +7,0 @@ * @returns

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>
*/
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-n2Ng5lYw.js';
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers-bdHH9bEd.js';

@@ -477,2 +477,3 @@ var lib$1;

const getPromiseWorker = (worker) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
return new PromiseWorker$1(worker);

@@ -479,0 +480,0 @@ };

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>

@@ -487,2 +487,3 @@ */

const getPromiseWorker = (worker) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
return new PromiseWorker$1(worker);

@@ -489,0 +490,0 @@ };

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>
*/
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-n2Ng5lYw.js';
import { c as compress } from './compress-RL9UE9ww.js';
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-bdHH9bEd.js';
import { c as compress } from './compress-aBsBfoFB.js';

@@ -116,2 +116,3 @@ var isPromise$2 = {exports: {}};

};
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
registerPromiseWorker$1(async (message, withTransferList) => {

@@ -118,0 +119,0 @@ switch (message.type) {

/**
* @monogrid/gainmap-js v2.0.3
* @monogrid/gainmap-js v2.0.4
* With ❤️, by MONOGRID <hello@mono-grid.com>

@@ -198,2 +198,3 @@ */

};
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
registerPromiseWorker$1(async (message, withTransferList) => {

@@ -200,0 +201,0 @@ switch (message.type) {

{
"name": "@monogrid/gainmap-js",
"version": "2.0.4",
"version": "2.0.5",
"description": "A Javascript (TypeScript) Port of Adobe Gainmap Technology for storing HDR Images using an SDR Image + a gain map",

@@ -127,2 +127,3 @@ "homepage": "https://github.com/MONOGRID/gainmap-js#readme",

"eslint-config-standard": "^17.0.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.29.0",

@@ -129,0 +130,0 @@ "eslint-plugin-jest-extended": "^2.0.0",

@@ -40,3 +40,3 @@ # gainmap-js

Please note that Google [is adopting the gain map technology in Android 14](https://support.google.com/photos/answer/14159275) but its naming of the technology refers to it as **Ultra HDR Image Format** and a JPEG file with embedded gain map is called `JPEGR` in their terminology.
Please note that Google [is adopting the gain map technology in Android 14](https://support.google.com/photos/answer/14159275) but its naming of the technology refers to it as **Ultra HDR Image Format** and a JPEG file with embedded gain map is [apparently called JPEGR](https://github.com/google/libultrahdr/blob/3a3a752a5da0b2304b1b6de0ef383bbe41256a67/lib/jpegr.h#L28C16-L28C21) in their terminology, we call it `HDRJPEG` for the moment.

@@ -67,3 +67,3 @@ ## API

```ts
import { JPEGRLoader } from '@monogrid/gainmap-js'
import { HDRJPGLoader } from '@monogrid/gainmap-js'
import {

@@ -82,3 +82,3 @@ EquirectangularReflectionMapping,

const loader = new JPEGRLoader(renderer)
const loader = new HDRJPGLoader(renderer)

@@ -85,0 +85,0 @@ const result = loader.load('gainmap.jpeg')

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc