Skip to content

Class: BitmapTexture2D

bitmap texture

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new BitmapTexture2D(useMipmap?)

Parameters

NameTypeDefault valueDescription
useMipmapbooleantrueSet whether to use mipmap

Overrides

Texture.constructor

Defined in

src/textures/BitmapTexture2D.ts:18

Properties

name

name: string

name of texture

Inherited from

Texture.name

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:14


url

url: string

source url

Inherited from

Texture.url

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:19


pid

pid: number

Return index in texture array

Inherited from

Texture.pid

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:29


view

view: GPUTextureView

GPUTextureView

Inherited from

Texture.view

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:34


gpuSampler

gpuSampler: GPUSampler

GPUSampler

Inherited from

Texture.gpuSampler

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:39


gpuSampler_comparison

gpuSampler_comparison: GPUSampler

GPUSampler for comparison

Inherited from

Texture.gpuSampler_comparison

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:44


format

format: GPUTextureFormat

GPUTextureFormat

Inherited from

Texture.format

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:49


usage

usage: number

GPUTextureUsage

Inherited from

Texture.usage

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:54


width

width: number = 4

texture width

Inherited from

Texture.width

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:59


height

height: number = 4

texture height

Inherited from

Texture.height

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:64


depthOrArrayLayers

depthOrArrayLayers: number = 1

depth or layers, default value is 1

Inherited from

Texture.depthOrArrayLayers

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:69


numberLayer

numberLayer: number = 1

depth or layers, default value is 1

Inherited from

Texture.numberLayer

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:74


viewDescriptor

viewDescriptor: GPUTextureViewDescriptor

GPUTextureViewDescriptor

Inherited from

Texture.viewDescriptor

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:79


textureDescriptor

textureDescriptor: GPUTextureDescriptor

GPUTextureDescriptor

Inherited from

Texture.textureDescriptor

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:84


visibility

visibility: number

GPUShaderStage

Inherited from

Texture.visibility

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:89


textureBindingLayout

textureBindingLayout: GPUTextureBindingLayout

GPUTextureBindingLayout, contains viewDimension and multisampled

Inherited from

Texture.textureBindingLayout

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:95


samplerBindingLayout

samplerBindingLayout: GPUSamplerBindingLayout

GPUSamplerBindingLayout

Inherited from

Texture.samplerBindingLayout

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:103


sampler_comparisonBindingLayout

sampler_comparisonBindingLayout: GPUSamplerBindingLayout

GPUSamplerBindingLayout

Inherited from

Texture.sampler_comparisonBindingLayout

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:110


flipY

flipY: boolean

whether to flip the image on the y-axis

Inherited from

Texture.flipY

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:117


isVideoTexture

Optional isVideoTexture: boolean

whether is video texture

Inherited from

Texture.isVideoTexture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:122


isHDRTexture

Optional isHDRTexture: boolean

Inherited from

Texture.isHDRTexture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:123


mipmapCount

mipmapCount: number = 1

mipmap Count, default value is 1

Inherited from

Texture.mipmapCount

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:190

Accessors

useMipmap

get useMipmap(): boolean

enable/disable mipmap

Returns

boolean

Inherited from

Texture.useMipmap

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:309

set useMipmap(value): void

get mipmap

Parameters

NameType
valueboolean

Returns

void

Inherited from

Texture.useMipmap

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:316


sourceImageData

get sourceImageData(): HTMLCanvasElement | ImageBitmap | OffscreenCanvas

Returns

HTMLCanvasElement | ImageBitmap | OffscreenCanvas

Inherited from

Texture.sourceImageData

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:347


addressModeU

get addressModeU(): GPUAddressMode

Returns

GPUAddressMode

Inherited from

Texture.addressModeU

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:425

set addressModeU(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Inherited from

Texture.addressModeU

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:429


addressModeV

get addressModeV(): GPUAddressMode

Returns

GPUAddressMode

Inherited from

Texture.addressModeV

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:436

set addressModeV(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Inherited from

Texture.addressModeV

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:440


addressModeW

get addressModeW(): GPUAddressMode

Returns

GPUAddressMode

Inherited from

Texture.addressModeW

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:447

set addressModeW(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Inherited from

Texture.addressModeW

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:451


magFilter

get magFilter(): GPUFilterMode

Returns

GPUFilterMode

Inherited from

Texture.magFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:458

set magFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Inherited from

Texture.magFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:462


minFilter

get minFilter(): GPUFilterMode

Returns

GPUFilterMode

Inherited from

Texture.minFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:469

set minFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Inherited from

Texture.minFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:473


mipmapFilter

get mipmapFilter(): GPUMipmapFilterMode

Returns

GPUMipmapFilterMode

Inherited from

Texture.mipmapFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:480

set mipmapFilter(value): void

Parameters

NameType
valueGPUMipmapFilterMode

Returns

void

Inherited from

Texture.mipmapFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:484


lodMinClamp

get lodMinClamp(): number

Returns

number

Inherited from

Texture.lodMinClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:491

set lodMinClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

Texture.lodMinClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:495


lodMaxClamp

get lodMaxClamp(): number

Returns

number

Inherited from

Texture.lodMaxClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:502

set lodMaxClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

Texture.lodMaxClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:506


compare

get compare(): GPUCompareFunction

Returns

GPUCompareFunction

Inherited from

Texture.compare

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:513

set compare(value): void

Parameters

NameType
valueGPUCompareFunction

Returns

void

Inherited from

Texture.compare

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:517


maxAnisotropy

get maxAnisotropy(): number

Returns

number

Inherited from

Texture.maxAnisotropy

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:524

set maxAnisotropy(value): void

Parameters

NameType
valuenumber

Returns

void

Inherited from

Texture.maxAnisotropy

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:528


source

get source(): HTMLCanvasElement | ImageBitmap | OffscreenCanvas | HTMLImageElement

get raw data of this texture

Returns

HTMLCanvasElement | ImageBitmap | OffscreenCanvas | HTMLImageElement

Defined in

src/textures/BitmapTexture2D.ts:27

set source(value): void

set raw data of this texture

Parameters

NameType
valueHTMLCanvasElement | ImageBitmap | OffscreenCanvas | HTMLImageElement

Returns

void

Defined in

src/textures/BitmapTexture2D.ts:34

Methods

init

init(): BitmapTexture2D

Returns

BitmapTexture2D

Inherited from

Texture.init

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:214


getGPUTexture

getGPUTexture(): GPUTexture

create or get GPUTexture

Returns

GPUTexture

GPUTexture

Inherited from

Texture.getGPUTexture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:371


getGPUView

getGPUView(index?): GPUTextureView | GPUExternalTexture

create or get GPUTextureView

Parameters

NameTypeDefault value
indexnumber0

Returns

GPUTextureView | GPUExternalTexture

GPUTextureView | GPUExternalTexture

Inherited from

Texture.getGPUView

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:382


bindStateChange

bindStateChange(fun, ref): void

Parameters

NameType
funFunction
refany

Returns

void

Inherited from

Texture.bindStateChange

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:395


unBindStateChange

unBindStateChange(ref): void

Parameters

NameType
refany

Returns

void

Inherited from

Texture.unBindStateChange

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:399


destroy

destroy(force?): void

release the texture

Parameters

NameType
force?boolean

Returns

void

Inherited from

Texture.destroy

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:413


load

load(url, loaderFunctions?): Promise<boolean>

load texture data from web url

Parameters

NameTypeDescription
urlstringweb url
loaderFunctions?LoaderFunctionscallback function when load complete

Returns

Promise<boolean>

Defined in

src/textures/BitmapTexture2D.ts:57


loadFromBlob

loadFromBlob(imgData): Promise<boolean>

load data from Blob

Parameters

NameTypeDescription
imgDataBlobblob data which contains image

Returns

Promise<boolean>

Defined in

src/textures/BitmapTexture2D.ts:97