Skip to content

@ralphschuler.webgl shader factory.<internal>.OffscreenCanvas

github-actions edited this page Nov 26, 2023 · 1 revision

Interface: OffscreenCanvas

@ralphschuler/webgl-shader-factory.<internal>.OffscreenCanvas

MDN Reference

Hierarchy

  • EventTarget

    OffscreenCanvas

Table of contents

Properties

Methods

Properties

height

height: number

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16582


oncontextlost

oncontextlost: null | (this: OffscreenCanvas, ev: Event) => any

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16583


oncontextrestored

oncontextrestored: null | (this: OffscreenCanvas, ev: Event) => any

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16584


width

width: number

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).

MDN Reference

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16592

Methods

addEventListener

addEventListener<K>(type, listener, options?): void

Type parameters

Name Type
K extends keyof OffscreenCanvasEventMap

Parameters

Name Type
type K
listener (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any
options? boolean | AddEventListenerOptions

Returns

void

Overrides

EventTarget.addEventListener

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16621

addEventListener(type, listener, options?): void

Parameters

Name Type
type string
listener EventListenerOrEventListenerObject
options? boolean | AddEventListenerOptions

Returns

void

Overrides

EventTarget.addEventListener

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16622


convertToBlob

convertToBlob(options?): Promise<Blob>

Returns a promise that will fulfill with a new Blob object representing a file containing the image in the OffscreenCanvas object.

The argument, if provided, is a dictionary that controls the encoding options of the image file to be created. The type field specifies the file format and has a default value of "image/png"; that type is also used if the requested type isn't supported. If the image format supports variable quality (such as "image/jpeg"), then the quality field is a number in the range 0.0 to 1.0 inclusive indicating the desired quality level for the resulting image.

MDN Reference

Parameters

Name Type
options? ImageEncodeOptions

Returns

Promise<Blob>

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16600


dispatchEvent

dispatchEvent(event): boolean

Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

MDN Reference

Parameters

Name Type
event Event

Returns

boolean

Inherited from

EventTarget.dispatchEvent

Defined in

node_modules/typescript/lib/lib.dom.d.ts:8217


getContext

getContext(contextId, options?): null | OffscreenCanvasRenderingContext2D

Returns an object that exposes an API for drawing on the OffscreenCanvas object. contextId specifies the desired API: "2d", "bitmaprenderer", "webgl", or "webgl2". options is handled by that API.

This specification defines the "2d" context below, which is similar but distinct from the "2d" context that is created from a canvas element. The WebGL specifications define the "webgl" and "webgl2" contexts. [WEBGL]

Returns null if the canvas has already been initialized with another context type (e.g., trying to get a "2d" context after getting a "webgl" context).

MDN Reference

Parameters

Name Type
contextId "2d"
options? any

Returns

null | OffscreenCanvasRenderingContext2D

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16610

getContext(contextId, options?): null | ImageBitmapRenderingContext

Parameters

Name Type
contextId "bitmaprenderer"
options? any

Returns

null | ImageBitmapRenderingContext

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16611

getContext(contextId, options?): null | WebGLRenderingContext

Parameters

Name Type
contextId "webgl"
options? any

Returns

null | WebGLRenderingContext

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16612

getContext(contextId, options?): null | WebGL2RenderingContext

Parameters

Name Type
contextId "webgl2"
options? any

Returns

null | WebGL2RenderingContext

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16613

getContext(contextId, options?): null | OffscreenRenderingContext

Parameters

Name Type
contextId OffscreenRenderingContextId
options? any

Returns

null | OffscreenRenderingContext

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16614


removeEventListener

removeEventListener<K>(type, listener, options?): void

Type parameters

Name Type
K extends keyof OffscreenCanvasEventMap

Parameters

Name Type
type K
listener (this: OffscreenCanvas, ev: OffscreenCanvasEventMap[K]) => any
options? boolean | EventListenerOptions

Returns

void

Overrides

EventTarget.removeEventListener

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16623

removeEventListener(type, listener, options?): void

Parameters

Name Type
type string
listener EventListenerOrEventListenerObject
options? boolean | EventListenerOptions

Returns

void

Overrides

EventTarget.removeEventListener

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16624


transferToImageBitmap

transferToImageBitmap(): ImageBitmap

Returns a newly created ImageBitmap object with the image in the OffscreenCanvas object. The image in the OffscreenCanvas object is replaced with a new blank image.

MDN Reference

Returns

ImageBitmap

Defined in

node_modules/typescript/lib/lib.dom.d.ts:16620

Typescript Libraries

Modules

Namespaces

Clone this wiki locally