"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7555/react/features/face-landmarks/actions.ts" (28 Sep 2023, 1230 Bytes) of package /linux/misc/jitsi-meet-7555.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import 'image-capture';
    2 import './createImageBitmap';
    3 import { AnyAction } from 'redux';
    4 
    5 import {
    6     ADD_FACE_LANDMARKS,
    7     CLEAR_FACE_LANDMARKS_BUFFER,
    8     NEW_FACE_COORDINATES
    9 } from './actionTypes';
   10 import { FaceBox, FaceLandmarks } from './types';
   11 
   12 /**
   13  * Adds new face landmarks to the timeline.
   14  *
   15  * @param {FaceLandmarks} faceLandmarks - The new face landmarks to timeline.
   16  * @param {boolean} addToBuffer - If true adds the face landmarks to a buffer in the reducer for webhook.
   17  * @returns {AnyAction}
   18  */
   19 export function addFaceLandmarks(faceLandmarks: FaceLandmarks, addToBuffer: boolean): AnyAction {
   20     return {
   21         type: ADD_FACE_LANDMARKS,
   22         faceLandmarks,
   23         addToBuffer
   24     };
   25 }
   26 
   27 /**
   28  * Clears the face landmarks array in the state.
   29  *
   30  * @returns {AnyAction}
   31  */
   32 export function clearFaceExpressionBuffer(): AnyAction {
   33     return {
   34         type: CLEAR_FACE_LANDMARKS_BUFFER
   35     };
   36 }
   37 
   38 /**
   39  * Signals that a new face box was obtained for the local participant.
   40  *
   41  * @param {FaceBox} faceBox - The face box of the local participant.
   42  * @returns {AnyAction}
   43  */
   44 export function newFaceBox(faceBox: FaceBox): AnyAction {
   45     return {
   46         type: NEW_FACE_COORDINATES,
   47         faceBox
   48     };
   49 }