Mike Phares 6f22929136 IgnoreExtensions-nef
Config-LoadPhotoPrismLocations
TestMethodIntersect
2023-06-23 19:19:41 -07:00

122 lines
8.9 KiB
C#

using System.Drawing;
namespace View_by_Distance.Shared.Models.Stateless.Methods;
public interface ILocation
{ // ...
Models.Location? TestStatic_GetLocation(int height, Rectangle rectangle, int width) =>
GetLocation(height, rectangle, width);
static Models.Location? GetLocation(int height, Rectangle rectangle, int width) =>
Location.GetLocation(height, rectangle, width);
List<Models.Face> TestStatic_FilterByIntersect(Models.Face[] faces, float rectangleIntersectMinimum, int wholePercentages) =>
FilterByIntersect(faces, rectangleIntersectMinimum, wholePercentages);
static List<Models.Face> FilterByIntersect(Models.Face[] faces, float rectangleIntersectMinimum, int wholePercentages) =>
Location.FilterByIntersect(faces, rectangleIntersectMinimum, wholePercentages);
RectangleF? TestStatic_GetPercentagesRectangle(DatabaseFile databaseFile, Marker marker, Models.OutputResolution outputResolution) =>
GetPercentagesRectangle(databaseFile, marker, outputResolution);
static RectangleF? GetPercentagesRectangle(DatabaseFile databaseFile, Marker marker, Models.OutputResolution outputResolution) =>
Location.GetPercentagesRectangle(databaseFile, marker, outputResolution);
Models.Location? TestStatic_GetLocation(DatabaseFile databaseFile, Marker marker, Models.OutputResolution outputResolution) =>
GetLocation(databaseFile, marker, outputResolution);
static Models.Location? GetLocation(DatabaseFile databaseFile, Marker marker, Models.OutputResolution outputResolution) =>
Location.GetLocation(databaseFile, marker, outputResolution);
List<Models.Location> TestStatic_GetLocations<T>(List<LocationContainer<T>> locationContainers, List<Models.Face> faces, List<MappingFromPhotoPrism> mappingFromPhotoPrismCollection, float rectangleIntersectMinimum) =>
GetLocations(locationContainers, faces, mappingFromPhotoPrismCollection, rectangleIntersectMinimum);
static List<Models.Location> GetLocations<T>(List<LocationContainer<T>> locationContainers, List<Models.Face> faces, List<MappingFromPhotoPrism> mappingFromPhotoPrismCollection, float rectangleIntersectMinimum) =>
Location.GetLocations(locationContainers, faces, mappingFromPhotoPrismCollection, rectangleIntersectMinimum);
RectangleF? TestStatic_GetPercentagesRectangle(int locationDigits, int wholePercentages) =>
GetPercentagesRectangle(locationDigits, wholePercentages);
static RectangleF? GetPercentagesRectangle(int locationDigits, int wholePercentages) =>
Location.GetPercentagesRectangle(locationDigits, wholePercentages.ToString());
Rectangle? TestStatic_GetRectangle(int locationDigits, Models.OutputResolution outputResolution, int wholePercentages) =>
GetRectangle(locationDigits, outputResolution, wholePercentages);
static Rectangle? GetRectangle(int locationDigits, Models.OutputResolution outputResolution, int wholePercentages) =>
Location.GetRectangle(locationDigits, outputResolution, wholePercentages.ToString());
string TestStatic_GetLeftPadded(int locationDigits, string value) =>
GetLeftPadded(locationDigits, value);
static string GetLeftPadded(int locationDigits, string value) =>
Location.GetLeftPadded(locationDigits, value);
int TestStatic_GetConfidencePercent(int faceConfidencePercent, float[] rangeFaceConfidence, double confidence) =>
GetConfidencePercent(faceConfidencePercent, rangeFaceConfidence, confidence);
static int GetConfidencePercent(int faceConfidencePercent, float[] rangeFaceConfidence, double confidence) =>
Location.GetConfidencePercent(faceConfidencePercent, rangeFaceConfidence, confidence);
string TestStatic_GetLeftPadded(int locationDigits, int value) =>
GetLeftPadded(locationDigits, value);
static string GetLeftPadded(int locationDigits, int value) =>
GetLeftPadded(locationDigits, value.ToString());
Models.Location? TestStatic_GetLocation(Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
GetLocation(location, locationDigits, locationFactor, height, width, zCount);
static Models.Location? GetLocation(Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
location is null ? null : new(location.Confidence, height, location, locationDigits, locationFactor, width, zCount);
Models.Location? TestStatic_GetLocation(int factor, Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
GetLocation(factor, location, locationDigits, locationFactor, height, width, zCount);
static Models.Location? GetLocation(int factor, Models.Location? location, int locationDigits, int locationFactor, int height, int width, int zCount) =>
location is null ? null : new(location.Confidence, factor, height, location, locationDigits, locationFactor, width, zCount);
(decimal?, decimal?, decimal?, decimal?) TestStatic_GetHeightLeftTopWidth(int bottom, int height, int left, int right, int top, int width) =>
GetHeightLeftTopWidth(bottom, height, left, right, top, width);
static (decimal?, decimal?, decimal?, decimal?) GetHeightLeftTopWidth(int bottom, int height, int left, int right, int top, int width) =>
Location.GetHeightLeftTopWidth(bottom, height, left, right, top, width, zCount: 1);
(decimal?, decimal?, decimal?, decimal?) TestStatic_GetHeightLeftTopWidth(int height, int left, int top, int width) =>
GetHeightLeftTopWidth(height, left, top, width);
static (decimal?, decimal?, decimal?, decimal?) GetHeightLeftTopWidth(int height, int left, int top, int width) =>
Location.GetHeightLeftTopWidth(top + height, height, left, left + width, top, width, zCount: 1);
(decimal?, decimal?, decimal?, decimal?) TestStatic_GetHeightLeftTopWidth(Models.Location location, Models.OutputResolution outputResolution) =>
GetHeightLeftTopWidth(location, outputResolution);
static (decimal?, decimal?, decimal?, decimal?) GetHeightLeftTopWidth(Models.Location location, Models.OutputResolution outputResolution) =>
Location.GetHeightLeftTopWidth(location.Bottom, OutputResolution.Get(outputResolution).Height, location.Left, location.Right, location.Top, OutputResolution.Get(outputResolution).Width, zCount: 1);
int TestStatic_GetWholePercentages(Models.Location location, int locationDigits, Models.OutputResolution outputResolution) =>
GetWholePercentages(location, locationDigits, outputResolution);
static int GetWholePercentages(Models.Location location, int locationDigits, Models.OutputResolution outputResolution) =>
Location.GetWholePercentages(location.Bottom, OutputResolution.Get(outputResolution).Height, location.Left, locationDigits, location.Right, location.Top, OutputResolution.Get(outputResolution).Width, zCount: 1);
int TestStatic_GetWholePercentages(int locationDigits) =>
GetWholePercentages(locationDigits);
static int GetWholePercentages(int locationDigits) =>
Location.GetWholePercentages(1, 1, 0, locationDigits, 1, 0, 1, zCount: 1);
int TestStatic_GetWholePercentages(int height, Models.Location location, int locationDigits, int width) =>
GetWholePercentages(height, location, locationDigits, width);
static int GetWholePercentages(int height, Models.Location location, int locationDigits, int width) =>
Location.GetWholePercentages(height, location, locationDigits, width);
int TestStatic_GetWholePercentages(int bottom, int height, int left, int locationDigits, int right, int top, int width) =>
GetWholePercentages(bottom, height, left, locationDigits, right, top, width);
static int GetWholePercentages(int bottom, int height, int left, int locationDigits, int right, int top, int width) =>
Location.GetWholePercentages(bottom, height, left, locationDigits, right, top, width, zCount: 1);
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) =>
new(Math.Min(rectangle.Bottom, height),
detectionConfidence,
height,
Math.Max(rectangle.Left, 0),
Stateless.ILocation.Digits,
Stateless.ILocation.Factor,
Math.Min(rectangle.Right, width),
Math.Max(rectangle.Top, 0),
width,
facesCount);
float? TestStatic_GetIntersectPercent(RectangleF rectangleA, float? areaA, RectangleF rectangleB) =>
GetIntersectPercent(rectangleA, areaA, rectangleB);
static float? GetIntersectPercent(RectangleF rectangleA, float? areaA, RectangleF rectangleB) =>
Location.GetIntersectPercent(rectangleA, areaA, rectangleB);
}