import { GainMapNode } from '../nodes/GainMapNode'; import { LoaderBaseNode } from './LoaderBaseNode'; /** * A Three.js Loader for a JPEG with embedded gain map metadata, * returning a {@link GainMapNode} (a TSL texture node holding the decoded HDR image). * * No renderer is needed: `load` returns the node synchronously * (like `TextureLoader` returns a `Texture`), it can be assigned to materials right away * and it is decoded on the GPU once loaded. * * @category Loaders * @group Loaders * * @example * import { HDRJPGNodeLoader } from '@monogrid/gainmap-js/webgpu' * import { equirectUV } from 'three/tsl' * import { MeshBasicNodeMaterial } from 'three/webgpu' * * const hdr = new HDRJPGNodeLoader().load('gainmap.jpeg') * * const material = new MeshBasicNodeMaterial() * material.colorNode = hdr * * scene.backgroundNode = hdr.sample(equirectUV()) * * // all parameters are uniforms, changing them re-decodes the image once * hdr.maxDisplayBoost.value = 2 */ export declare class HDRJPGNodeLoader extends LoaderBaseNode { /** * Loads a JPEG containing gain map metadata * Renders a normal SDR image if gainmap data is not found * * @param url Path to a JPEG file containing embedded gain map metadata * @param onLoad Load complete callback, will receive the node * @param onProgress Progress callback, will receive a `ProgressEvent` * @param onError Error callback * @returns a node which can be used immediately, it will hold the image once loaded */ load(url: string, onLoad?: (data: GainMapNode) => void, onProgress?: (event: ProgressEvent) => void, onError?: (err: unknown) => void): GainMapNode; }