Skip to content

Commit 0b6da37

Browse files
committed
Format ICC models
1 parent 27adde1 commit 0b6da37

File tree

5 files changed

+23
-50
lines changed

5 files changed

+23
-50
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ public IccColorantTableEntry(string name, ushort pcs1, ushort pcs2, ushort pcs3)
3535
}
3636

3737
/// <summary>
38-
/// Gets the colorant name
38+
/// Gets the colorant name.
3939
/// </summary>
4040
public string Name { get; }
4141

4242
/// <summary>
43-
/// Gets the first PCS value
43+
/// Gets the first PCS value.
4444
/// </summary>
4545
public ushort Pcs1 { get; }
4646

4747
/// <summary>
48-
/// Gets the second PCS value
48+
/// Gets the second PCS value.
4949
/// </summary>
5050
public ushort Pcs2 { get; }
5151

5252
/// <summary>
53-
/// Gets the third PCS value
53+
/// Gets the third PCS value.
5454
/// </summary>
5555
public ushort Pcs3 { get; }
5656

@@ -110,9 +110,6 @@ public override int GetHashCode()
110110
}
111111

112112
/// <inheritdoc/>
113-
public override string ToString()
114-
{
115-
return $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}";
116-
}
113+
public override string ToString() => $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}";
117114
}
118115
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public bool Equals(IccLocalizedString other) =>
4949
this.Text == other.Text;
5050

5151
/// <inheritdoc />
52-
public override string ToString()
53-
{
54-
return $"{this.Culture.Name}: {this.Text}";
55-
}
52+
public override string ToString() => $"{this.Culture.Name}: {this.Text}";
5653
}
5754
}

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ public IccProfileId(uint p1, uint p2, uint p3, uint p4)
3131
}
3232

3333
/// <summary>
34-
/// Gets the first part of the ID
34+
/// Gets the first part of the ID.
3535
/// </summary>
3636
public uint Part1 { get; }
3737

3838
/// <summary>
39-
/// Gets the second part of the ID
39+
/// Gets the second part of the ID.
4040
/// </summary>
4141
public uint Part2 { get; }
4242

4343
/// <summary>
44-
/// Gets the third part of the ID
44+
/// Gets the third part of the ID.
4545
/// </summary>
4646
public uint Part3 { get; }
4747

4848
/// <summary>
49-
/// Gets the fourth part of the ID
49+
/// Gets the fourth part of the ID.
5050
/// </summary>
5151
public uint Part4 { get; }
5252

5353
/// <summary>
54-
/// Gets a value indicating whether the ID is set or just consists of zeros
54+
/// Gets a value indicating whether the ID is set or just consists of zeros.
5555
/// </summary>
5656
public bool IsSet => !this.Equals(Zero);
5757

@@ -86,10 +86,7 @@ public IccProfileId(uint p1, uint p2, uint p3, uint p4)
8686
}
8787

8888
/// <inheritdoc/>
89-
public override bool Equals(object obj)
90-
{
91-
return obj is IccProfileId other && this.Equals(other);
92-
}
89+
public override bool Equals(object obj) => obj is IccProfileId other && this.Equals(other);
9390

9491
/// <inheritdoc/>
9592
public bool Equals(IccProfileId other) =>
@@ -109,14 +106,8 @@ public override int GetHashCode()
109106
}
110107

111108
/// <inheritdoc/>
112-
public override string ToString()
113-
{
114-
return $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}";
115-
}
109+
public override string ToString() => $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}";
116110

117-
private static string ToHex(uint value)
118-
{
119-
return value.ToString("X").PadLeft(8, '0');
120-
}
111+
private static string ToHex(uint value) => value.ToString("X").PadLeft(8, '0');
121112
}
122113
}

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public IccScreeningChannel(float frequency, float angle, IccScreeningSpotType sp
2626
}
2727

2828
/// <summary>
29-
/// Gets the screen frequency
29+
/// Gets the screen frequency.
3030
/// </summary>
3131
public float Frequency { get; }
3232

3333
/// <summary>
34-
/// Gets the angle in degrees
34+
/// Gets the angle in degrees.
3535
/// </summary>
3636
public float Angle { get; }
3737

@@ -89,9 +89,6 @@ public override int GetHashCode()
8989
}
9090

9191
/// <inheritdoc/>
92-
public override string ToString()
93-
{
94-
return $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}";
95-
}
92+
public override string ToString() => $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}";
9693
}
9794
}

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ public IccTagTableEntry(IccProfileTag signature, uint offset, uint dataSize)
2424
}
2525

2626
/// <summary>
27-
/// Gets the signature of the tag
27+
/// Gets the signature of the tag.
2828
/// </summary>
2929
public IccProfileTag Signature { get; }
3030

3131
/// <summary>
32-
/// Gets the offset of entry in bytes
32+
/// Gets the offset of entry in bytes.
3333
/// </summary>
3434
public uint Offset { get; }
3535

3636
/// <summary>
37-
/// Gets the size of entry in bytes
37+
/// Gets the size of entry in bytes.
3838
/// </summary>
3939
public uint DataSize { get; }
4040

@@ -69,10 +69,7 @@ public IccTagTableEntry(IccProfileTag signature, uint offset, uint dataSize)
6969
}
7070

7171
/// <inheritdoc/>
72-
public override bool Equals(object obj)
73-
{
74-
return obj is IccTagTableEntry other && this.Equals(other);
75-
}
72+
public override bool Equals(object obj) => obj is IccTagTableEntry other && this.Equals(other);
7673

7774
/// <inheritdoc/>
7875
public bool Equals(IccTagTableEntry other) =>
@@ -81,15 +78,9 @@ public bool Equals(IccTagTableEntry other) =>
8178
this.DataSize.Equals(other.DataSize);
8279

8380
/// <inheritdoc/>
84-
public override int GetHashCode()
85-
{
86-
return HashCode.Combine(this.Signature, this.Offset, this.DataSize);
87-
}
81+
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Offset, this.DataSize);
8882

8983
/// <inheritdoc/>
90-
public override string ToString()
91-
{
92-
return $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})";
93-
}
84+
public override string ToString() => $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})";
9485
}
9586
}

0 commit comments

Comments
 (0)