@galacean/engine-loader 2.0.0-alpha.24 → 2.0.0-alpha.25
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/dist/main.js +376 -463
- package/dist/main.js.map +1 -1
- package/dist/module.js +376 -463
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/HDRDecoder.d.ts +27 -8
- package/types/{Texture2DLoader.d.ts → TextureLoader.d.ts} +4 -4
- package/types/index.d.ts +2 -3
- package/types/resource-deserialize/index.d.ts +2 -1
- package/types/resource-deserialize/resources/textureCube/TextureCubeDecoder.d.ts +1 -0
- package/types/resource-deserialize/resources/texture2D/TextureDecoder.d.ts +0 -9
- /package/types/{TextureCubeLoader.d.ts → resource-deserialize/resources/texture2D/Texture2DDecoder.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.25",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"libs/**/*"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@galacean/engine-core": "2.0.0-alpha.
|
|
23
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
24
|
-
"@galacean/engine-rhi-webgl": "2.0.0-alpha.
|
|
22
|
+
"@galacean/engine-core": "2.0.0-alpha.25",
|
|
23
|
+
"@galacean/engine-math": "2.0.0-alpha.25",
|
|
24
|
+
"@galacean/engine-rhi-webgl": "2.0.0-alpha.25"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
package/types/HDRDecoder.d.ts
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HDR
|
|
2
|
+
* HDR (Radiance RGBE) image decoder.
|
|
3
|
+
*
|
|
4
|
+
* Decodes .hdr files into pixel data. Supports parsing the header
|
|
5
|
+
* and decoding RLE-compressed RGBE scanlines into R16G16B16A16 half-float pixels.
|
|
3
6
|
*/
|
|
4
7
|
export declare class HDRDecoder {
|
|
5
8
|
private static _float2HalfTables;
|
|
6
9
|
private static _floatView;
|
|
7
10
|
private static _uint32View;
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Parse the header of an HDR file.
|
|
13
|
+
* @returns Header info including width, height, and data start position.
|
|
14
|
+
*/
|
|
10
15
|
static parseHeader(uint8array: Uint8Array): IHDRHeader;
|
|
11
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Decode an HDR file buffer into R16G16B16A16 half-float pixel data.
|
|
18
|
+
* @param buffer - The full HDR file as Uint8Array.
|
|
19
|
+
* @returns Object with width, height, and half-float pixel data.
|
|
20
|
+
*/
|
|
21
|
+
static decode(buffer: Uint8Array): {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
pixels: Uint16Array;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Convert RGBE pixel data to R16G16B16A16 half-float.
|
|
28
|
+
*/
|
|
29
|
+
static _rgbeToHalfFloat(rgbe: Uint8Array, width: number, height: number): Uint16Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decode RLE-compressed RGBE scanlines into raw RGBE pixel data.
|
|
32
|
+
*/
|
|
33
|
+
static _readPixels(buffer: Uint8Array, width: number, height: number): Uint8Array;
|
|
12
34
|
private static _generateFloat2HalfTables;
|
|
13
|
-
private static _createCubemapData;
|
|
14
35
|
private static _readStringLine;
|
|
15
|
-
private static _readPixels;
|
|
16
36
|
}
|
|
17
|
-
interface IHDRHeader {
|
|
37
|
+
export interface IHDRHeader {
|
|
18
38
|
width: number;
|
|
19
39
|
height: number;
|
|
20
40
|
dataPosition: number;
|
|
21
41
|
}
|
|
22
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TextureFilterMode, TextureFormat, TextureWrapMode } from "@galacean/engine-core";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Texture loader params interface.
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
6
|
-
/** Texture format. default
|
|
5
|
+
export interface TextureParams {
|
|
6
|
+
/** Texture format. default `TextureFormat.R8G8B8A8` */
|
|
7
7
|
format: TextureFormat;
|
|
8
8
|
/** Whether to use multi-level texture, default is true. */
|
|
9
9
|
mipmap: boolean;
|
|
@@ -15,6 +15,6 @@ export interface Texture2DParams {
|
|
|
15
15
|
filterMode: TextureFilterMode;
|
|
16
16
|
/** Anisotropic level for texture. */
|
|
17
17
|
anisoLevel: number;
|
|
18
|
-
/** Whether the texture data is in sRGB color space
|
|
18
|
+
/** Whether the texture data is in sRGB color space. @defaultValue `true` */
|
|
19
19
|
isSRGBColorSpace: boolean;
|
|
20
20
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -16,8 +16,7 @@ import "./SourceFontLoader";
|
|
|
16
16
|
import "./SpriteAtlasLoader";
|
|
17
17
|
import "./SpriteLoader";
|
|
18
18
|
import "./TextLoader";
|
|
19
|
-
import "./
|
|
20
|
-
import "./TextureCubeLoader";
|
|
19
|
+
import "./TextureLoader";
|
|
21
20
|
import "./AudioLoader";
|
|
22
21
|
import "./ktx2/KTX2Loader";
|
|
23
22
|
import "./ShaderLoader";
|
|
@@ -27,7 +26,7 @@ import "./RenderTargetLoader";
|
|
|
27
26
|
export { GLTFLoader } from "./GLTFLoader";
|
|
28
27
|
export type { GLTFParams } from "./GLTFLoader";
|
|
29
28
|
export * from "./SceneLoader";
|
|
30
|
-
export type {
|
|
29
|
+
export type { TextureParams } from "./TextureLoader";
|
|
31
30
|
export { parseSingleKTX } from "./compressed-texture";
|
|
32
31
|
export * from "./gltf";
|
|
33
32
|
export { KTX2Loader } from "./ktx2/KTX2Loader";
|
|
@@ -3,7 +3,8 @@ export * from "./resources/animationClip/AnimationClipDecoder";
|
|
|
3
3
|
export type { IModelMesh } from "./resources/mesh/IModelMesh";
|
|
4
4
|
export { MeshDecoder } from "./resources/mesh/MeshDecoder";
|
|
5
5
|
export { ReflectionParser } from "./resources/parser/ReflectionParser";
|
|
6
|
-
|
|
6
|
+
import "./resources/texture2D/Texture2DDecoder";
|
|
7
|
+
import "./resources/textureCube/TextureCubeDecoder";
|
|
7
8
|
/**
|
|
8
9
|
* Decode engine binary resource.
|
|
9
10
|
* @param arrayBuffer - array buffer of decode binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AssetPromise, Engine, Texture2D } from "@galacean/engine-core";
|
|
2
|
-
import { BufferReader } from "../../utils/BufferReader";
|
|
3
|
-
/**
|
|
4
|
-
* Data format: [url] [mipmap(1B)] [filterMode(1B)] [anisoLevel(1B)] [wrapModeU(1B)] [wrapModeV(1B)]
|
|
5
|
-
* [format(1B)] [width(2B)] [height(2B)] [isPixelBuffer(1B)] [isSRGBColorSpace(1B)] [mipCount(1B)] [imageData...]
|
|
6
|
-
*/
|
|
7
|
-
export declare class Texture2DDecoder {
|
|
8
|
-
static decode(engine: Engine, bufferReader: BufferReader, restoredTexture?: Texture2D): AssetPromise<Texture2D>;
|
|
9
|
-
}
|
|
File without changes
|