export const MINIMUM_FACE_AREA_PERCENTAGE = 36;
export const MAXIMUM_FACE_AREA_PERCENTAGE = 85;
export const MOBILE_REAR_MINIMUM_FACE_AREA_PERCENTAGE = 13;
export const MOBILE_REAR_MAXIMUM_FACE_AREA_PERCENTAGE = 70;
export const DEFAULT_FACE_AREA_THRESHOLDS = {
    minimum: MINIMUM_FACE_AREA_PERCENTAGE,
    maximum: MAXIMUM_FACE_AREA_PERCENTAGE,
};
export const MOBILE_REAR_FACE_AREA_THRESHOLDS = {
    minimum: MOBILE_REAR_MINIMUM_FACE_AREA_PERCENTAGE,
    maximum: MOBILE_REAR_MAXIMUM_FACE_AREA_PERCENTAGE,
};
export function isFaceAreaOptimal(faceAreaPercentage, thresholds = DEFAULT_FACE_AREA_THRESHOLDS) {
    return faceAreaPercentage > thresholds.minimum &&
        faceAreaPercentage <= thresholds.maximum;
}
// With cover, the video is scaled to fill the container while maintaining aspect ratio — excess is cropped.
export function calculateCoverDimensions(videoWidth, videoHeight, containerWidth, containerHeight) {
    if (videoWidth <= 0 || videoHeight <= 0 || containerWidth <= 0 || containerHeight <= 0) {
        return { renderedWidth: 0, renderedHeight: 0, offsetX: 0, offsetY: 0 };
    }
    const videoAspectRatio = videoWidth / videoHeight;
    const containerAspectRatio = containerWidth / containerHeight;
    let renderedWidth;
    let renderedHeight;
    if (videoAspectRatio > containerAspectRatio) {
        renderedHeight = containerHeight;
        renderedWidth = containerHeight * videoAspectRatio;
    }
    else {
        renderedWidth = containerWidth;
        renderedHeight = containerWidth / videoAspectRatio;
    }
    const offsetX = (containerWidth - renderedWidth) / 2;
    const offsetY = (containerHeight - renderedHeight) / 2;
    return { renderedWidth, renderedHeight, offsetX, offsetY };
}
//# sourceMappingURL=faceAreaUtils.js.map
