Skip to content

Commit a86cddb

Browse files
iamcarbonJimBobSquarePants
authored andcommitted
Nits (#870)
* Format conversion models * Format color spaces * Add missing periods * Replace Endianness enum with isBigEndian * Seal DoubleBufferedStreamReader * Remove unused namespaces * Simplify variable names * Remove unused namespace * Format Block8x8F * Use MathF * Simplify exception when an encoder is not found * Format ICC models * Simplify excption messages in ExifValue (reduces IL size) * Add missing periods to documentation. * Format ImageProperty * Format BmpImageFormatDetector * Seal LocalFileSystem * Seal JpegColorConverter implementations * Add missing periods to jpeg documentation * Format ValueSize * Fix stylecop violation * Revert "Simplify excption messages in ExifValue (reduces IL size)" This reverts commit d22f2a6.
1 parent c2d2ccb commit a86cddb

File tree

66 files changed

+465
-551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+465
-551
lines changed

src/ImageSharp/Advanced/AdvancedImageExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static class AdvancedImageExtensions
1919
/// Gets the configuration for the image.
2020
/// </summary>
2121
/// <typeparam name="TPixel">The Pixel format.</typeparam>
22-
/// <param name="source">The source image</param>
22+
/// <param name="source">The source image.</param>
2323
/// <returns>Returns the configuration.</returns>
2424
public static Configuration GetConfiguration<TPixel>(this Image<TPixel> source)
2525
where TPixel : struct, IPixel<TPixel>
@@ -150,7 +150,7 @@ internal static Memory<TPixel> GetPixelRowMemory<TPixel>(this Image<TPixel> sour
150150
/// <summary>
151151
/// Gets the <see cref="MemoryAllocator"/> assigned to 'source'.
152152
/// </summary>
153-
/// <param name="source">The source image</param>
153+
/// <param name="source">The source image.</param>
154154
/// <returns>Returns the configuration.</returns>
155155
internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source)
156156
=> GetConfiguration(source).MemoryAllocator;
@@ -185,7 +185,7 @@ private static Span<TPixel> GetSpan<TPixel>(IPixelSource<TPixel> source, int row
185185
/// <param name="source">The source.</param>
186186
/// <param name="row">The row.</param>
187187
/// <returns>
188-
/// The span returned from Pixel source
188+
/// The span returned from Pixel source.
189189
/// </returns>
190190
private static Span<TPixel> GetSpan<TPixel>(Buffer2D<TPixel> source, int row)
191191
where TPixel : struct, IPixel<TPixel>

src/ImageSharp/Advanced/IPixelSource.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using SixLabors.ImageSharp.Memory;
55
using SixLabors.ImageSharp.PixelFormats;
6-
using SixLabors.Memory;
76

87
namespace SixLabors.ImageSharp.Advanced
98
{

src/ImageSharp/ColorSpaces/CieLch.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
1313
/// </summary>
1414
public readonly struct CieLch : IEquatable<CieLch>
1515
{
16-
private static readonly Vector3 Min = new Vector3(0, -200, 0);
17-
private static readonly Vector3 Max = new Vector3(100, 200, 360);
18-
1916
/// <summary>
2017
/// D50 standard illuminant.
2118
/// Used when reference white is not specified explicitly.
2219
/// </summary>
2320
public static readonly CieXyz DefaultWhitePoint = Illuminants.D50;
2421

22+
private static readonly Vector3 Min = new Vector3(0, -200, 0);
23+
private static readonly Vector3 Max = new Vector3(100, 200, 360);
24+
2525
/// <summary>
2626
/// Gets the lightness dimension.
2727
/// <remarks>A value ranging between 0 (black), 100 (diffuse white) or higher (specular white).</remarks>

src/ImageSharp/ColorSpaces/CieXyz.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
2626
public readonly float Y;
2727

2828
/// <summary>
29-
/// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response
29+
/// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response.
3030
/// <remarks>A value usually ranging between 0 and 1.</remarks>
3131
/// </summary>
3232
public readonly float Z;

src/ImageSharp/ColorSpaces/Cmyk.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public Cmyk(Vector4 vector)
7878
public static bool operator ==(Cmyk left, Cmyk right) => left.Equals(right);
7979

8080
/// <summary>
81-
/// Compares two <see cref="Cmyk"/> objects for inequality
81+
/// Compares two <see cref="Cmyk"/> objects for inequality.
8282
/// </summary>
8383
/// <param name="left">The <see cref="Cmyk"/> on the left side of the operand.</param>
8484
/// <param name="right">The <see cref="Cmyk"/> on the right side of the operand.</param>

src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace SixLabors.ImageSharp.ColorSpaces.Companding
1010
{
1111
/// <summary>
12-
/// Implements sRGB companding
12+
/// Implements sRGB companding.
1313
/// </summary>
1414
/// <remarks>
1515
/// For more info see:

src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public partial class ColorSpaceConverter
1919
private static readonly CieLchToCieLabConverter CieLchToCieLabConverter = new CieLchToCieLabConverter();
2020

2121
/// <summary>
22-
/// Converts a <see cref="CieLch"/> into a <see cref="CieLab"/>
22+
/// Converts a <see cref="CieLch"/> into a <see cref="CieLab"/>.
2323
/// </summary>
2424
/// <param name="color">The color to convert.</param>
2525
/// <returns>The <see cref="CieLab"/></returns>
@@ -28,12 +28,11 @@ public CieLab ToCieLab(in CieLch color)
2828
// Conversion (perserving white point)
2929
CieLab unadapted = CieLchToCieLabConverter.Convert(color);
3030

31-
// Adaptation
3231
return this.Adapt(unadapted);
3332
}
3433

3534
/// <summary>
36-
/// Performs the bulk conversion from <see cref="CieLch"/> into <see cref="CieLab"/>
35+
/// Performs the bulk conversion from <see cref="CieLch"/> into <see cref="CieLab"/>.
3736
/// </summary>
3837
/// <param name="source">The span to the source colors</param>
3938
/// <param name="destination">The span to the destination colors</param>
@@ -54,7 +53,7 @@ public void Convert(ReadOnlySpan<CieLch> source, Span<CieLab> destination)
5453
}
5554

5655
/// <summary>
57-
/// Converts a <see cref="CieLchuv"/> into a <see cref="CieLab"/>
56+
/// Converts a <see cref="CieLchuv"/> into a <see cref="CieLab"/>.
5857
/// </summary>
5958
/// <param name="color">The color to convert.</param>
6059
/// <returns>The <see cref="CieLab"/></returns>
@@ -66,7 +65,7 @@ public CieLab ToCieLab(in CieLchuv color)
6665
}
6766

6867
/// <summary>
69-
/// Performs the bulk conversion from <see cref="CieLchuv"/> into <see cref="CieLab"/>
68+
/// Performs the bulk conversion from <see cref="CieLchuv"/> into <see cref="CieLab"/>.
7069
/// </summary>
7170
/// <param name="source">The span to the source colors</param>
7271
/// <param name="destination">The span to the destination colors</param>
@@ -87,7 +86,7 @@ public void Convert(ReadOnlySpan<CieLchuv> source, Span<CieLab> destination)
8786
}
8887

8988
/// <summary>
90-
/// Converts a <see cref="CieLuv"/> into a <see cref="CieLab"/>
89+
/// Converts a <see cref="CieLuv"/> into a <see cref="CieLab"/>.
9190
/// </summary>
9291
/// <param name="color">The color to convert.</param>
9392
/// <returns>The <see cref="CieLab"/></returns>
@@ -99,7 +98,7 @@ public CieLab ToCieLab(in CieLuv color)
9998
}
10099

101100
/// <summary>
102-
/// Performs the bulk conversion from <see cref="CieLuv"/> into <see cref="CieLab"/>
101+
/// Performs the bulk conversion from <see cref="CieLuv"/> into <see cref="CieLab"/>.
103102
/// </summary>
104103
/// <param name="source">The span to the source colors</param>
105104
/// <param name="destination">The span to the destination colors</param>
@@ -120,7 +119,7 @@ public void Convert(ReadOnlySpan<CieLuv> source, Span<CieLab> destination)
120119
}
121120

122121
/// <summary>
123-
/// Converts a <see cref="CieXyy"/> into a <see cref="CieLab"/>
122+
/// Converts a <see cref="CieXyy"/> into a <see cref="CieLab"/>.
124123
/// </summary>
125124
/// <param name="color">The color to convert.</param>
126125
/// <returns>The <see cref="CieLab"/></returns>
@@ -132,7 +131,7 @@ public CieLab ToCieLab(in CieXyy color)
132131
}
133132

134133
/// <summary>
135-
/// Performs the bulk conversion from <see cref="CieXyy"/> into <see cref="CieLab"/>
134+
/// Performs the bulk conversion from <see cref="CieXyy"/> into <see cref="CieLab"/>.
136135
/// </summary>
137136
/// <param name="source">The span to the source colors</param>
138137
/// <param name="destination">The span to the destination colors</param>
@@ -159,10 +158,8 @@ public void Convert(ReadOnlySpan<CieXyy> source, Span<CieLab> destination)
159158
/// <returns>The <see cref="CieLab"/></returns>
160159
public CieLab ToCieLab(in CieXyz color)
161160
{
162-
// Adaptation
163161
CieXyz adapted = this.Adapt(color, this.whitePoint, this.targetLabWhitePoint);
164162

165-
// Conversion
166163
return this.cieXyzToCieLabConverter.Convert(adapted);
167164
}
168165

@@ -199,7 +196,7 @@ public CieLab ToCieLab(in Cmyk color)
199196
}
200197

201198
/// <summary>
202-
/// Performs the bulk conversion from <see cref="Cmyk"/> into <see cref="CieLab"/>
199+
/// Performs the bulk conversion from <see cref="Cmyk"/> into <see cref="CieLab"/>.
203200
/// </summary>
204201
/// <param name="source">The span to the source colors</param>
205202
/// <param name="destination">The span to the destination colors</param>
@@ -220,7 +217,7 @@ public void Convert(ReadOnlySpan<Cmyk> source, Span<CieLab> destination)
220217
}
221218

222219
/// <summary>
223-
/// Converts a <see cref="Hsl"/> into a <see cref="CieLab"/>
220+
/// Converts a <see cref="Hsl"/> into a <see cref="CieLab"/>.
224221
/// </summary>
225222
/// <param name="color">The color to convert.</param>
226223
/// <returns>The <see cref="CieLab"/></returns>
@@ -232,7 +229,7 @@ public CieLab ToCieLab(in Hsl color)
232229
}
233230

234231
/// <summary>
235-
/// Performs the bulk conversion from <see cref="Hsl"/> into <see cref="CieLab"/>
232+
/// Performs the bulk conversion from <see cref="Hsl"/> into <see cref="CieLab"/>.
236233
/// </summary>
237234
/// <param name="source">The span to the source colors</param>
238235
/// <param name="destination">The span to the destination colors</param>
@@ -253,7 +250,7 @@ public void Convert(ReadOnlySpan<Hsl> source, Span<CieLab> destination)
253250
}
254251

255252
/// <summary>
256-
/// Converts a <see cref="Hsv"/> into a <see cref="CieLab"/>
253+
/// Converts a <see cref="Hsv"/> into a <see cref="CieLab"/>.
257254
/// </summary>
258255
/// <param name="color">The color to convert.</param>
259256
/// <returns>The <see cref="CieLab"/></returns>
@@ -264,7 +261,7 @@ public CieLab ToCieLab(in Hsv color)
264261
}
265262

266263
/// <summary>
267-
/// Performs the bulk conversion from <see cref="Hsv"/> into <see cref="CieLab"/>
264+
/// Performs the bulk conversion from <see cref="Hsv"/> into <see cref="CieLab"/>.
268265
/// </summary>
269266
/// <param name="source">The span to the source colors</param>
270267
/// <param name="destination">The span to the destination colors</param>
@@ -285,7 +282,7 @@ public void Convert(ReadOnlySpan<Hsv> source, Span<CieLab> destination)
285282
}
286283

287284
/// <summary>
288-
/// Converts a <see cref="HunterLab"/> into a <see cref="CieLab"/>
285+
/// Converts a <see cref="HunterLab"/> into a <see cref="CieLab"/>.
289286
/// </summary>
290287
/// <param name="color">The color to convert.</param>
291288
/// <returns>The <see cref="CieLab"/></returns>
@@ -297,7 +294,7 @@ public CieLab ToCieLab(in HunterLab color)
297294
}
298295

299296
/// <summary>
300-
/// Performs the bulk conversion from <see cref="HunterLab"/> into <see cref="CieLab"/>
297+
/// Performs the bulk conversion from <see cref="HunterLab"/> into <see cref="CieLab"/>.
301298
/// </summary>
302299
/// <param name="source">The span to the source colors</param>
303300
/// <param name="destination">The span to the destination colors</param>
@@ -318,7 +315,7 @@ public void Convert(ReadOnlySpan<HunterLab> source, Span<CieLab> destination)
318315
}
319316

320317
/// <summary>
321-
/// Converts a <see cref="Lms"/> into a <see cref="CieLab"/>
318+
/// Converts a <see cref="Lms"/> into a <see cref="CieLab"/>.
322319
/// </summary>
323320
/// <param name="color">The color to convert.</param>
324321
/// <returns>The <see cref="CieLab"/></returns>
@@ -330,7 +327,7 @@ public CieLab ToCieLab(in Lms color)
330327
}
331328

332329
/// <summary>
333-
/// Performs the bulk conversion from <see cref="Lms"/> into <see cref="CieLab"/>
330+
/// Performs the bulk conversion from <see cref="Lms"/> into <see cref="CieLab"/>.
334331
/// </summary>
335332
/// <param name="source">The span to the source colors</param>
336333
/// <param name="destination">The span to the destination colors</param>
@@ -351,7 +348,7 @@ public void Convert(ReadOnlySpan<Lms> source, Span<CieLab> destination)
351348
}
352349

353350
/// <summary>
354-
/// Converts a <see cref="LinearRgb"/> into a <see cref="CieLab"/>
351+
/// Converts a <see cref="LinearRgb"/> into a <see cref="CieLab"/>.
355352
/// </summary>
356353
/// <param name="color">The color to convert.</param>
357354
/// <returns>The <see cref="CieLab"/></returns>
@@ -363,7 +360,7 @@ public CieLab ToCieLab(in LinearRgb color)
363360
}
364361

365362
/// <summary>
366-
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>
363+
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>.
367364
/// </summary>
368365
/// <param name="source">The span to the source colors</param>
369366
/// <param name="destination">The span to the destination colors</param>
@@ -384,7 +381,7 @@ public void Convert(ReadOnlySpan<LinearRgb> source, Span<CieLab> destination)
384381
}
385382

386383
/// <summary>
387-
/// Converts a <see cref="Rgb"/> into a <see cref="CieLab"/>
384+
/// Converts a <see cref="Rgb"/> into a <see cref="CieLab"/>.
388385
/// </summary>
389386
/// <param name="color">The color to convert.</param>
390387
/// <returns>The <see cref="CieLab"/></returns>
@@ -396,7 +393,7 @@ public CieLab ToCieLab(in Rgb color)
396393
}
397394

398395
/// <summary>
399-
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>
396+
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>.
400397
/// </summary>
401398
/// <param name="source">The span to the source colors</param>
402399
/// <param name="destination">The span to the destination colors</param>
@@ -429,7 +426,7 @@ public CieLab ToCieLab(in YCbCr color)
429426
}
430427

431428
/// <summary>
432-
/// Performs the bulk conversion from <see cref="YCbCr"/> into <see cref="CieLab"/>
429+
/// Performs the bulk conversion from <see cref="YCbCr"/> into <see cref="CieLab"/>.
433430
/// </summary>
434431
/// <param name="source">The span to the source colors</param>
435432
/// <param name="destination">The span to the destination colors</param>

0 commit comments

Comments
 (0)