1 | import { Vector2 } from './../math/Vector2';
|
2 | import { Matrix3 } from './../math/Matrix3';
|
3 | import { EventDispatcher } from './../core/EventDispatcher';
|
4 | import {
|
5 | Mapping,
|
6 | Wrapping,
|
7 | TextureFilter,
|
8 | PixelFormat,
|
9 | PixelFormatGPU,
|
10 | TextureDataType,
|
11 | TextureEncoding,
|
12 | } from '../constants';
|
13 |
|
14 | export class Texture extends EventDispatcher {
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | constructor(
|
28 | image?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement,
|
29 | mapping?: Mapping,
|
30 | wrapS?: Wrapping,
|
31 | wrapT?: Wrapping,
|
32 | magFilter?: TextureFilter,
|
33 | minFilter?: TextureFilter,
|
34 | format?: PixelFormat,
|
35 | type?: TextureDataType,
|
36 | anisotropy?: number,
|
37 | encoding?: TextureEncoding,
|
38 | );
|
39 |
|
40 | id: number;
|
41 | uuid: string;
|
42 |
|
43 | /**
|
44 | * @default ''
|
45 | */
|
46 | name: string;
|
47 | sourceFile: string;
|
48 |
|
49 | /**
|
50 | * @default THREE.Texture.DEFAULT_IMAGE
|
51 | */
|
52 | image: any; // HTMLImageElement or ImageData or { width: number, height: number } in some children;
|
53 |
|
54 | |
55 |
|
56 |
|
57 | mipmaps: any[];
|
58 |
|
59 | |
60 |
|
61 |
|
62 | mapping: Mapping;
|
63 |
|
64 | |
65 |
|
66 |
|
67 | wrapS: Wrapping;
|
68 |
|
69 | |
70 |
|
71 |
|
72 | wrapT: Wrapping;
|
73 |
|
74 | |
75 |
|
76 |
|
77 | magFilter: TextureFilter;
|
78 |
|
79 | |
80 |
|
81 |
|
82 | minFilter: TextureFilter;
|
83 |
|
84 | |
85 |
|
86 |
|
87 | anisotropy: number;
|
88 |
|
89 | |
90 |
|
91 |
|
92 | format: PixelFormat;
|
93 |
|
94 | internalFormat: PixelFormatGPU | null;
|
95 |
|
96 | |
97 |
|
98 |
|
99 | type: TextureDataType;
|
100 |
|
101 | |
102 |
|
103 |
|
104 | matrix: Matrix3;
|
105 |
|
106 | |
107 |
|
108 |
|
109 | matrixAutoUpdate: boolean;
|
110 |
|
111 | |
112 |
|
113 |
|
114 | offset: Vector2;
|
115 |
|
116 | |
117 |
|
118 |
|
119 | repeat: Vector2;
|
120 |
|
121 | |
122 |
|
123 |
|
124 | center: Vector2;
|
125 |
|
126 | |
127 |
|
128 |
|
129 | rotation: number;
|
130 |
|
131 | |
132 |
|
133 |
|
134 | generateMipmaps: boolean;
|
135 |
|
136 | |
137 |
|
138 |
|
139 | premultiplyAlpha: boolean;
|
140 |
|
141 | |
142 |
|
143 |
|
144 | flipY: boolean;
|
145 |
|
146 | |
147 |
|
148 |
|
149 | unpackAlignment: number;
|
150 |
|
151 | |
152 |
|
153 |
|
154 | encoding: TextureEncoding;
|
155 |
|
156 | |
157 |
|
158 |
|
159 | isRenderTargetTexture: boolean;
|
160 |
|
161 | |
162 |
|
163 |
|
164 | version: number;
|
165 | needsUpdate: boolean;
|
166 | readonly isTexture: true;
|
167 |
|
168 | onUpdate: () => void;
|
169 | static DEFAULT_IMAGE: any;
|
170 | static DEFAULT_MAPPING: any;
|
171 |
|
172 | clone(): this;
|
173 | copy(source: Texture): this;
|
174 | toJSON(meta: any): any;
|
175 | dispose(): void;
|
176 | transformUv(uv: Vector2): Vector2;
|
177 | updateMatrix(): void;
|
178 | }
|