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