/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ import type { Keypoint } from '@tensorflow-models/hand-pose-detection'; /** * MediaPipe Hands connections between the 21 keypoints. * Each tuple is [startIdx, endIdx]. * * Keypoint indices: * 0 = wrist * 1-4 = thumb (cmc, mcp, ip, tip) * 5-8 = index finger (mcp, pip, dip, tip) * 9-12 = middle finger (mcp, pip, dip, tip) * 13-16 = ring finger (mcp, pip, dip, tip) * 17-20 = pinky (mcp, pip, dip, tip) */ export declare const HAND_CONNECTIONS: [number, number][]; /** * Draw a single keypoint dot on the canvas. */ export declare function drawHandPoint(ctx: CanvasRenderingContext2D, x: number, y: number, radius?: number, fillColor?: string, strokeColor?: string): void; /** * Draw all 21 hand keypoints onto a canvas. * @param keypoints Array of 21 keypoints from hand-pose-detection * @param ctx Canvas 2D rendering context * @param minScore Minimum score to render a keypoint (defaults to 0) * @param scale Optional scale factor for coordinates */ export declare function drawHandKeypoints(keypoints: Keypoint[], ctx: CanvasRenderingContext2D, minScore?: number, keypointSize?: number, fillColor?: string, strokeColor?: string, scale?: number, autoSize?: boolean): void; /** * Draw the hand skeleton (connections between keypoints) onto a canvas. * @param keypoints Array of 21 keypoints from hand-pose-detection * @param ctx Canvas 2D rendering context * @param scale Optional scale factor for coordinates */ export declare function drawHandSkeleton(keypoints: Keypoint[], ctx: CanvasRenderingContext2D, lineWidth?: number, strokeColor?: string, scale?: number): void;