UNPKG

@nuralogix.ai/anura-web-core-sdk

Version:

Anura Web Core SDK

169 lines (156 loc) 4.14 kB
/** * The objectFit sets how the content of an element should be resized to fit its container. * * `contain`: * * The content is scaled to maintain its aspect ratio while fitting within the element's * content box. The entire object is made to fill the box, while preserving its aspect ratio, * so the object will be "letterboxed" or "pillarboxed" if its aspect ratio does not match the * aspect ratio of the box. * * `cover`: * * The content is sized to maintain its aspect ratio while filling the element's entire * content box. If the object's aspect ratio does not match the aspect ratio of its box, then * the object will be clipped to fit. * * `none`: * * The content is not resized. * @enum */ declare const objectFit: { readonly CONTAIN: "contain"; readonly COVER: "cover"; readonly NONE: "none"; }; type ObjectFit = typeof objectFit[keyof typeof objectFit]; interface VideoElementSize { width: number; height: number; offsetX: number; offsetY: number; } interface Centroids { [id: string]: {x: number, y: number }; } interface MeshAnnotation { x: number; y: number; z: number | undefined; } interface Annotations { silhouette: MeshAnnotation[], centroids: Centroids; } interface PosePoints { [x: string]: { point: number[], valid: boolean; estimated: boolean; quality: number; } } interface DfxRect { x: number; y: number; width: number; height: number; } interface DfxFace { detected: boolean; id: string; poseValid: boolean; posePoints: PosePoints, faceRect: DfxRect; } declare const pointGroup: { readonly METADATA: "metadata"; readonly PHYSICAL: "physical"; readonly GENERAL_RISKS: "generalRisks"; readonly VITALS: "vitals"; readonly PHYSIOLOGICAL: "physiological"; readonly METABOLIC_RISKS: "metabolicRisks"; readonly BLOOD_BIOMARKERS: "bloodBiomarkers"; readonly OVERALL: "overall"; readonly MENTAL: "mental"; readonly SURVEYS: "surveys"; }; type PointGroupType = typeof pointGroup[keyof typeof pointGroup]; interface IMeta { availableAfterSec: number; range: { min: number; max: number; }; requirements: { profileInfo: boolean; medicalHistory: boolean; }; group: PointGroupType; ranges: { [x: string]: number[][][]; }; } interface Point { channel: string; notes: string[]; value: string; meta: IMeta; info: { name: string; description: string; unit: string; }; } interface Points { [x: string]: Point; } interface Drawables { face: DfxFace; annotations: Annotations; starRating: number; } interface IMask { version: string; objectFit: ObjectFit; getSvg(): SVGSVGElement; resize(resizeInfo: IMaskResize): void; draw({ face, annotations, starRating }: Drawables): void; setMaskVisibility(isVisible: boolean): void; } interface IMediaElementSize { width: number; height: number; x: number; y: number; } interface IFrameInfo { mediaStreamWidth: number; mediaStreamHeight: number; faceTrackerWidth: number; faceTrackerHeight: number; } interface IMaskResize { mediaElementSize: IMediaElementSize; videoElementSize: VideoElementSize; frameInfo: IFrameInfo; } interface IVitalMask extends IMask { setFacialLandmarksVisibility(isVisible: boolean): void; setIntermediateResults(points: Points): void; } declare class VitalMask implements IVitalMask { #private; version: string; objectFit: ObjectFit; constructor(); getSvg(): SVGSVGElement; draw({ face, annotations, starRating }: Drawables): void; getInterPupillaryDistance(annotations: Annotations, face: DfxFace): number; setFacialLandmarksVisibility(isVisible: boolean): void; setIntermediateResults(points: Points): void; setMaskVisibility(isVisible: boolean): void; resize(resizeInfo: IMaskResize): void; } export { type IVitalMask, type ObjectFit, VitalMask, objectFit };