CameraFrameSinkOptions
Extends
Type Parameters
F
F extends FrameLike = FrameLike
Properties
format?
optional format?: (frame: F) => PixelFormat;Map the producer's pixelFormat to the one tgfx imports with. A worklet -
it runs on the frame thread.
The default reads the string: rgb/rgba/bgra import as 'rgba',
709/2020 pick that matrix, anything else is BT.601, and a -full
suffix selects the full-range variant. Override it for a producer that
names its formats differently, or to pin one.
Parameters
frame
F
Returns
Inherited from
onEachFrame?
optional onEachFrame?: (frame: F) => void;Your own per-frame worklet - a detector, say. Runs inside the same try.
Parameters
frame
F
Returns
void
onImage?
optional onImage?: (image: TgfxImage) => void;Called on the JS thread when the handle mints.
Parameters
image
TgfxImage
Returns
void
onPosture?
optional onPosture?: (posture: CameraFramePosture) => void;Called on the JS thread when the posture changes.
Parameters
posture
Returns
void
rotation?
optional rotation?: (frame: F) => number;Map the producer's orientation to the clockwise degrees that cancel it.
A worklet. The default understands 'up' | 'right' | 'down' | 'left';
anything else is 0, which draws the frame unrotated.
Parameters
frame
F
Returns
number