Constructs an instance of the RxPhoto class.
Configuration options for the photo handler.
Attaches this RxPhoto instance to a FrameMsg object to receive photo data. It initializes the photo data queue and registers a handler for incoming data chunks.
The FrameMsg instance to attach to.
A Promise that resolves to the AsyncQueue where complete photo data (Uint8Array) will be placed.
Detaches this RxPhoto instance from a FrameMsg object. It unregisters the data handler and clears the photo data queue and any pending chunks.
The FrameMsg instance to detach from.
Handles incoming raw photo data chunks.
This method is typically called by a FrameMsg instance when new photo data is received.
It accumulates chunks and, upon receiving the final chunk, processes the complete image.
The processed image (as a Uint8Array) is then placed onto the queue.
A Uint8Array containing the raw photo data chunk, prefixed with a msgCode byte.
Rotates a JPEG image 90 degrees counter-clockwise using an offscreen canvas.
The input JPEG image as a Uint8Array.
the rotated JPEG image as a Uint8Array.
StatichasChecks if a JPEG header is cached for the given quality and resolution.
The JPEG quality.
The photo resolution.
True if a header is cached, false otherwise.
RxPhoto class handles JPEG image data streaming and processing. It can process JPEG images with or without a header ("raw" mode), although at least one compatible JPEG header must be cached before using raw mode. It can also rotate images 90 degrees counter-clockwise to upright (default behavior). Different JPEG qualities and resolutions can be specified.