Files
aa/Shared/Models/Stateless/ILocation.cs
2025-07-20 08:31:03 -07:00

20 lines
839 B
C#

using System.Drawing;
namespace Phares.Shared.Models.Stateless;
public interface ILocation
{
Models.Location TestStatic_GetTrimBound(double detectionConfidence, Rectangle rectangle, int width, int height, int facesCount) =>
TrimBound(detectionConfidence, rectangle, width, height, facesCount);
static Models.Location TrimBound(double detectionConfidence, Rectangle rectangle, int width, int height, int facesCount) =>
Models.Location.Get(Math.Min(rectangle.Bottom, height),
detectionConfidence,
height,
Math.Max(rectangle.Left, 0),
Math.Min(rectangle.Right, width),
Math.Max(rectangle.Top, 0),
width,
facesCount);
}