DataTexture.js 847 B

1234567891011121314151617181920212223242526272829
  1. import { Texture } from './Texture';
  2. import { NearestFilter } from '../constants';
  3. /**
  4. * @author alteredq / http://alteredqualia.com/
  5. */
  6. function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
  7. Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
  8. this.image = { data: data, width: width, height: height };
  9. this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
  10. this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
  11. this.generateMipmaps = false;
  12. this.flipY = false;
  13. this.unpackAlignment = 1;
  14. }
  15. DataTexture.prototype = Object.create( Texture.prototype );
  16. DataTexture.prototype.constructor = DataTexture;
  17. DataTexture.prototype.isDataTexture = true;
  18. export { DataTexture };
粤ICP备19079148号