@babylonjs/core 7.21.4 → 7.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Audio/analyser.js +3 -3
- package/Audio/analyser.js.map +1 -1
- package/Audio/audioSceneComponent.js +7 -7
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +55 -50
- package/Audio/sound.js.map +1 -1
- package/Audio/soundTrack.js +11 -11
- package/Audio/soundTrack.js.map +1 -1
- package/Cameras/flyCamera.js +2 -2
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/freeCamera.js +2 -2
- package/Cameras/freeCamera.js.map +1 -1
- package/Collisions/collisionCoordinator.js +2 -2
- package/Collisions/collisionCoordinator.js.map +1 -1
- package/Debug/debugLayer.js +2 -2
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +25 -28
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/abstractEngine.d.ts +18 -3
- package/Engines/abstractEngine.js +32 -13
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +0 -7
- package/Engines/engine.js +0 -13
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.js +3 -9
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +0 -37
- package/Engines/thinEngine.js +2 -40
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gamepads/gamepadManager.js +2 -2
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Loading/sceneLoader.d.ts +2 -2
- package/Loading/sceneLoader.js +3 -3
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.d.ts +31 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.huf.d.ts +9 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.huf.js +454 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.huf.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.js +147 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.d.ts +7 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js +91 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.configuration.d.ts +17 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.configuration.js +19 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.configuration.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.core.d.ts +130 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.core.js +452 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.core.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.decoder.d.ts +25 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js +284 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.decoder.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.header.d.ts +9 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.header.js +112 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.header.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.interfaces.d.ts +75 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.interfaces.js +16 -0
- package/Materials/Textures/Loaders/EXR/exrLoader.interfaces.js.map +1 -0
- package/Materials/Textures/Loaders/EXR/index.d.ts +7 -0
- package/Materials/Textures/Loaders/EXR/index.js +8 -0
- package/Materials/Textures/Loaders/EXR/index.js.map +1 -0
- package/Materials/Textures/Loaders/basisTextureLoader.d.ts +1 -7
- package/Materials/Textures/Loaders/basisTextureLoader.js +0 -11
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.d.ts +1 -7
- package/Materials/Textures/Loaders/ddsTextureLoader.js +0 -11
- package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.d.ts +1 -7
- package/Materials/Textures/Loaders/envTextureLoader.js +0 -11
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/exrTextureLoader.d.ts +37 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js +122 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -0
- package/Materials/Textures/Loaders/hdrTextureLoader.d.ts +1 -7
- package/Materials/Textures/Loaders/hdrTextureLoader.js +0 -11
- package/Materials/Textures/Loaders/hdrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/index.d.ts +4 -0
- package/Materials/Textures/Loaders/index.js +5 -0
- package/Materials/Textures/Loaders/index.js.map +1 -1
- package/Materials/Textures/{internalTextureLoader.d.ts → Loaders/internalTextureLoader.d.ts} +2 -9
- package/Materials/Textures/Loaders/internalTextureLoader.js.map +1 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +1 -8
- package/Materials/Textures/Loaders/ktxTextureLoader.js +0 -13
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/textureLoaderManager.d.ts +9 -0
- package/Materials/Textures/Loaders/textureLoaderManager.js +32 -0
- package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -0
- package/Materials/Textures/Loaders/tgaTextureLoader.d.ts +1 -7
- package/Materials/Textures/Loaders/tgaTextureLoader.js +0 -11
- package/Materials/Textures/Loaders/tgaTextureLoader.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +2 -2
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/index.d.ts +0 -1
- package/Materials/Textures/index.js +0 -1
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/fresnelParameters.js +2 -2
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/materialFlags.js +24 -24
- package/Materials/materialFlags.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +2 -2
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/abstractMesh.js +2 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Misc/fileTools.d.ts +13 -0
- package/Misc/fileTools.js +16 -0
- package/Misc/fileTools.js.map +1 -1
- package/Offline/database.js +2 -2
- package/Offline/database.js.map +1 -1
- package/Rendering/boundingBoxRenderer.d.ts +2 -2
- package/Rendering/boundingBoxRenderer.js +2 -2
- package/Rendering/boundingBoxRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +7 -2
- package/Rendering/edgesRenderer.js +23 -6
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/index.d.ts +12 -4
- package/Rendering/index.js +14 -4
- package/Rendering/index.js.map +1 -1
- package/Rendering/outlineRenderer.d.ts +7 -2
- package/Rendering/outlineRenderer.js +64 -11
- package/Rendering/outlineRenderer.js.map +1 -1
- package/ShadersWGSL/line.fragment.d.ts +9 -0
- package/ShadersWGSL/line.fragment.js +24 -0
- package/ShadersWGSL/line.fragment.js.map +1 -0
- package/ShadersWGSL/line.vertex.d.ts +13 -0
- package/ShadersWGSL/line.vertex.js +36 -0
- package/ShadersWGSL/line.vertex.js.map +1 -0
- package/ShadersWGSL/outline.fragment.d.ts +9 -0
- package/ShadersWGSL/outline.fragment.js +30 -0
- package/ShadersWGSL/outline.fragment.js.map +1 -0
- package/ShadersWGSL/outline.vertex.d.ts +19 -0
- package/ShadersWGSL/outline.vertex.js +66 -0
- package/ShadersWGSL/outline.vertex.js.map +1 -0
- package/Sprites/spriteMap.js +4 -4
- package/Sprites/spriteMap.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +2 -3
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/webXRExperienceHelper.js +2 -2
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +2 -3
- package/scene.js.map +1 -1
- package/Materials/Textures/internalTextureLoader.js.map +0 -1
- /package/Materials/Textures/{internalTextureLoader.js → Loaders/internalTextureLoader.js} +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ApplyLut, HufUncompress, ReverseLutFromBitmap, Wav2Decode } from "./exrLoader.compression.huf.js";
|
|
2
|
+
import { DecodeRunLength } from "./exrLoader.compression.rle.js";
|
|
3
|
+
import { InterleaveScalar, ParseUint16, ParseUint32, ParseUint8, Predictor } from "./exrLoader.core.js";
|
|
4
|
+
import { BITMAP_SIZE, INT16_SIZE, USHORT_RANGE } from "./exrLoader.interfaces.js";
|
|
5
|
+
/**
|
|
6
|
+
* No compression
|
|
7
|
+
* @param decoder defines the decoder to use
|
|
8
|
+
* @returns a decompressed data view
|
|
9
|
+
*/
|
|
10
|
+
export function UncompressRAW(decoder) {
|
|
11
|
+
return new DataView(decoder.array.buffer, decoder.offset.value, decoder.size);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* RLE compression
|
|
15
|
+
* @param decoder defines the decoder to use
|
|
16
|
+
* @returns a decompressed data view
|
|
17
|
+
*/
|
|
18
|
+
export function UncompressRLE(decoder) {
|
|
19
|
+
const compressed = decoder.viewer.buffer.slice(decoder.offset.value, decoder.offset.value + decoder.size);
|
|
20
|
+
const rawBuffer = new Uint8Array(DecodeRunLength(compressed));
|
|
21
|
+
const tmpBuffer = new Uint8Array(rawBuffer.length);
|
|
22
|
+
Predictor(rawBuffer);
|
|
23
|
+
InterleaveScalar(rawBuffer, tmpBuffer);
|
|
24
|
+
return new DataView(tmpBuffer.buffer);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Zip compression
|
|
28
|
+
* @param decoder defines the decoder to use
|
|
29
|
+
* @returns a decompressed data view
|
|
30
|
+
*/
|
|
31
|
+
export function UncompressZIP(decoder) {
|
|
32
|
+
const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
|
|
33
|
+
const rawBuffer = fflate.unzlibSync(compressed);
|
|
34
|
+
const tmpBuffer = new Uint8Array(rawBuffer.length);
|
|
35
|
+
Predictor(rawBuffer);
|
|
36
|
+
InterleaveScalar(rawBuffer, tmpBuffer);
|
|
37
|
+
return new DataView(tmpBuffer.buffer);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* PXR compression
|
|
41
|
+
* @param decoder defines the decoder to use
|
|
42
|
+
* @returns a decompressed data view
|
|
43
|
+
*/
|
|
44
|
+
export function UncompressPXR(decoder) {
|
|
45
|
+
const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);
|
|
46
|
+
const rawBuffer = fflate.unzlibSync(compressed);
|
|
47
|
+
const sz = decoder.lines * decoder.channels * decoder.width;
|
|
48
|
+
const tmpBuffer = decoder.type == 1 ? new Uint16Array(sz) : new Uint32Array(sz);
|
|
49
|
+
let tmpBufferEnd = 0;
|
|
50
|
+
let writePtr = 0;
|
|
51
|
+
const ptr = new Array(4);
|
|
52
|
+
for (let y = 0; y < decoder.lines; y++) {
|
|
53
|
+
for (let c = 0; c < decoder.channels; c++) {
|
|
54
|
+
let pixel = 0;
|
|
55
|
+
switch (decoder.type) {
|
|
56
|
+
case 1:
|
|
57
|
+
ptr[0] = tmpBufferEnd;
|
|
58
|
+
ptr[1] = ptr[0] + decoder.width;
|
|
59
|
+
tmpBufferEnd = ptr[1] + decoder.width;
|
|
60
|
+
for (let j = 0; j < decoder.width; ++j) {
|
|
61
|
+
const diff = (rawBuffer[ptr[0]++] << 8) | rawBuffer[ptr[1]++];
|
|
62
|
+
pixel += diff;
|
|
63
|
+
tmpBuffer[writePtr] = pixel;
|
|
64
|
+
writePtr++;
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case 2:
|
|
68
|
+
ptr[0] = tmpBufferEnd;
|
|
69
|
+
ptr[1] = ptr[0] + decoder.width;
|
|
70
|
+
ptr[2] = ptr[1] + decoder.width;
|
|
71
|
+
tmpBufferEnd = ptr[2] + decoder.width;
|
|
72
|
+
for (let j = 0; j < decoder.width; ++j) {
|
|
73
|
+
const diff = (rawBuffer[ptr[0]++] << 24) | (rawBuffer[ptr[1]++] << 16) | (rawBuffer[ptr[2]++] << 8);
|
|
74
|
+
pixel += diff;
|
|
75
|
+
tmpBuffer[writePtr] = pixel;
|
|
76
|
+
writePtr++;
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return new DataView(tmpBuffer.buffer);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* PIZ compression
|
|
86
|
+
* @param decoder defines the decoder to use
|
|
87
|
+
* @returns a decompressed data view
|
|
88
|
+
*/
|
|
89
|
+
export function UncompressPIZ(decoder) {
|
|
90
|
+
const inDataView = decoder.viewer;
|
|
91
|
+
const inOffset = { value: decoder.offset.value };
|
|
92
|
+
const outBuffer = new Uint16Array(decoder.width * decoder.scanlineBlockSize * (decoder.channels * decoder.type));
|
|
93
|
+
const bitmap = new Uint8Array(BITMAP_SIZE);
|
|
94
|
+
// Setup channel info
|
|
95
|
+
let outBufferEnd = 0;
|
|
96
|
+
const pizChannelData = new Array(decoder.channels);
|
|
97
|
+
for (let i = 0; i < decoder.channels; i++) {
|
|
98
|
+
pizChannelData[i] = {};
|
|
99
|
+
pizChannelData[i]["start"] = outBufferEnd;
|
|
100
|
+
pizChannelData[i]["end"] = pizChannelData[i]["start"];
|
|
101
|
+
pizChannelData[i]["nx"] = decoder.width;
|
|
102
|
+
pizChannelData[i]["ny"] = decoder.lines;
|
|
103
|
+
pizChannelData[i]["size"] = decoder.type;
|
|
104
|
+
outBufferEnd += pizChannelData[i].nx * pizChannelData[i].ny * pizChannelData[i].size;
|
|
105
|
+
}
|
|
106
|
+
// Read range compression data
|
|
107
|
+
const minNonZero = ParseUint16(inDataView, inOffset);
|
|
108
|
+
const maxNonZero = ParseUint16(inDataView, inOffset);
|
|
109
|
+
if (maxNonZero >= BITMAP_SIZE) {
|
|
110
|
+
throw new Error("Wrong PIZ_COMPRESSION BITMAP_SIZE");
|
|
111
|
+
}
|
|
112
|
+
if (minNonZero <= maxNonZero) {
|
|
113
|
+
for (let i = 0; i < maxNonZero - minNonZero + 1; i++) {
|
|
114
|
+
bitmap[i + minNonZero] = ParseUint8(inDataView, inOffset);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Reverse LUT
|
|
118
|
+
const lut = new Uint16Array(USHORT_RANGE);
|
|
119
|
+
const maxValue = ReverseLutFromBitmap(bitmap, lut);
|
|
120
|
+
const length = ParseUint32(inDataView, inOffset);
|
|
121
|
+
// Huffman decoding
|
|
122
|
+
HufUncompress(decoder.array, inDataView, inOffset, length, outBuffer, outBufferEnd);
|
|
123
|
+
// Wavelet decoding
|
|
124
|
+
for (let i = 0; i < decoder.channels; ++i) {
|
|
125
|
+
const cd = pizChannelData[i];
|
|
126
|
+
for (let j = 0; j < pizChannelData[i].size; ++j) {
|
|
127
|
+
Wav2Decode(outBuffer, cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size, maxValue);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Expand the pixel data to their original range
|
|
131
|
+
ApplyLut(lut, outBuffer, outBufferEnd);
|
|
132
|
+
// Rearrange the pixel data into the format expected by the caller.
|
|
133
|
+
let tmpOffset = 0;
|
|
134
|
+
const tmpBuffer = new Uint8Array(outBuffer.buffer.byteLength);
|
|
135
|
+
for (let y = 0; y < decoder.lines; y++) {
|
|
136
|
+
for (let c = 0; c < decoder.channels; c++) {
|
|
137
|
+
const cd = pizChannelData[c];
|
|
138
|
+
const n = cd.nx * cd.size;
|
|
139
|
+
const cp = new Uint8Array(outBuffer.buffer, cd.end * INT16_SIZE, n * INT16_SIZE);
|
|
140
|
+
tmpBuffer.set(cp, tmpOffset);
|
|
141
|
+
tmpOffset += n * INT16_SIZE;
|
|
142
|
+
cd.end += n;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return new DataView(tmpBuffer.buffer);
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=exrLoader.compression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exrLoader.compression.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.compression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAoB,MAAM,wBAAwB,CAAC;AA4EjG;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB;IAC9C,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAoB;IAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1G,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAEnD,SAAS,CAAC,SAAS,CAAC,CAAC;IAErB,gBAAgB,CAAC,SA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IAAI,CAAC;YAC1B,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;YAEjF,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC7B,SAAS,IAAI,CAAC,GAAG,UAAU,CAAC;YAC5B,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;SACf;KACJ;IAED,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { ApplyLut, HufUncompress, ReverseLutFromBitmap, Wav2Decode } from \"./exrLoader.compression.huf\";\r\nimport { DecodeRunLength } from \"./exrLoader.compression.rle\";\r\nimport { InterleaveScalar, ParseUint16, ParseUint32, ParseUint8, Predictor } from \"./exrLoader.core\";\r\nimport { BITMAP_SIZE, INT16_SIZE, USHORT_RANGE, type IEXRDecoder } from \"./exrLoader.interfaces\";\r\n\r\n/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\n// FFlate access\r\ndeclare const fflate: any;\r\n\r\n/**\r\n * No compression\r\n * @param decoder defines the decoder to use\r\n * @returns a decompressed data view\r\n */\r\nexport function UncompressRAW(decoder: IEXRDecoder): DataView {\r\n return new DataView(decoder.array.buffer, decoder.offset.value, decoder.size);\r\n}\r\n\r\n/**\r\n * RLE compression\r\n * @param decoder defines the decoder to use\r\n * @returns a decompressed data view\r\n */\r\nexport function UncompressRLE(decoder: IEXRDecoder): DataView {\r\n const compressed = decoder.viewer.buffer.slice(decoder.offset.value, decoder.offset.value + decoder.size);\r\n\r\n const rawBuffer = new Uint8Array(DecodeRunLength(compressed));\r\n const tmpBuffer = new Uint8Array(rawBuffer.length);\r\n\r\n Predictor(rawBuffer);\r\n\r\n InterleaveScalar(rawBuffer, tmpBuffer);\r\n\r\n return new DataView(tmpBuffer.buffer);\r\n}\r\n\r\n/**\r\n * Zip compression\r\n * @param decoder defines the decoder to use\r\n * @returns a decompressed data view\r\n */\r\nexport function UncompressZIP(decoder: IEXRDecoder): DataView {\r\n const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);\r\n\r\n const rawBuffer = fflate.unzlibSync(compressed);\r\n const tmpBuffer = new Uint8Array(rawBuffer.length);\r\n\r\n Predictor(rawBuffer);\r\n\r\n InterleaveScalar(rawBuffer, tmpBuffer);\r\n\r\n return new DataView(tmpBuffer.buffer);\r\n}\r\n\r\n/**\r\n * PXR compression\r\n * @param decoder defines the decoder to use\r\n * @returns a decompressed data view\r\n */\r\nexport function UncompressPXR(decoder: IEXRDecoder): DataView {\r\n const compressed = decoder.array.slice(decoder.offset.value, decoder.offset.value + decoder.size);\r\n\r\n const rawBuffer = fflate.unzlibSync(compressed);\r\n\r\n const sz = decoder.lines * decoder.channels * decoder.width;\r\n const tmpBuffer = decoder.type == 1 ? new Uint16Array(sz) : new Uint32Array(sz);\r\n\r\n let tmpBufferEnd = 0;\r\n let writePtr = 0;\r\n const ptr = new Array(4);\r\n\r\n for (let y = 0; y < decoder.lines; y++) {\r\n for (let c = 0; c < decoder.channels; c++) {\r\n let pixel = 0;\r\n\r\n switch (decoder.type) {\r\n case 1:\r\n ptr[0] = tmpBufferEnd;\r\n ptr[1] = ptr[0] + decoder.width;\r\n tmpBufferEnd = ptr[1] + decoder.width;\r\n\r\n for (let j = 0; j < decoder.width; ++j) {\r\n const diff = (rawBuffer[ptr[0]++] << 8) | rawBuffer[ptr[1]++];\r\n\r\n pixel += diff;\r\n\r\n tmpBuffer[writePtr] = pixel;\r\n writePtr++;\r\n }\r\n\r\n break;\r\n\r\n case 2:\r\n ptr[0] = tmpBufferEnd;\r\n ptr[1] = ptr[0] + decoder.width;\r\n ptr[2] = ptr[1] + decoder.width;\r\n tmpBufferEnd = ptr[2] + decoder.width;\r\n\r\n for (let j = 0; j < decoder.width; ++j) {\r\n const diff = (rawBuffer[ptr[0]++] << 24) | (rawBuffer[ptr[1]++] << 16) | (rawBuffer[ptr[2]++] << 8);\r\n\r\n pixel += diff;\r\n\r\n tmpBuffer[writePtr] = pixel;\r\n writePtr++;\r\n }\r\n\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return new DataView(tmpBuffer.buffer);\r\n}\r\n\r\n/**\r\n * PIZ compression\r\n * @param decoder defines the decoder to use\r\n * @returns a decompressed data view\r\n */\r\nexport function UncompressPIZ(decoder: IEXRDecoder): DataView {\r\n const inDataView = decoder.viewer;\r\n const inOffset = { value: decoder.offset.value };\r\n\r\n const outBuffer = new Uint16Array(decoder.width * decoder.scanlineBlockSize * (decoder.channels * decoder.type));\r\n const bitmap = new Uint8Array(BITMAP_SIZE);\r\n\r\n // Setup channel info\r\n let outBufferEnd = 0;\r\n const pizChannelData = new Array(decoder.channels);\r\n for (let i = 0; i < decoder.channels; i++) {\r\n pizChannelData[i] = {};\r\n pizChannelData[i][\"start\"] = outBufferEnd;\r\n pizChannelData[i][\"end\"] = pizChannelData[i][\"start\"];\r\n pizChannelData[i][\"nx\"] = decoder.width;\r\n pizChannelData[i][\"ny\"] = decoder.lines;\r\n pizChannelData[i][\"size\"] = decoder.type;\r\n\r\n outBufferEnd += pizChannelData[i].nx * pizChannelData[i].ny * pizChannelData[i].size;\r\n }\r\n\r\n // Read range compression data\r\n const minNonZero = ParseUint16(inDataView, inOffset);\r\n const maxNonZero = ParseUint16(inDataView, inOffset);\r\n\r\n if (maxNonZero >= BITMAP_SIZE) {\r\n throw new Error(\"Wrong PIZ_COMPRESSION BITMAP_SIZE\");\r\n }\r\n\r\n if (minNonZero <= maxNonZero) {\r\n for (let i = 0; i < maxNonZero - minNonZero + 1; i++) {\r\n bitmap[i + minNonZero] = ParseUint8(inDataView, inOffset);\r\n }\r\n }\r\n\r\n // Reverse LUT\r\n const lut = new Uint16Array(USHORT_RANGE);\r\n const maxValue = ReverseLutFromBitmap(bitmap, lut);\r\n\r\n const length = ParseUint32(inDataView, inOffset);\r\n\r\n // Huffman decoding\r\n HufUncompress(decoder.array, inDataView, inOffset, length, outBuffer, outBufferEnd);\r\n\r\n // Wavelet decoding\r\n for (let i = 0; i < decoder.channels; ++i) {\r\n const cd = pizChannelData[i];\r\n\r\n for (let j = 0; j < pizChannelData[i].size; ++j) {\r\n Wav2Decode(outBuffer, cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size, maxValue);\r\n }\r\n }\r\n\r\n // Expand the pixel data to their original range\r\n ApplyLut(lut, outBuffer, outBufferEnd);\r\n\r\n // Rearrange the pixel data into the format expected by the caller.\r\n let tmpOffset = 0;\r\n const tmpBuffer = new Uint8Array(outBuffer.buffer.byteLength);\r\n for (let y = 0; y < decoder.lines; y++) {\r\n for (let c = 0; c < decoder.channels; c++) {\r\n const cd = pizChannelData[c];\r\n\r\n const n = cd.nx * cd.size;\r\n const cp = new Uint8Array(outBuffer.buffer, cd.end * INT16_SIZE, n * INT16_SIZE);\r\n\r\n tmpBuffer.set(cp, tmpOffset);\r\n tmpOffset += n * INT16_SIZE;\r\n cd.end += n;\r\n }\r\n }\r\n\r\n return new DataView(tmpBuffer.buffer);\r\n}\r\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
|
|
3
|
+
* Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
|
|
4
|
+
* implementation.
|
|
5
|
+
*/
|
|
6
|
+
/** @internal */
|
|
7
|
+
export declare function DecodeRunLength(source: ArrayBuffer): any[];
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
|
|
3
|
+
* Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
|
|
4
|
+
* implementation.
|
|
5
|
+
*/
|
|
6
|
+
// /*
|
|
7
|
+
// Copyright (c) 2014 - 2017, Syoyo Fujita
|
|
8
|
+
// All rights reserved.
|
|
9
|
+
// Redistribution and use in source and binary forms, with or without
|
|
10
|
+
// modification, are permitted provided that the following conditions are met:
|
|
11
|
+
// * Redistributions of source code must retain the above copyright
|
|
12
|
+
// notice, this list of conditions and the following disclaimer.
|
|
13
|
+
// * Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
// notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
// documentation and/or other materials provided with the distribution.
|
|
16
|
+
// * Neither the name of the Syoyo Fujita nor the
|
|
17
|
+
// names of its contributors may be used to endorse or promote products
|
|
18
|
+
// derived from this software without specific prior written permission.
|
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
20
|
+
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
21
|
+
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
23
|
+
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
24
|
+
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
25
|
+
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
26
|
+
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
28
|
+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
// */
|
|
30
|
+
// // TinyEXR contains some OpenEXR code, which is licensed under ------------
|
|
31
|
+
// ///////////////////////////////////////////////////////////////////////////
|
|
32
|
+
// //
|
|
33
|
+
// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
|
|
34
|
+
// // Digital Ltd. LLC
|
|
35
|
+
// //
|
|
36
|
+
// // All rights reserved.
|
|
37
|
+
// //
|
|
38
|
+
// // Redistribution and use in source and binary forms, with or without
|
|
39
|
+
// // modification, are permitted provided that the following conditions are
|
|
40
|
+
// // met:
|
|
41
|
+
// // * Redistributions of source code must retain the above copyright
|
|
42
|
+
// // notice, this list of conditions and the following disclaimer.
|
|
43
|
+
// // * Redistributions in binary form must reproduce the above
|
|
44
|
+
// // copyright notice, this list of conditions and the following disclaimer
|
|
45
|
+
// // in the documentation and/or other materials provided with the
|
|
46
|
+
// // distribution.
|
|
47
|
+
// // * Neither the name of Industrial Light & Magic nor the names of
|
|
48
|
+
// // its contributors may be used to endorse or promote products derived
|
|
49
|
+
// // from this software without specific prior written permission.
|
|
50
|
+
// //
|
|
51
|
+
// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
52
|
+
// // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
53
|
+
// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
54
|
+
// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
55
|
+
// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
56
|
+
// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
57
|
+
// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
58
|
+
// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
59
|
+
// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
60
|
+
// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
61
|
+
// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
62
|
+
// //
|
|
63
|
+
// ///////////////////////////////////////////////////////////////////////////
|
|
64
|
+
// // End of OpenEXR license -------------------------------------------------
|
|
65
|
+
/** @internal */
|
|
66
|
+
export function DecodeRunLength(source) {
|
|
67
|
+
let size = source.byteLength;
|
|
68
|
+
const out = new Array();
|
|
69
|
+
let p = 0;
|
|
70
|
+
const reader = new DataView(source);
|
|
71
|
+
while (size > 0) {
|
|
72
|
+
const l = reader.getInt8(p++);
|
|
73
|
+
if (l < 0) {
|
|
74
|
+
const count = -l;
|
|
75
|
+
size -= count + 1;
|
|
76
|
+
for (let i = 0; i < count; i++) {
|
|
77
|
+
out.push(reader.getUint8(p++));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const count = l;
|
|
82
|
+
size -= 2;
|
|
83
|
+
const value = reader.getUint8(p++);
|
|
84
|
+
for (let i = 0; i < count + 1; i++) {
|
|
85
|
+
out.push(value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=exrLoader.compression.rle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exrLoader.compression.rle.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.compression.rle.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK;AACL,0CAA0C;AAC1C,uBAAuB;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,6EAA6E;AAC7E,8EAA8E;AAE9E,kFAAkF;AAClF,gFAAgF;AAChF,yEAAyE;AACzE,qEAA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AC,EAAE,CAAC,CAAC,CAAC;aAClC;SACJ;aAAM;YACH,MAAM,KAAK,GAAG,CAAC,CAAC;YAChB,IAAI,IAAI,CAAC,CAAC;YAEV,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;YAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBAChC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACnB;SACJ;KACJ;IAED,OAAO,GAAG,CAAC;AACf,CAAC","sourcesContent":["/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\n/** @internal */\r\nexport function DecodeRunLength(source: ArrayBuffer) {\r\n let size = source.byteLength;\r\n const out = new Array();\r\n let p = 0;\r\n\r\n const reader = new DataView(source);\r\n\r\n while (size > 0) {\r\n const l = reader.getInt8(p++);\r\n\r\n if (l < 0) {\r\n const count = -l;\r\n size -= count + 1;\r\n\r\n for (let i = 0; i < count; i++) {\r\n out.push(reader.getUint8(p++));\r\n }\r\n } else {\r\n const count = l;\r\n size -= 2;\r\n\r\n const value = reader.getUint8(p++);\r\n\r\n for (let i = 0; i < count + 1; i++) {\r\n out.push(value);\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n}\r\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum EXROutputType {
|
|
2
|
+
Float = 0,
|
|
3
|
+
HalfFloat = 1
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Class used to store configuration of the exr loader
|
|
7
|
+
*/
|
|
8
|
+
export declare class ExrLoaderGlobalConfiguration {
|
|
9
|
+
/**
|
|
10
|
+
* Defines the default output type to use (Half float by default)
|
|
11
|
+
*/
|
|
12
|
+
static DefaultOutputType: EXROutputType;
|
|
13
|
+
/**
|
|
14
|
+
* Url to use to load the fflate library (for zip decompression)
|
|
15
|
+
*/
|
|
16
|
+
static FFLATEUrl: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var EXROutputType;
|
|
2
|
+
(function (EXROutputType) {
|
|
3
|
+
EXROutputType[EXROutputType["Float"] = 0] = "Float";
|
|
4
|
+
EXROutputType[EXROutputType["HalfFloat"] = 1] = "HalfFloat";
|
|
5
|
+
})(EXROutputType || (EXROutputType = {}));
|
|
6
|
+
/**
|
|
7
|
+
* Class used to store configuration of the exr loader
|
|
8
|
+
*/
|
|
9
|
+
export class ExrLoaderGlobalConfiguration {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Defines the default output type to use (Half float by default)
|
|
13
|
+
*/
|
|
14
|
+
ExrLoaderGlobalConfiguration.DefaultOutputType = EXROutputType.HalfFloat;
|
|
15
|
+
/**
|
|
16
|
+
* Url to use to load the fflate library (for zip decompression)
|
|
17
|
+
*/
|
|
18
|
+
ExrLoaderGlobalConfiguration.FFLATEUrl = "https://unpkg.com/fflate@0.8.2";
|
|
19
|
+
//# sourceMappingURL=exrLoader.configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exrLoader.configuration.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Materials/Textures/Loaders/EXR/exrLoader.configuration.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,mDAAS,CAAA;IACT,2DAAa,CAAA;AACjB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED;;GAEG;AACH,MAAM,OAAO,4BAA4B;;AACrC;;GAEG;AACW,8CAAiB,GAAkB,aAAa,CAAC,SAAS,CAAC;AACzE;;GAEG;AACW,sCAAS,GAAG,gCAAgC,CAAC","sourcesContent":["export enum EXROutputType {\r\n Float = 0,\r\n HalfFloat = 1,\r\n}\r\n\r\n/**\r\n * Class used to store configuration of the exr loader\r\n */\r\nexport class ExrLoaderGlobalConfiguration {\r\n /**\r\n * Defines the default output type to use (Half float by default)\r\n */\r\n public static DefaultOutputType: EXROutputType = EXROutputType.HalfFloat;\r\n /**\r\n * Url to use to load the fflate library (for zip decompression)\r\n */\r\n public static FFLATEUrl = \"https://unpkg.com/fflate@0.8.2\";\r\n}\r\n"]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js
|
|
3
|
+
* Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita
|
|
4
|
+
* implementation.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum CompressionCodes {
|
|
7
|
+
NO_COMPRESSION = 0,
|
|
8
|
+
RLE_COMPRESSION = 1,
|
|
9
|
+
ZIPS_COMPRESSION = 2,
|
|
10
|
+
ZIP_COMPRESSION = 3,
|
|
11
|
+
PIZ_COMPRESSION = 4,
|
|
12
|
+
PXR24_COMPRESSION = 5
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface used to define the cursor position in the data
|
|
16
|
+
*/
|
|
17
|
+
export interface DataCursor {
|
|
18
|
+
/** Curosr position */
|
|
19
|
+
value: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse a null terminated string from the buffer
|
|
23
|
+
* @param buffer buffer to read from
|
|
24
|
+
* @param offset current offset in the buffer
|
|
25
|
+
* @returns a string
|
|
26
|
+
*/
|
|
27
|
+
export declare function ParseNullTerminatedString(buffer: ArrayBuffer, offset: DataCursor): string;
|
|
28
|
+
/**
|
|
29
|
+
* Parse an int32 from the buffer
|
|
30
|
+
* @param dataView dataview on the data
|
|
31
|
+
* @param offset current offset in the data view
|
|
32
|
+
* @returns an int32
|
|
33
|
+
*/
|
|
34
|
+
export declare function ParseInt32(dataView: DataView, offset: DataCursor): number;
|
|
35
|
+
/**
|
|
36
|
+
* Parse an uint32 from the buffer
|
|
37
|
+
* @param dataView data view to read from
|
|
38
|
+
* @param offset offset in the data view
|
|
39
|
+
* @returns an uint32
|
|
40
|
+
*/
|
|
41
|
+
export declare function ParseUint32(dataView: DataView, offset: DataCursor): number;
|
|
42
|
+
/**
|
|
43
|
+
* Parse an uint8 from the buffer
|
|
44
|
+
* @param dataView dataview on the data
|
|
45
|
+
* @param offset current offset in the data view
|
|
46
|
+
* @returns an uint8
|
|
47
|
+
*/
|
|
48
|
+
export declare function ParseUint8(dataView: DataView, offset: DataCursor): number;
|
|
49
|
+
/**
|
|
50
|
+
* Parse an uint16 from the buffer
|
|
51
|
+
* @param dataView dataview on the data
|
|
52
|
+
* @param offset current offset in the data view
|
|
53
|
+
* @returns an uint16
|
|
54
|
+
*/
|
|
55
|
+
export declare function ParseUint16(dataView: DataView, offset: DataCursor): number;
|
|
56
|
+
/**
|
|
57
|
+
* Parse an uint8 from an array buffer
|
|
58
|
+
* @param array array buffer
|
|
59
|
+
* @param offset current offset in the data view
|
|
60
|
+
* @returns an uint16
|
|
61
|
+
*/
|
|
62
|
+
export declare function ParseUint8Array(array: Uint8Array, offset: DataCursor): number;
|
|
63
|
+
/**
|
|
64
|
+
* Parse an int64 from the buffer
|
|
65
|
+
* @param dataView dataview on the data
|
|
66
|
+
* @param offset current offset in the data view
|
|
67
|
+
* @returns an int64
|
|
68
|
+
*/
|
|
69
|
+
export declare function ParseInt64(dataView: DataView, offset: DataCursor): number;
|
|
70
|
+
/**
|
|
71
|
+
* Parse a float32 from the buffer
|
|
72
|
+
* @param dataView dataview on the data
|
|
73
|
+
* @param offset current offset in the data view
|
|
74
|
+
* @returns a float32
|
|
75
|
+
*/
|
|
76
|
+
export declare function ParseFloat32(dataView: DataView, offset: DataCursor): number;
|
|
77
|
+
/**
|
|
78
|
+
* Parse a float16 from the buffer
|
|
79
|
+
* @param dataView dataview on the data
|
|
80
|
+
* @param offset current offset in the data view
|
|
81
|
+
* @returns a float16
|
|
82
|
+
*/
|
|
83
|
+
export declare function ParseFloat16(dataView: DataView, offset: DataCursor): number;
|
|
84
|
+
/**
|
|
85
|
+
* Decode a float32 from the buffer
|
|
86
|
+
* @param dataView dataview on the data
|
|
87
|
+
* @param offset current offset in the data view
|
|
88
|
+
* @returns a float32
|
|
89
|
+
*/
|
|
90
|
+
export declare function DecodeFloat32(dataView: DataView, offset: DataCursor): number;
|
|
91
|
+
/**
|
|
92
|
+
* Parse a value from the data view
|
|
93
|
+
* @param dataView defines the data view to read from
|
|
94
|
+
* @param offset defines the current offset in the data view
|
|
95
|
+
* @param type defines the type of the value to read
|
|
96
|
+
* @param size defines the size of the value to read
|
|
97
|
+
* @returns the parsed value
|
|
98
|
+
*/
|
|
99
|
+
export declare function ParseValue(dataView: DataView, offset: DataCursor, type: string, size: number): string | number | number[] | {
|
|
100
|
+
name: string;
|
|
101
|
+
pixelType: number;
|
|
102
|
+
pLinear: number;
|
|
103
|
+
xSampling: number;
|
|
104
|
+
ySampling: number;
|
|
105
|
+
}[] | {
|
|
106
|
+
redX: number;
|
|
107
|
+
redY: number;
|
|
108
|
+
greenX: number;
|
|
109
|
+
greenY: number;
|
|
110
|
+
blueX: number;
|
|
111
|
+
blueY: number;
|
|
112
|
+
whiteX: number;
|
|
113
|
+
whiteY: number;
|
|
114
|
+
} | {
|
|
115
|
+
xMin: number;
|
|
116
|
+
yMin: number;
|
|
117
|
+
xMax: number;
|
|
118
|
+
yMax: number;
|
|
119
|
+
} | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Revert the endianness of the data
|
|
122
|
+
* @param source defines the source
|
|
123
|
+
*/
|
|
124
|
+
export declare function Predictor(source: Uint8Array): void;
|
|
125
|
+
/**
|
|
126
|
+
* Interleave pixels
|
|
127
|
+
* @param source defines the data source
|
|
128
|
+
* @param out defines the output
|
|
129
|
+
*/
|
|
130
|
+
export declare function InterleaveScalar(source: Uint8Array, out: Uint8Array): void;
|