File size: 1,576 Bytes
6cd9596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Vector2, Vector } from './../math/Vector2';
import { EventDispatcher } from './../core/EventDispatcher';
import {
  Mapping,
  Wrapping,
  TextureFilter,
  PixelFormat,
  TextureDataType,
  TextureEncoding,
} from '../constants';

// Textures /////////////////////////////////////////////////////////////////////
export let TextureIdCount: number;

export class Texture extends EventDispatcher {
  constructor(
    image?: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement,
    mapping?: Mapping,
    wrapS?: Wrapping,
    wrapT?: Wrapping,
    magFilter?: TextureFilter,
    minFilter?: TextureFilter,
    format?: PixelFormat,
    type?: TextureDataType,
    anisotropy?: number,
    encoding?: TextureEncoding
  );

  id: number;
  uuid: string;
  name: string;
  sourceFile: string;
  image: any; // HTMLImageElement or ImageData or { width: number, height: number } in some children;
  mipmaps: ImageData[];
  mapping: Mapping;
  wrapS: Wrapping;
  wrapT: Wrapping;
  magFilter: TextureFilter;
  minFilter: TextureFilter;
  anisotropy: number;
  format: PixelFormat;
  type: TextureDataType;
  offset: Vector2;
  repeat: Vector2;
  center: Vector2;
  rotation: number;
  generateMipmaps: boolean;
  premultiplyAlpha: boolean;
  flipY: boolean;
  unpackAlignment: number;
  encoding: TextureEncoding;
  version: number;
  needsUpdate: boolean;
  onUpdate: () => void;
  static DEFAULT_IMAGE: any;
  static DEFAULT_MAPPING: any;

  clone(): this;
  copy(source: Texture): this;
  toJSON(meta: any): any;
  dispose(): void;
  transformUv(uv: Vector): void;
}