AppSettings and Configuration changes,

major changes to E_Distance and minor for D_Face
This commit is contained in:
2022-08-19 21:37:36 -07:00
parent 004017b9dd
commit be7a6abbf4
60 changed files with 1269 additions and 1344 deletions

View File

@ -64,31 +64,31 @@ public sealed class Image : DisposableObject
/// <summary>
/// Saves this <see cref="Image"/> to the specified file.
/// </summary>
/// <param name="filename">A string that contains the name of the file to which to save this <see cref="Image"/>.</param>
/// <param name="fileName">A string that contains the name of the file to which to save this <see cref="Image"/>.</param>
/// <param name="format">The <see cref="ImageFormat"/> for this <see cref="Image"/>.</param>
/// <exception cref="NullReferenceException"><paramref name="filename"/> is null.</exception>
/// <exception cref="NullReferenceException"><paramref name="fileName"/> is null.</exception>
/// <exception cref="ObjectDisposedException">This object is disposed.</exception>
public void Save(string filename, ImageFormat format)
public void Save(string fileName, ImageFormat format)
{
if (filename == null)
throw new NullReferenceException(nameof(filename));
if (fileName == null)
throw new NullReferenceException(nameof(fileName));
ThrowIfDisposed();
string? directory = Path.GetDirectoryName(filename);
string? directory = Path.GetDirectoryName(fileName);
if (!Directory.Exists(directory) && !string.IsNullOrWhiteSpace(directory))
_ = Directory.CreateDirectory(directory);
switch (format)
{
case ImageFormat.Bmp:
DlibDotNet.Dlib.SaveBmp(Matrix, filename);
DlibDotNet.Dlib.SaveBmp(Matrix, fileName);
break;
case ImageFormat.Jpeg:
DlibDotNet.Dlib.SaveJpeg(Matrix, filename);
DlibDotNet.Dlib.SaveJpeg(Matrix, fileName);
break;
case ImageFormat.Png:
DlibDotNet.Dlib.SavePng(Matrix, filename);
DlibDotNet.Dlib.SavePng(Matrix, fileName);
break;
}
}