AbstractThe height of this render target in pixels.
The width of this render target in pixels.
Bind this render target as the active draw destination. All subsequent draw calls will render into this target until unbind is called. No-op by default — subclasses override for GPU render targets (e.g. WebGL FBOs).
AbstractclearClear the render target contents.
AbstractdestroyRelease all resources held by this render target. The target must not be used after calling destroy.
AbstractgetRead back pixel data from this render target.
Optionalx: numberx coordinate of the top-left corner (default 0)
Optionaly: numbery coordinate of the top-left corner (default 0)
Optionalwidth: numberwidth of the area to read (default full width)
Optionalheight: numberheight of the area to read (default full height)
an ImageData object containing the pixel data
AbstractresizeResize the render target's backing storage to the given dimensions.
new width in pixels
new height in pixels
Creates a Blob object representing the image contained in this render target.
a string indicating the image format (default "image/png")
Optionalquality: numbera number between 0 and 1 for lossy formats (e.g. image/jpeg)
a Promise resolving to a Blob
Returns a data URL containing a representation of the current contents.
a string indicating the image format (default "image/png")
Optionalquality: numbera number between 0 and 1 for lossy formats (e.g. image/jpeg)
a Promise resolving to a data URL string
Creates an ImageBitmap object from the current contents of this render target.
a Promise resolving to an ImageBitmap
Unbind this render target, restoring the default (screen) output. No-op by default — subclasses override for GPU render targets.
Abstract base class for offscreen render targets. Provides a renderer-agnostic interface for binding, clearing, resizing, and reading back pixel data from an offscreen surface. Concrete implementations:
A future WebGPU implementation would extend this class with GPUTexture / GPURenderPassDescriptor management.