@predy-js/render-interface 0.1.64 → 0.1.65-beta.2
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/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/native/TextureInternal.d.ts +26 -9
- package/package.json +1 -1
- package/types/native/TextureInternal.ts +30 -10
package/dist/statistic.js
CHANGED
@@ -4,13 +4,22 @@ import type { TypedArray } from '../type';
|
|
4
4
|
import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
5
5
|
export interface TextureInternalOptions extends TextureFormatOptions, Omit<TextureConfigOptionsBase, 'keepImageSource'> {
|
6
6
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'] | WebGLRenderingContext['TEXTURE_2D'];
|
7
|
-
|
7
|
+
noMipmap?: boolean;
|
8
8
|
}
|
9
9
|
export interface TextureInternalConstructOptions extends TextureInternalOptions {
|
10
10
|
width: number;
|
11
11
|
height: number;
|
12
12
|
image?: ImageBitmapInternal;
|
13
|
+
cubeImages?: Array<TextureInternalCubeImages>;
|
13
14
|
}
|
15
|
+
export type TextureInternalCubeImages<T extends ImageBitmapInternal | TypedArray = ImageBitmapInternal> = [
|
16
|
+
positiveX: T,
|
17
|
+
nagtiveX: T,
|
18
|
+
positiveY: T,
|
19
|
+
nagtiveY: T,
|
20
|
+
positiveZ: T,
|
21
|
+
nagtiveZ: T
|
22
|
+
];
|
14
23
|
export declare abstract class TextureInternal implements ResourceInternal {
|
15
24
|
readonly isDestroyed: boolean;
|
16
25
|
readonly width: number;
|
@@ -21,17 +30,25 @@ export declare abstract class TextureInternal implements ResourceInternal {
|
|
21
30
|
abstract resize(width: number, height: number): boolean;
|
22
31
|
abstract destroy(): void;
|
23
32
|
/**
|
24
|
-
|
25
|
-
|
33
|
+
* 上传cubeImage解码后的数据
|
34
|
+
*/
|
35
|
+
abstract updateCubeImagesData(images: TextureInternalCubeImages<TypedArray>, mipmapLevel?: number): void;
|
36
|
+
/**
|
37
|
+
* 上传cubeImage
|
38
|
+
*/
|
39
|
+
abstract updateCubeImages(images: TextureInternalCubeImages, mipmapLevel?: number): void;
|
40
|
+
/**
|
41
|
+
* 上传整张解码后图片数据,数据尺寸必须和Texture尺寸定义相同
|
42
|
+
*/
|
26
43
|
abstract update2DImageData(data: TypedArray, mipmapLevel?: number): void;
|
27
44
|
/**
|
28
|
-
|
29
|
-
|
45
|
+
* 上传压缩纹理数据
|
46
|
+
*/
|
30
47
|
abstract update2DCompressedImage(data: TypedArray, mipmapLevel?: number): void;
|
31
48
|
/**
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
49
|
+
* imageBitmap的尺寸也必须和Texture相同
|
50
|
+
* @param image
|
51
|
+
* @param mipmapLevel
|
52
|
+
*/
|
36
53
|
abstract update2DImage(image: ImageBitmapInternal, mipmapLevel?: number): void;
|
37
54
|
}
|
package/package.json
CHANGED
@@ -5,16 +5,26 @@ import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
|
5
5
|
|
6
6
|
export interface TextureInternalOptions extends TextureFormatOptions, Omit<TextureConfigOptionsBase, 'keepImageSource'> {
|
7
7
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'] | WebGLRenderingContext['TEXTURE_2D'],
|
8
|
-
|
8
|
+
noMipmap?: boolean,
|
9
9
|
}
|
10
10
|
|
11
11
|
export interface TextureInternalConstructOptions extends TextureInternalOptions {
|
12
12
|
width: number,
|
13
13
|
height: number,
|
14
14
|
image?: ImageBitmapInternal,
|
15
|
+
//mipmap cube images
|
16
|
+
cubeImages?: Array<TextureInternalCubeImages>,
|
15
17
|
}
|
16
18
|
|
17
|
-
|
19
|
+
export type TextureInternalCubeImages<T extends ImageBitmapInternal | TypedArray = ImageBitmapInternal> = [
|
20
|
+
positiveX: T,
|
21
|
+
nagtiveX: T,
|
22
|
+
positiveY: T,
|
23
|
+
nagtiveY: T,
|
24
|
+
positiveZ: T,
|
25
|
+
nagtiveZ: T
|
26
|
+
];
|
27
|
+
|
18
28
|
export abstract class TextureInternal implements ResourceInternal {
|
19
29
|
readonly isDestroyed: boolean;
|
20
30
|
|
@@ -34,21 +44,31 @@ export abstract class TextureInternal implements ResourceInternal {
|
|
34
44
|
abstract destroy (): void;
|
35
45
|
|
36
46
|
/**
|
37
|
-
|
38
|
-
|
47
|
+
* 上传cubeImage解码后的数据
|
48
|
+
*/
|
49
|
+
abstract updateCubeImagesData (images: TextureInternalCubeImages<TypedArray>, mipmapLevel?: number): void;
|
50
|
+
|
51
|
+
/**
|
52
|
+
* 上传cubeImage
|
53
|
+
*/
|
54
|
+
abstract updateCubeImages (images: TextureInternalCubeImages, mipmapLevel?: number): void;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* 上传整张解码后图片数据,数据尺寸必须和Texture尺寸定义相同
|
58
|
+
*/
|
39
59
|
abstract update2DImageData (data: TypedArray, mipmapLevel?: number): void;
|
40
60
|
|
41
61
|
/**
|
42
|
-
|
43
|
-
|
62
|
+
* 上传压缩纹理数据
|
63
|
+
*/
|
44
64
|
|
45
65
|
abstract update2DCompressedImage (data: TypedArray, mipmapLevel?: number): void;
|
46
66
|
|
47
67
|
/**
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
68
|
+
* imageBitmap的尺寸也必须和Texture相同
|
69
|
+
* @param image
|
70
|
+
* @param mipmapLevel
|
71
|
+
*/
|
52
72
|
abstract update2DImage (image: ImageBitmapInternal, mipmapLevel?: number): void;
|
53
73
|
|
54
74
|
}
|