import { MAG_FILTER, MIN_FILTER, TEXTURE_WRAP } from './constants/GLConstants'; export declare class GLTexture { protected gl: WebGL2RenderingContext; protected _textureID: number; protected _texture: WebGLTexture; protected mipmap: boolean; protected miplevel: number; protected _premultiplyAlpha: boolean; protected _width: number; protected _height: number; protected format: number; protected internalformat: number; protected type: number; constructor(gl: WebGL2RenderingContext, textureID?: number, width?: number, height?: number, internalformat?: number, format?: number, type?: number); /** * Uploads this texture to the GPU * @param source {HTMLImageElement|ImageData|HTMLVideoElement} */ upload(source: HTMLImageElement | ImageData | HTMLVideoElement): void; /** * Use a data source and uploads this texture to the GPU * @param data {TypedArray} data to upload to the texture * @param width {number} new width of the texture * @param height {number} new height of the texture */ uploadData(data: Float32Array, width: number, height: number): void; /** * Binds the texture * @param location */ bind(location?: number): GLTexture; unbind(location?: number): GLTexture; /** * @param linear {boolean} if we want to use linear filtering or nearest neighbour interpolation */ minFilter(linear: boolean): void; setMinFilter(filter: MIN_FILTER): void; /** * @param linear {boolean} if we want to use linear or nearest neighbour interpolation */ magFilter(linear: boolean): void; setMagFilter(filter: MAG_FILTER): void; /** * Enables mipmapping */ enableMipmap(): void; /** * Enables linear filtering */ enableLinearScaling(): void; /** * Enabled nearest neighbour interpolation */ enableNearestScaling(): void; /** * Enables clamping on the texture wo WebGL will not repeat it */ enableWrapClamp(): void; /** * Enable tiling on the texture */ enableWrapRepeat(): void; enableWrapMirrorRepeat(): void; setWrapS(mode: TEXTURE_WRAP): void; setWrapT(mode: TEXTURE_WRAP): void; flipY(flip: number): void; /** * Destroys this texture */ destroy(): void; static isPowerOf2(value: number): boolean; static nextHighestPowerOfTwo(x: number): number; textureID: number; texture: WebGLTexture; premultiplyAlpha: boolean; readonly width: number; readonly height: number; /** * * @param gl {WebGL2RenderingContext} the current webgl context * @param source {HTMLImageElement|ImageData} the source image of the texture * @param premultiplyAlpha {Boolean} If we want to use pre-multiplied alpha * @param textureID {number} textureID to use multiple textures in a shader * @param internalformat {number} optional interal format RGBA8,RGB16 etc. * @param format {number} optional the Format to use for the texture RGBA etc. * @param type {number} texture type GL_FLOAT etc * @returns {GLTexture} */ static fromSource(gl: WebGL2RenderingContext, source: HTMLImageElement | ImageData, premultiplyAlpha?: boolean, textureID?: number, internalformat?: number, format?: number, type?: number): GLTexture; /** * @param {WebGL2RenderingContext} gl - webgl context * @param {Float32Array} data - data for the texture * @param {number} width - width of the texture * @param {number} height - height of the texture * @param {number} textureID - textureID * @param {number} internalformat - optional format to use RGBA,RGB etc. * @param {number} format - optional format to use RGBA,RGB etc. * @param {number} type - data type default: UNSIGNED_BYTE * @param {boolean} premultiplyAlpha - If we want to use pre-multiplied alpha * @returns {GLTexture} */ static fromData(gl: WebGL2RenderingContext, data: Float32Array, width: number, height: number, textureID?: number, internalformat?: number, format?: number, type?: number, premultiplyAlpha?: boolean): GLTexture; }