babylon.rawTexture.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. var __extends = this.__extends || function (d, b) {
  2. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3. function __() { this.constructor = d; }
  4. __.prototype = b.prototype;
  5. d.prototype = new __();
  6. };
  7. var BABYLON;
  8. (function (BABYLON) {
  9. var RawTexture = (function (_super) {
  10. __extends(RawTexture, _super);
  11. function RawTexture(data, width, height, format, scene, generateMipMaps, invertY, samplingMode) {
  12. if (generateMipMaps === void 0) { generateMipMaps = true; }
  13. if (invertY === void 0) { invertY = false; }
  14. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  15. _super.call(this, null, scene, !generateMipMaps, invertY);
  16. this._texture = scene.getEngine().createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode);
  17. this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
  18. this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
  19. }
  20. // Statics
  21. RawTexture.CreateLuminanceTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) {
  22. if (generateMipMaps === void 0) { generateMipMaps = true; }
  23. if (invertY === void 0) { invertY = false; }
  24. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  25. return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_LUMINANCE, scene, generateMipMaps, invertY, samplingMode);
  26. };
  27. RawTexture.CreateLuminanceAlphaTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) {
  28. if (generateMipMaps === void 0) { generateMipMaps = true; }
  29. if (invertY === void 0) { invertY = false; }
  30. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  31. return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_LUMINANCE_ALPHA, scene, generateMipMaps, invertY, samplingMode);
  32. };
  33. RawTexture.CreateAlphaTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) {
  34. if (generateMipMaps === void 0) { generateMipMaps = true; }
  35. if (invertY === void 0) { invertY = false; }
  36. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  37. return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_ALPHA, scene, generateMipMaps, invertY, samplingMode);
  38. };
  39. RawTexture.CreateRGBTexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) {
  40. if (generateMipMaps === void 0) { generateMipMaps = true; }
  41. if (invertY === void 0) { invertY = false; }
  42. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  43. return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_RGB, scene, generateMipMaps, invertY, samplingMode);
  44. };
  45. RawTexture.CreateRGBATexture = function (data, width, height, scene, generateMipMaps, invertY, samplingMode) {
  46. if (generateMipMaps === void 0) { generateMipMaps = true; }
  47. if (invertY === void 0) { invertY = false; }
  48. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
  49. return new RawTexture(data, width, height, BABYLON.Engine.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode);
  50. };
  51. return RawTexture;
  52. })(BABYLON.Texture);
  53. BABYLON.RawTexture = RawTexture;
  54. })(BABYLON || (BABYLON = {}));
  55. //# sourceMappingURL=babylon.rawTexture.js.map