parse-exr
Version:
EXR file parser. Ported from Three.js implementation without depending on it.
29 lines (28 loc) • 787 B
TypeScript
export default parseExr;
export type EXRData = {
header: object;
width: number;
height: number;
data: Uint16Array | Float32Array;
/**
* RGBAFormat (1023) or RedFormat (1028)
*/
format: 1023 | 1028;
colorSpace: "" | "srgb-linear";
};
/**
* @typedef EXRData
* @property {object} header
* @property {number} width
* @property {number} height
* @property {Uint16Array|Float32Array} data
* @property {1023|1028} format RGBAFormat (1023) or RedFormat (1028)
* @property {""|"srgb-linear"} colorSpace
*/
/**
* Parse a buffer and return EXR data
* @param {ArrayBuffer} buffer
* @param {1015|1016} [type=1016] Float (1015) or Half Float (1016)
* @returns {EXRData}
*/
declare function parseExr(buffer: ArrayBuffer, type?: 1015 | 1016): EXRData;