Files
.vscode
Compare
Date-Group
Delete-By-Distinct
Delete-By-Relative
Distance
Drag-Drop
Duplicate-Search
Face
FaceParts
FaceRecognitionDotNet
Instance
Map
Metadata
Not-Copy-Copy
PhotoPrism
PrepareForOld
Property
Property-Compare
Resize
Shared
.vscode
Models
Methods
Properties
Stateless
Methods
%ClassName%.cs .ai
Age.cs
Container.cs
DistanceHolder.cs
Face.cs
FaceDistance.cs
FaceDistanceContainer.cs
FaceFileSystem.cs
FacePoint.cs
FileHolder.cs
FileSystem.cs
I%ClassName%.cs .ai
IAge.cs
IBackgroundPage.cs
IContainer.cs
IDirectoryFileSystem.cs
IDistanceHolder.cs
IFace.cs
IFaceDistance.cs
IFaceDistanceContainer.cs
IFaceFileSystem.cs
IFacePoint.cs
IFileHolder.cs
IFileSystem.cs
IIndex.cs
IItem.cs
ILocation.cs
IMapping.cs
IMappingFromItem.cs
IMetadataFile.cs
IMetadataFileCollection.cs
IMetadataFileId.cs
IMethodName.cs
IOutputResolution.cs
IPath.cs
IPerson.cs
IPersonAddress.cs
IPersonAddressCity.cs
IPersonAddressState.cs
IPersonAddressStreet.cs
IPersonAddressZipCode.cs
IPersonBirthday.cs
IPersonComment.cs
IPersonContainer.cs
IPersonEmail.cs
IPersonId.cs
IPersonName.cs
IPersonNameAlias.cs
IPersonNameFirst.cs
IPersonNameLast.cs
IPersonNameMiddle.cs
IPersonNumber.cs
IPersonURL.cs
IProperty.cs
IRelativePaths.cs
ISorting.cs
ISortingContainer.cs
IStorage.cs
IWorkingDirectory.cs
ImageHelper.cs
Index.cs
Item.cs
Location.cs
Mapping.cs
MetadataFile.cs
MetadataFileCollection.cs
MetadataFileId.cs
OutputResolution.cs
Person.cs
PersonAddress.cs
PersonAddressCity.cs
PersonAddressState.cs
PersonAddressStreet.cs
PersonAddressZipCode.cs
PersonBirthday.cs
PersonComment.cs
PersonContainer.cs
PersonEmail.cs
PersonId.cs
PersonName.cs
PersonNameAlias.cs
PersonNameFirst.cs
PersonNameLast.cs
PersonNameMiddle.cs
PersonNumber.cs
PersonURL.cs
Property.cs
RelativePaths.cs
Sorting.cs
SortingContainer.cs
Storage.cs
WorkingDirectory.cs
XPath.cs
FacePart.cs
IExif.cs
ILocation.cs
IMapLogic.cs
ImageFormat.cs
Mode.cs
Model.cs
PredictorModel.cs
%ClassName%.cs .ai
Console.cs
Container.cs
DatabaseFile.cs
DirectoryFileSystem.cs
DistanceHolder.cs
Face.cs
FaceDistance.cs
FaceDistanceContainer.cs
FaceEncoding.cs
FaceFileSystem.cs
FacePoint.cs
FileHolder.cs
FileSystem.cs
Item.cs
Location.cs
LocationContainer.cs
Mapping.cs
Marker.cs
MetadataFile.cs
MetadataFileCollection.cs
MetadataFileId.cs
Navigate.cs
OutputResolution.cs
Person.cs
PersonAddress.cs
PersonAddressCity.cs
PersonAddressState.cs
PersonAddressStreet.cs
PersonAddressZipCode.cs
PersonBirthday.cs
PersonComment.cs
PersonContainer.cs
PersonEmail.cs
PersonId.cs
PersonImport.cs
PersonName.cs
PersonNameAlias.cs
PersonNameFirst.cs
PersonNameLast.cs
PersonNameMiddle.cs
PersonNumber.cs
PersonURL.cs
Property.cs
RelativeLocation.cs
RelativePaths.cs
SaveContainer.cs
Sorting.cs
SortingContainer.cs
Storage.cs
XPath.cs
Phares
Sample-Data
View-by-Distance.Shared.csproj
Tests
TestsWithFaceRecognitionDotNet
.editorconfig
.gitattributes
.gitignore
.txt
View-by-Distance-MKLink-Console.sln
package.json
view-by-distance-mklink-con…/Shared/Models/Stateless/Methods/ILocation.cs
2022-12-31 13:10:03 -07:00

117 lines
9.0 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, int normalizedRectangle) =>
FilterByIntersect(faces, normalizedRectangle);
static List<Models.Face> FilterByIntersect(Models.Face[] faces, int normalizedRectangle) =>
Location.FilterByIntersect(faces, normalizedRectangle);
Rectangle? TestStatic_GetRectangle(Models.OutputResolution outputResolution, DatabaseFile databaseFile, Marker marker) =>
GetRectangle(outputResolution, databaseFile, marker);
static Rectangle? GetRectangle(Models.OutputResolution outputResolution, DatabaseFile databaseFile, Marker marker) =>
Location.GetRectangle(outputResolution, databaseFile, marker);
Models.Location? TestStatic_GetLocation(Models.OutputResolution outputResolution, DatabaseFile databaseFile, Marker marker) =>
GetLocation(outputResolution, databaseFile, marker);
static Models.Location? GetLocation(Models.OutputResolution outputResolution, DatabaseFile databaseFile, Marker marker) =>
Location.GetLocation(outputResolution, databaseFile, marker);
List<Models.Location> TestStatic_GetLocations<T>(List<MappingFromPhotoPrism> mappingFromPhotoPrismCollection, List<Models.Face> faces, List<LocationContainer<T>> containers) =>
GetLocations(mappingFromPhotoPrismCollection, faces, containers);
static List<Models.Location> GetLocations<T>(List<MappingFromPhotoPrism> mappingFromPhotoPrismCollection, List<Models.Face> faces, List<LocationContainer<T>> containers) =>
Location.GetLocations(mappingFromPhotoPrismCollection, faces, containers);
Rectangle? TestStatic_GetNormalizedRectangle(int locationDigits, int normalizedRectangle) =>
GetNormalizedRectangle(locationDigits, normalizedRectangle);
static Rectangle? GetNormalizedRectangle(int locationDigits, int normalizedRectangle) =>
Location.GetNormalizedRectangle(locationDigits, normalizedRectangle.ToString());
Rectangle? TestStatic_GetRectangle(Rectangle checkRectangle, int locationDigits, int locationFactor, int normalizedRectangle, Models.OutputResolution outputResolution, bool useOldWay) =>
GetRectangle(checkRectangle, locationDigits, locationFactor, normalizedRectangle, outputResolution, useOldWay);
static Rectangle? GetRectangle(Rectangle checkRectangle, int locationDigits, int locationFactor, int normalizedRectangle, Models.OutputResolution outputResolution, bool useOldWay) =>
Location.GetRectangle(checkRectangle, OutputResolution.Get(outputResolution).Height, locationDigits, locationFactor, normalizedRectangle.ToString(), OutputResolution.Get(outputResolution).Width, useOldWay);
Rectangle? TestStatic_GetRectangle(int height, int locationDigits, int locationFactor, int normalizedRectangle, int outputResolutionHeight, int outputResolutionWidth, int width) =>
GetRectangle(height, locationDigits, locationFactor, normalizedRectangle, outputResolutionHeight, outputResolutionWidth, width);
static Rectangle? GetRectangle(int height, int locationDigits, int locationFactor, int normalizedRectangle, int outputResolutionHeight, int outputResolutionWidth, int width) =>
Location.GetRectangle(height, locationDigits, locationFactor, normalizedRectangle.ToString(), outputResolutionHeight, outputResolutionWidth, width);
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, double[] rangeFaceConfidence, double confidence) =>
GetConfidencePercent(faceConfidencePercent, rangeFaceConfidence, confidence);
static int GetConfidencePercent(int faceConfidencePercent, double[] 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());
(int?, int?) TestStatic_GetXY(int locationDigits, int locationFactor, int width, int height, string normalizedRectangle) =>
GetXY(locationDigits, locationFactor, width, height, normalizedRectangle);
static (int?, int?) GetXY(int locationDigits, int locationFactor, int width, int height, string normalizedRectangle) =>
Location.GetXY(locationDigits, locationFactor, width, height, normalizedRectangle);
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_GetNormalizedRectangle(Models.Location location, int locationDigits, Models.OutputResolution outputResolution) =>
GetNormalizedRectangle(location, locationDigits, outputResolution);
static int GetNormalizedRectangle(Models.Location location, int locationDigits, Models.OutputResolution outputResolution) =>
Location.GetNormalizedRectangle(location.Bottom, OutputResolution.Get(outputResolution).Height, location.Left, locationDigits, location.Right, location.Top, OutputResolution.Get(outputResolution).Width, zCount: 1);
int TestStatic_GetNormalizedRectangle(int bottom, int height, int left, int locationDigits, int right, int top, int width) =>
GetNormalizedRectangle(bottom, height, left, locationDigits, right, top, width);
static int GetNormalizedRectangle(int bottom, int height, int left, int locationDigits, int right, int top, int width) =>
Location.GetNormalizedRectangle(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);
}