import { WebVisualContainer } from "./web-visual-container.js"; import { CameraFacingMode, CameraFrame, ICamera } from "../../interfaces/verification-system-interfaces.js"; /** * Camera device info with facing mode detection */ export interface CameraDeviceInfo { /** * Device ID */ deviceId: string; /** * Device label */ label: string; /** * Detected facing mode ('user' or 'environment') */ facingMode: CameraFacingMode; /** * Resolution width */ width?: number; /** * Resolution height */ height?: number; /** * Computed score for camera selection */ score?: number; } /** * Web platform implementation of the camera */ export declare class WebCamera implements ICamera { private static readonly DEFAULT_RESOLUTION; facingMode: CameraFacingMode; private videoElement; private containerElement; private roiContainer; private canvas; private mediaStream; private actualStreamWidth; private actualStreamHeight; private active; private cameraIndex; private currentCamera; private hasLoggedCapture; private frameProcessingResolution; private cachedFrame; private frameRequested; private videoFrameCallbackHandle; private frameProcessorWorker; private isProcessing; private orientationChangeHandler; private imageCaptureCache; /** * Create a new web camera instance * @param container * @param roiContainer */ constructor(container: WebVisualContainer, roiContainer?: WebVisualContainer | null); /** * Switch to the next camera */ canSwitchCamera(): Promise; /** * Clean up resources */ dispose(): void; /** * Capture and return the current frame * Pattern: null (request frame) -> frame (request frame) -> frame -> frame... * The actual capture happens in the video frame callback */ getFrame(): Promise; /** * Video frame callback - called once when frame is requested * Creates ImageBitmap and sends to worker, does NOT re-schedule itself */ private onVideoFrame; /** * Capture and return the current frame as a JPEG-encoded Blob at sensor resolution */ getHighResolutionFrameAsEncodedBlob(resolution?: number): Promise; /** * Capture and return the current frame as raw RGBA pixels at sensor resolution. * Skips the JPEG encode of the blob variant — the SDK submits the pixels directly. */ getHighResolutionFrameAsRawImage(resolution?: number): Promise; private getImageCaptureWithCapabilities; /** * Capture the current frame cropped to the visible ROI into a canvas. * Tries ImageCapture API first (Android), falls back to a second high-res stream (iOS path). */ private captureHighResolutionFrameToCanvas; /** * Get the video element (if available) */ getVideoElement(): HTMLVideoElement | null; init(): Promise; /** * Check if camera is currently active */ isActive(): boolean; /** * Start the camera */ start(facingMode?: CameraFacingMode, resolution?: number): Promise; /** * Stop the camera */ stop(): Promise; /** * Sends the name of the opened camera to the core, which puts it into the sample signature. * Not awaited and never throws, so it cannot delay or break the capture. */ private reportCameraName; /** * Switch to the next camera */ switchCamera(): Promise; setTorch(on: boolean): Promise; private static getMediaStream; private isMirrored; private static isIOS; private buildVideoConstraints; private setupOrientationListener; private removeOrientationListener; /** * Calculate the crop region (insets) based on container and ROI */ private calculateCropRegion; /** * Prepare crop and scale parameters for frame capture * Calculates both the crop region and the target dimensions after scaling */ private prepareCropAndScaleParams; /** * Draw cropped and optionally mirrored frame from video/image to canvas */ private drawCroppedAndMirroredFrame; } //# sourceMappingURL=web-camera.d.ts.map