We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
@monogrid/gainmap-js / decode / extractGainmapFromJPEG
extractGainmapFromJPEG(jpegFile): Promise<{ gainMap: Uint8Array<ArrayBuffer>; metadata: GainMapMetadata; sdr: Uint8Array<ArrayBuffer>; }>
jpegFile
Promise
gainMap
Uint8Array
ArrayBuffer
metadata
GainMapMetadata
sdr
Defined in: src/decode/shared/extract.ts:25
Extracts XMP Metadata and the gain map recovery image from a single JPEG file.
Uint8Array<ArrayBuffer>
an Uint8Array containing and encoded JPEG file
Promise<{ gainMap: Uint8Array<ArrayBuffer>; metadata: GainMapMetadata; sdr: Uint8Array<ArrayBuffer>; }>
an sdr Uint8Array compressed in JPEG, a gainMap Uint8Array compressed in JPEG and the XMP parsed XMP metadata
Error if XMP Metadata is not found
Error if Gain map image is not found
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)