MapFaceFileLogic
Author:
This commit is contained in:
@ -2,7 +2,9 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public record FaceFile(DateTime DateTime,
|
||||
public record FaceFile(int? AreaPermyriad,
|
||||
int? ConfidencePercent,
|
||||
DateTime DateTime,
|
||||
string? DMS,
|
||||
Dictionary<Stateless.FacePart, FacePoint[]>? FaceParts,
|
||||
Location? Location,
|
||||
|
@ -5,11 +5,57 @@ namespace View_by_Distance.Shared.Models;
|
||||
public record LocationContainer(DateOnly CreationDateOnly,
|
||||
ExifDirectory? ExifDirectory,
|
||||
int? DirectoryNumber,
|
||||
string DisplayDirectoryName,
|
||||
string? DisplayDirectoryName,
|
||||
object? Encoding,
|
||||
FaceFile? FaceFile,
|
||||
FilePath FilePath,
|
||||
bool FromDistanceContent,
|
||||
int Id,
|
||||
Location? Location,
|
||||
long PersonKey,
|
||||
int? LengthPermyriad,
|
||||
FilePath? LengthSource,
|
||||
long? PersonKey,
|
||||
RectangleF? Rectangle,
|
||||
int WholePercentages);
|
||||
int WholePercentages)
|
||||
{
|
||||
|
||||
public static LocationContainer Get(LocationContainer locationContainer, object? encoding, bool keepExifDirectory)
|
||||
{
|
||||
LocationContainer result;
|
||||
result = new(locationContainer.CreationDateOnly,
|
||||
keepExifDirectory ? locationContainer.ExifDirectory : null,
|
||||
locationContainer.DirectoryNumber,
|
||||
locationContainer.DisplayDirectoryName,
|
||||
encoding,
|
||||
locationContainer.FaceFile,
|
||||
locationContainer.FilePath,
|
||||
locationContainer.FromDistanceContent,
|
||||
locationContainer.Id,
|
||||
locationContainer.LengthPermyriad,
|
||||
locationContainer.LengthSource,
|
||||
locationContainer.PersonKey,
|
||||
locationContainer.Rectangle,
|
||||
locationContainer.WholePercentages);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static LocationContainer Get(LocationContainer source, LocationContainer locationContainer, int lengthPermyriad, bool keepExifDirectory, bool keepEncoding)
|
||||
{
|
||||
LocationContainer result;
|
||||
result = new(locationContainer.CreationDateOnly,
|
||||
keepExifDirectory ? locationContainer.ExifDirectory : null,
|
||||
locationContainer.DirectoryNumber,
|
||||
locationContainer.DisplayDirectoryName,
|
||||
keepEncoding ? locationContainer.Encoding : null,
|
||||
locationContainer.FaceFile,
|
||||
locationContainer.FilePath,
|
||||
locationContainer.FromDistanceContent,
|
||||
locationContainer.Id,
|
||||
lengthPermyriad,
|
||||
source.FilePath,
|
||||
locationContainer.PersonKey,
|
||||
locationContainer.Rectangle,
|
||||
locationContainer.WholePercentages);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -4,6 +4,6 @@ public interface IFaceD
|
||||
{
|
||||
|
||||
public string FileNameExtension { get; }
|
||||
void ReSaveFace(ExifDirectory exifDirectory, LocationContainer locationContainer, Models.Face face);
|
||||
void ReSaveFace(ExifDirectory exifDirectory, FilePath filePath, Models.Face face, bool mappedFile);
|
||||
|
||||
}
|
@ -10,9 +10,9 @@ public interface ILocation
|
||||
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) =>
|
||||
List<Models.Face> TestStatic_FilterByIntersect(List<Models.Face> faces, float rectangleIntersectMinimum, int wholePercentages) =>
|
||||
FilterByIntersect(faces, rectangleIntersectMinimum, wholePercentages);
|
||||
static List<Models.Face> FilterByIntersect(Models.Face[] faces, float rectangleIntersectMinimum, int wholePercentages) =>
|
||||
static List<Models.Face> FilterByIntersect(List<Models.Face> faces, float rectangleIntersectMinimum, int wholePercentages) =>
|
||||
Location.FilterByIntersect(faces, rectangleIntersectMinimum, wholePercentages);
|
||||
|
||||
RectangleF? TestStatic_GetPercentagesRectangle(DatabaseFile databaseFile, Marker marker, Models.OutputResolution outputResolution) =>
|
||||
|
@ -310,7 +310,7 @@ internal abstract class Location
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static List<Models.Face> FilterByIntersect(Models.Face[] faces, float rectangleIntersectMinimum, int wholePercentages)
|
||||
internal static List<Models.Face> FilterByIntersect(List<Models.Face> faces, float rectangleIntersectMinimum, int wholePercentages)
|
||||
{
|
||||
List<Models.Face> results = [];
|
||||
float? percent;
|
||||
|
Reference in New Issue
Block a user