UNPKG

841 BJavaScriptView Raw
1import { Texture } from './Texture.js';
2import { NearestFilter } from '../constants.js';
3
4function 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
21DataTexture.prototype = Object.create( Texture.prototype );
22DataTexture.prototype.constructor = DataTexture;
23
24DataTexture.prototype.isDataTexture = true;
25
26
27export { DataTexture };