Preparing search index...

    Class FrameExposes User Data

    Camera frame data delivered via CameraModule.StreamingSession#onNewFrame, or returned by CameraModule.CaptureSession#capture.

    Contains the captured image as both raw bytes (CameraModule.Frame#imageData) and a GPU texture (CameraModule.Frame#texture). Use raw bytes for efficient ML/LLM pipelines (no GPU round-trip). Use texture for display, ML components, or RemoteMediaModule.

    session.onNewFrame.add((frame) => {
    // Display (CameraModule compatible):
    mesh.mainPass.baseTex = frame.texture;

    // ML/LLM (efficient, no GPU round-trip):
    let base64 = Base64.encode(frame.imageData);

    // Metadata:
    let iso = frame.getMetadata(CameraModule.MetadataKey.Iso);
    });

    Hierarchy (View Summary)

    Index

    Properties

    height: number

    Image height in pixels.

    imageData: Uint8Array

    Raw image bytes (JPEG compressed or packed YUV). For JPEG: contains the raw JPEG file bytes. For YUV: packed Y plane (wh) followed by UV data (wh/2), no stride padding. Use with Base64.encode() for ML/LLM APIs.

    Lazily materialized: the underlying bytes are owned by the Frame, but the JS-visible TypedArray is allocated on first access. Reading imageData on every streaming frame is therefore safe — no allocation occurs unless you actually read it. Treat the array as read-only: writes mutate the Frame's shared buffer and corrupt later reads of the same frame (including CameraModule.Frame#texture created after the write).

    texture: Texture

    GPU texture of the frame image (RGBA for color/IR, single-channel for grayscale). Lazily materialized on first access — neural-net consumers that only read imageData pay no upload cost.

    For frames delivered by a CameraModule.StreamingSession, the underlying GPU texture is reused across frames in the same session (the pixel buffer is updated in place). Hold the result only long enough to read or render the current frame; if you need to keep a historical frame's pixels around, copy them into a separate Texture before the next onNewFrame fires.

    width: number

    Image width in pixels.

    Methods

    • Exposes User Data

      Get a frame metadata value by key.

      Parameters

      • key: MetadataKey

        Metadata key (e.g. CameraModule.MetadataKey.Iso).

      Returns number

      The metadata value, or undefined if the key is not available for this frame.

    • Exposes User Data

      Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean