API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classPixelRead

@codexo/exojs / rendering / stable

One read handed out by PixelReader.request: poll it from the frame loop, take its pixels once ready, then release it. A read is never ready in the frame that requested it. It becomes ready a frame or more later, or failed if the device was lost, the source was resized or the reader destroyed underneath it. Both are terminal, and `release()` is the caller's job in either case. Handles are pooled per slot: after `release()` the same object is handed out again by a later request, so keep no reference past the release.

3
props
1
methods
0
events
Import
import { PixelRead } from '@codexo/exojs'

One read handed out by PixelReader.request: poll it from the frame loop, take its pixels once ready, then release it.

A read is never ready in the frame that requested it. It becomes ready a frame or more later, or failed if the device was lost, the source was resized or the reader destroyed underneath it. Both are terminal, and `release()` is the caller's job in either case.

Handles are pooled per slot: after `release()` the same object is handed out again by a later request, so keep no reference past the release.

Methods1
release(): void
Return the slot to the reader. A pending read is abandoned. Safe to call more than once.
Properties3
The pixels, laid out as ImageData wants them, or null until ready. The array belongs to the slot and stays valid until release; after that a later read overwrites it. Copy it out to keep it longer.
failed: boolean
Whether the read can no longer complete. Terminal; release it.
ready: boolean
Whether the pixels have landed and data is valid.
Source