Texture.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import { Vector2 } from './../math/Vector2';
  2. import { Matrix3 } from './../math/Matrix3';
  3. import { EventDispatcher } from './../core/EventDispatcher';
  4. import {
  5. Mapping,
  6. Wrapping,
  7. TextureFilter,
  8. PixelFormat,
  9. PixelFormatGPU,
  10. TextureDataType,
  11. TextureEncoding
  12. } from '../constants';
  13. export class Texture extends EventDispatcher {
  14. /**
  15. * @param [image]
  16. * @param [mapping=THREE.Texture.DEFAULT_MAPPING]
  17. * @param [wrapS=THREE.ClampToEdgeWrapping]
  18. * @param [wrapT=THREE.ClampToEdgeWrapping]
  19. * @param [magFilter=THREE.LinearFilter]
  20. * @param [minFilter=THREE.LinearMipmapLinearFilter]
  21. * @param [format=THREE.RGBAFormat]
  22. * @param [type=THREE.UnsignedByteType]
  23. * @param [anisotropy=1]
  24. * @param [encoding=THREE.LinearEncoding]
  25. */
  26. constructor(
  27. image?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement,
  28. mapping?: Mapping,
  29. wrapS?: Wrapping,
  30. wrapT?: Wrapping,
  31. magFilter?: TextureFilter,
  32. minFilter?: TextureFilter,
  33. format?: PixelFormat,
  34. type?: TextureDataType,
  35. anisotropy?: number,
  36. encoding?: TextureEncoding
  37. );
  38. id: number;
  39. uuid: string;
  40. /**
  41. * @default ''
  42. */
  43. name: string;
  44. sourceFile: string;
  45. /**
  46. * @default THREE.Texture.DEFAULT_IMAGE
  47. */
  48. image: any; // HTMLImageElement or ImageData or { width: number, height: number } in some children;
  49. /**
  50. * @default []
  51. */
  52. mipmaps: any[]; // ImageData[] for 2D textures and CubeTexture[] for cube textures;
  53. /**
  54. * @default THREE.Texture.DEFAULT_MAPPING
  55. */
  56. mapping: Mapping;
  57. /**
  58. * @default THREE.ClampToEdgeWrapping
  59. */
  60. wrapS: Wrapping;
  61. /**
  62. * @default THREE.ClampToEdgeWrapping
  63. */
  64. wrapT: Wrapping;
  65. /**
  66. * @default THREE.LinearFilter
  67. */
  68. magFilter: TextureFilter;
  69. /**
  70. * @default THREE.LinearMipmapLinearFilter
  71. */
  72. minFilter: TextureFilter;
  73. /**
  74. * @default 1
  75. */
  76. anisotropy: number;
  77. /**
  78. * @default THREE.RGBAFormat
  79. */
  80. format: PixelFormat;
  81. internalFormat: PixelFormatGPU | null;
  82. /**
  83. * @default THREE.UnsignedByteType
  84. */
  85. type: TextureDataType;
  86. /**
  87. * @default new THREE.Matrix3()
  88. */
  89. matrix: Matrix3;
  90. /**
  91. * @default true
  92. */
  93. matrixAutoUpdate: boolean;
  94. /**
  95. * @default new THREE.Vector2( 0, 0 )
  96. */
  97. offset: Vector2;
  98. /**
  99. * @default new THREE.Vector2( 1, 1 )
  100. */
  101. repeat: Vector2;
  102. /**
  103. * @default new THREE.Vector2( 0, 0 )
  104. */
  105. center: Vector2;
  106. /**
  107. * @default 0
  108. */
  109. rotation: number;
  110. /**
  111. * @default true
  112. */
  113. generateMipmaps: boolean;
  114. /**
  115. * @default false
  116. */
  117. premultiplyAlpha: boolean;
  118. /**
  119. * @default true
  120. */
  121. flipY: boolean;
  122. /**
  123. * @default 4
  124. */
  125. unpackAlignment: number;
  126. /**
  127. * @default THREE.LinearEncoding
  128. */
  129. encoding: TextureEncoding;
  130. /**
  131. * @default 0
  132. */
  133. version: number;
  134. needsUpdate: boolean;
  135. readonly isTexture: true;
  136. onUpdate: () => void;
  137. static DEFAULT_IMAGE: any;
  138. static DEFAULT_MAPPING: any;
  139. clone(): this;
  140. copy( source: Texture ): this;
  141. toJSON( meta: any ): any;
  142. dispose(): void;
  143. transformUv( uv: Vector2 ): Vector2;
  144. updateMatrix(): void;
  145. }
粤ICP备19079148号