1 | import { Texture } from './Texture.js';
|
2 | import { NearestFilter } from '../constants.js';
|
3 |
|
4 | function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
|
5 |
|
6 | Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
|
7 |
|
8 | this.image = { data: data || null, width: width || 1, height: height || 1 };
|
9 |
|
10 | this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
|
11 | this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
|
12 |
|
13 | this.generateMipmaps = false;
|
14 | this.flipY = false;
|
15 | this.unpackAlignment = 1;
|
16 |
|
17 | this.needsUpdate = true;
|
18 |
|
19 | }
|
20 |
|
21 | DataTexture.prototype = Object.create( Texture.prototype );
|
22 | DataTexture.prototype.constructor = DataTexture;
|
23 |
|
24 | DataTexture.prototype.isDataTexture = true;
|
25 |
|
26 |
|
27 | export { DataTexture };
|