Skip to content

Commit

Permalink
Use named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Feb 12, 2024
1 parent 8681ca7 commit 60df962
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion MetadataExtractor/Formats/Flir/FlirReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ public IEnumerable<Directory> Extract(IndexedReader reader)
var tm = dateTimeReader.GetUInt32();
var ss = dateTimeReader.GetUInt32() & 0xffff;
var tz = dateTimeReader.GetInt16();
directory.Set(TagDateTimeOriginal, new DateTimeOffset(DateUtil.FromUnixTime(tm - tz * 60).AddSeconds(ss / 1000d), TimeSpan.FromMinutes(tz)));
directory.Set(TagDateTimeOriginal, new DateTimeOffset(
dateTime: DateUtil.FromUnixTime(tm - tz * 60).AddSeconds(ss / 1000d),
offset: TimeSpan.FromMinutes(tz)));

directory.Set(TagFocusStepCount, reader2.GetUInt16(TagFocusStepCount));
directory.Set(TagFocusDistance, reader2.GetFloat32(TagFocusDistance));
Expand Down
30 changes: 15 additions & 15 deletions MetadataExtractor/Formats/Tiff/TiffDataFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ public enum TiffDataFormatCode : ushort
public sealed class TiffDataFormat
{
#pragma warning disable format
public static readonly TiffDataFormat Int8U = new("BYTE", TiffDataFormatCode.Int8U, 1);
public static readonly TiffDataFormat String = new("STRING", TiffDataFormatCode.String, 1);
public static readonly TiffDataFormat Int16U = new("USHORT", TiffDataFormatCode.Int16U, 2);
public static readonly TiffDataFormat Int32U = new("ULONG", TiffDataFormatCode.Int32U, 4);
public static readonly TiffDataFormat RationalU = new("URATIONAL", TiffDataFormatCode.RationalU, 8);
public static readonly TiffDataFormat Int8S = new("SBYTE", TiffDataFormatCode.Int8S, 1);
public static readonly TiffDataFormat Undefined = new("UNDEFINED", TiffDataFormatCode.Undefined, 1);
public static readonly TiffDataFormat Int16S = new("SSHORT", TiffDataFormatCode.Int16S, 2);
public static readonly TiffDataFormat Int32S = new("SLONG", TiffDataFormatCode.Int32S, 4);
public static readonly TiffDataFormat RationalS = new("SRATIONAL", TiffDataFormatCode.RationalS, 8);
public static readonly TiffDataFormat Single = new("SINGLE", TiffDataFormatCode.Single, 4);
public static readonly TiffDataFormat Double = new("DOUBLE", TiffDataFormatCode.Double, 8);
public static readonly TiffDataFormat Int8U = new("BYTE", TiffDataFormatCode.Int8U, componentSizeBytes: 1);
public static readonly TiffDataFormat String = new("STRING", TiffDataFormatCode.String, componentSizeBytes: 1);
public static readonly TiffDataFormat Int16U = new("USHORT", TiffDataFormatCode.Int16U, componentSizeBytes: 2);
public static readonly TiffDataFormat Int32U = new("ULONG", TiffDataFormatCode.Int32U, componentSizeBytes: 4);
public static readonly TiffDataFormat RationalU = new("URATIONAL", TiffDataFormatCode.RationalU, componentSizeBytes: 8);
public static readonly TiffDataFormat Int8S = new("SBYTE", TiffDataFormatCode.Int8S, componentSizeBytes: 1);
public static readonly TiffDataFormat Undefined = new("UNDEFINED", TiffDataFormatCode.Undefined, componentSizeBytes: 1);
public static readonly TiffDataFormat Int16S = new("SSHORT", TiffDataFormatCode.Int16S, componentSizeBytes: 2);
public static readonly TiffDataFormat Int32S = new("SLONG", TiffDataFormatCode.Int32S, componentSizeBytes: 4);
public static readonly TiffDataFormat RationalS = new("SRATIONAL", TiffDataFormatCode.RationalS, componentSizeBytes: 8);
public static readonly TiffDataFormat Single = new("SINGLE", TiffDataFormatCode.Single, componentSizeBytes: 4);
public static readonly TiffDataFormat Double = new("DOUBLE", TiffDataFormatCode.Double, componentSizeBytes: 8);

// From BigTIFF
public static readonly TiffDataFormat Int64U = new("ULONG8", TiffDataFormatCode.Int64U, 8);
public static readonly TiffDataFormat Int64S = new("SLONG8", TiffDataFormatCode.Int64S, 8);
public static readonly TiffDataFormat Ifd8 = new("IFD8", TiffDataFormatCode.Ifd8, 8);
public static readonly TiffDataFormat Int64U = new("ULONG8", TiffDataFormatCode.Int64U, componentSizeBytes: 8);
public static readonly TiffDataFormat Int64S = new("SLONG8", TiffDataFormatCode.Int64S, componentSizeBytes: 8);
public static readonly TiffDataFormat Ifd8 = new("IFD8", TiffDataFormatCode.Ifd8, componentSizeBytes: 8);
#pragma warning restore format

public static TiffDataFormat? FromTiffFormatCode(TiffDataFormatCode tiffFormatCode, bool isBigTiff)
Expand Down

0 comments on commit 60df962

Please sign in to comment.