Browse Source

Format ICC models

pull/870/head
Jason Nelson 7 years ago
parent
commit
0b6da37d3b
  1. 13
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs
  2. 5
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs
  3. 25
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs
  4. 9
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs
  5. 21
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs

13
src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs

@ -35,22 +35,22 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <summary>
/// Gets the colorant name
/// Gets the colorant name.
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the first PCS value
/// Gets the first PCS value.
/// </summary>
public ushort Pcs1 { get; }
/// <summary>
/// Gets the second PCS value
/// Gets the second PCS value.
/// </summary>
public ushort Pcs2 { get; }
/// <summary>
/// Gets the third PCS value
/// Gets the third PCS value.
/// </summary>
public ushort Pcs3 { get; }
@ -110,9 +110,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override string ToString()
{
return $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}";
}
public override string ToString() => $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}";
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs

@ -49,9 +49,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
this.Text == other.Text;
/// <inheritdoc />
public override string ToString()
{
return $"{this.Culture.Name}: {this.Text}";
}
public override string ToString() => $"{this.Culture.Name}: {this.Text}";
}
}

25
src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs

@ -31,27 +31,27 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <summary>
/// Gets the first part of the ID
/// Gets the first part of the ID.
/// </summary>
public uint Part1 { get; }
/// <summary>
/// Gets the second part of the ID
/// Gets the second part of the ID.
/// </summary>
public uint Part2 { get; }
/// <summary>
/// Gets the third part of the ID
/// Gets the third part of the ID.
/// </summary>
public uint Part3 { get; }
/// <summary>
/// Gets the fourth part of the ID
/// Gets the fourth part of the ID.
/// </summary>
public uint Part4 { get; }
/// <summary>
/// Gets a value indicating whether the ID is set or just consists of zeros
/// Gets a value indicating whether the ID is set or just consists of zeros.
/// </summary>
public bool IsSet => !this.Equals(Zero);
@ -86,10 +86,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override bool Equals(object obj)
{
return obj is IccProfileId other && this.Equals(other);
}
public override bool Equals(object obj) => obj is IccProfileId other && this.Equals(other);
/// <inheritdoc/>
public bool Equals(IccProfileId other) =>
@ -109,14 +106,8 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override string ToString()
{
return $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}";
}
public override string ToString() => $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}";
private static string ToHex(uint value)
{
return value.ToString("X").PadLeft(8, '0');
}
private static string ToHex(uint value) => value.ToString("X").PadLeft(8, '0');
}
}

9
src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs

@ -26,12 +26,12 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <summary>
/// Gets the screen frequency
/// Gets the screen frequency.
/// </summary>
public float Frequency { get; }
/// <summary>
/// Gets the angle in degrees
/// Gets the angle in degrees.
/// </summary>
public float Angle { get; }
@ -89,9 +89,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override string ToString()
{
return $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}";
}
public override string ToString() => $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}";
}
}

21
src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs

@ -24,17 +24,17 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <summary>
/// Gets the signature of the tag
/// Gets the signature of the tag.
/// </summary>
public IccProfileTag Signature { get; }
/// <summary>
/// Gets the offset of entry in bytes
/// Gets the offset of entry in bytes.
/// </summary>
public uint Offset { get; }
/// <summary>
/// Gets the size of entry in bytes
/// Gets the size of entry in bytes.
/// </summary>
public uint DataSize { get; }
@ -69,10 +69,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override bool Equals(object obj)
{
return obj is IccTagTableEntry other && this.Equals(other);
}
public override bool Equals(object obj) => obj is IccTagTableEntry other && this.Equals(other);
/// <inheritdoc/>
public bool Equals(IccTagTableEntry other) =>
@ -81,15 +78,9 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
this.DataSize.Equals(other.DataSize);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashCode.Combine(this.Signature, this.Offset, this.DataSize);
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Offset, this.DataSize);
/// <inheritdoc/>
public override string ToString()
{
return $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})";
}
public override string ToString() => $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})";
}
}

Loading…
Cancel
Save