Mass push
This commit is contained in:
.vscode
Compare
Date-Group
Delete-By-Relative
.vscode
Delete-By-Relative.csprojDeleteByRelative.csModels
Program.csappsettings.Development.jsonappsettings.jsonDistance
Drag-Drop
Duplicate-Search
.vscode
Duplicate-Search.csprojDuplicateSearch.csModels
Program.csappsettings.Development.jsonappsettings.jsonFace
FaceParts
FaceRecognitionDotNet
Instance
DlibDotNet.csInstance.csproj
Models
Program.csappsettings.Development.jsonappsettings.Staging.jsonappsettings.jsonMap
Metadata
Not-Copy-Copy
PrepareForOld
Property-Compare
Property
Models
Property.csprojResize
Shared
Models
FaceDistance.csFileHolder.csItem.csLocation.csMapping.csMarker.csMarkerWith.cs
View-by-Distance.Shared.csprojProperties
IFaceDistance.csIItem.csIMapping.csIProperty.csIPropertyConfiguration.csIRelativeLocation.csISorting.cs
Property.csRelativeLocation.csSorting.csSortingContainer.csStateless
Tests
Models
Tests.csprojUnitTestCalculations.csUnitTestExample.csUnitTestIsEnvironment.csUnitTestResize.csTestsWithFaceRecognitionDotNet
View-by-Distance-MKLink-Console.sln
43
Shared/Models/RelativeLocation.cs
Normal file
43
Shared/Models/RelativeLocation.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Shared.Models;
|
||||
|
||||
public class RelativeLocation : Properties.IRelativeLocation
|
||||
{
|
||||
|
||||
public double Confidence { init; get; }
|
||||
public string Height { init; get; }
|
||||
public string Left { init; get; }
|
||||
public string Top { init; get; }
|
||||
public string Width { init; get; }
|
||||
|
||||
[JsonConstructor]
|
||||
public RelativeLocation(double confidence, string height, string left, string top, string width)
|
||||
{
|
||||
Confidence = confidence;
|
||||
Height = height;
|
||||
Left = left;
|
||||
Top = top;
|
||||
Width = width;
|
||||
}
|
||||
|
||||
public bool Match(decimal? height, decimal? left, decimal? top, decimal? width)
|
||||
{
|
||||
bool result;
|
||||
if (height is null || left is null || top is null || width is null)
|
||||
result = false;
|
||||
else if (height.Value.ToString() == Height && left.Value.ToString() == Left && top.Value.ToString() == Top && width.Value.ToString() == Width)
|
||||
result = false;
|
||||
else
|
||||
result = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user