Skip to content
Merged

Nits #870

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ImageSharp/Advanced/AdvancedImageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class AdvancedImageExtensions
/// Gets the configuration for the image.
/// </summary>
/// <typeparam name="TPixel">The Pixel format.</typeparam>
/// <param name="source">The source image</param>
/// <param name="source">The source image.</param>
/// <returns>Returns the configuration.</returns>
public static Configuration GetConfiguration<TPixel>(this Image<TPixel> source)
where TPixel : struct, IPixel<TPixel>
Expand Down Expand Up @@ -150,7 +150,7 @@ internal static Memory<TPixel> GetPixelRowMemory<TPixel>(this Image<TPixel> sour
/// <summary>
/// Gets the <see cref="MemoryAllocator"/> assigned to 'source'.
/// </summary>
/// <param name="source">The source image</param>
/// <param name="source">The source image.</param>
/// <returns>Returns the configuration.</returns>
internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source)
=> GetConfiguration(source).MemoryAllocator;
Expand Down Expand Up @@ -185,7 +185,7 @@ private static Span<TPixel> GetSpan<TPixel>(IPixelSource<TPixel> source, int row
/// <param name="source">The source.</param>
/// <param name="row">The row.</param>
/// <returns>
/// The span returned from Pixel source
/// The span returned from Pixel source.
/// </returns>
private static Span<TPixel> GetSpan<TPixel>(Buffer2D<TPixel> source, int row)
where TPixel : struct, IPixel<TPixel>
Expand Down
1 change: 0 additions & 1 deletion src/ImageSharp/Advanced/IPixelSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Memory;

namespace SixLabors.ImageSharp.Advanced
{
Expand Down
6 changes: 3 additions & 3 deletions src/ImageSharp/ColorSpaces/CieLch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// </summary>
public readonly struct CieLch : IEquatable<CieLch>
{
private static readonly Vector3 Min = new Vector3(0, -200, 0);
private static readonly Vector3 Max = new Vector3(100, 200, 360);

/// <summary>
/// D50 standard illuminant.
/// Used when reference white is not specified explicitly.
/// </summary>
public static readonly CieXyz DefaultWhitePoint = Illuminants.D50;

private static readonly Vector3 Min = new Vector3(0, -200, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public fields should preceed private fields, right? I always get confused by these rules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep (and why I reordered this one).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised StyleCop hadn't already picked up on this one.

private static readonly Vector3 Max = new Vector3(100, 200, 360);

/// <summary>
/// Gets the lightness dimension.
/// <remarks>A value ranging between 0 (black), 100 (diffuse white) or higher (specular white).</remarks>
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/ColorSpaces/CieXyz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public readonly float Y;

/// <summary>
/// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response
/// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response.
/// <remarks>A value usually ranging between 0 and 1.</remarks>
/// </summary>
public readonly float Z;
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/ColorSpaces/Cmyk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Cmyk(Vector4 vector)
public static bool operator ==(Cmyk left, Cmyk right) => left.Equals(right);

/// <summary>
/// Compares two <see cref="Cmyk"/> objects for inequality
/// Compares two <see cref="Cmyk"/> objects for inequality.
/// </summary>
/// <param name="left">The <see cref="Cmyk"/> on the left side of the operand.</param>
/// <param name="right">The <see cref="Cmyk"/> on the right side of the operand.</param>
Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace SixLabors.ImageSharp.ColorSpaces.Companding
{
/// <summary>
/// Implements sRGB companding
/// Implements sRGB companding.
/// </summary>
/// <remarks>
/// For more info see:
Expand Down
47 changes: 22 additions & 25 deletions src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class ColorSpaceConverter
private static readonly CieLchToCieLabConverter CieLchToCieLabConverter = new CieLchToCieLabConverter();

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

// Adaptation
return this.Adapt(unadapted);
}

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

/// <summary>
/// Converts a <see cref="CieLchuv"/> into a <see cref="CieLab"/>
/// Converts a <see cref="CieLchuv"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -66,7 +65,7 @@ public CieLab ToCieLab(in CieLchuv color)
}

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

/// <summary>
/// Converts a <see cref="CieLuv"/> into a <see cref="CieLab"/>
/// Converts a <see cref="CieLuv"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -99,7 +98,7 @@ public CieLab ToCieLab(in CieLuv color)
}

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

/// <summary>
/// Converts a <see cref="CieXyy"/> into a <see cref="CieLab"/>
/// Converts a <see cref="CieXyy"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -132,7 +131,7 @@ public CieLab ToCieLab(in CieXyy color)
}

/// <summary>
/// Performs the bulk conversion from <see cref="CieXyy"/> into <see cref="CieLab"/>
/// Performs the bulk conversion from <see cref="CieXyy"/> into <see cref="CieLab"/>.
/// </summary>
/// <param name="source">The span to the source colors</param>
/// <param name="destination">The span to the destination colors</param>
Expand All @@ -159,10 +158,8 @@ public void Convert(ReadOnlySpan<CieXyy> source, Span<CieLab> destination)
/// <returns>The <see cref="CieLab"/></returns>
public CieLab ToCieLab(in CieXyz color)
{
// Adaptation
CieXyz adapted = this.Adapt(color, this.whitePoint, this.targetLabWhitePoint);

// Conversion
return this.cieXyzToCieLabConverter.Convert(adapted);
}

Expand Down Expand Up @@ -199,7 +196,7 @@ public CieLab ToCieLab(in Cmyk color)
}

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

/// <summary>
/// Converts a <see cref="Hsl"/> into a <see cref="CieLab"/>
/// Converts a <see cref="Hsl"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -232,7 +229,7 @@ public CieLab ToCieLab(in Hsl color)
}

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

/// <summary>
/// Converts a <see cref="Hsv"/> into a <see cref="CieLab"/>
/// Converts a <see cref="Hsv"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -264,7 +261,7 @@ public CieLab ToCieLab(in Hsv color)
}

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

/// <summary>
/// Converts a <see cref="HunterLab"/> into a <see cref="CieLab"/>
/// Converts a <see cref="HunterLab"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -297,7 +294,7 @@ public CieLab ToCieLab(in HunterLab color)
}

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

/// <summary>
/// Converts a <see cref="Lms"/> into a <see cref="CieLab"/>
/// Converts a <see cref="Lms"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -330,7 +327,7 @@ public CieLab ToCieLab(in Lms color)
}

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

/// <summary>
/// Converts a <see cref="LinearRgb"/> into a <see cref="CieLab"/>
/// Converts a <see cref="LinearRgb"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -363,7 +360,7 @@ public CieLab ToCieLab(in LinearRgb color)
}

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

/// <summary>
/// Converts a <see cref="Rgb"/> into a <see cref="CieLab"/>
/// Converts a <see cref="Rgb"/> into a <see cref="CieLab"/>.
/// </summary>
/// <param name="color">The color to convert.</param>
/// <returns>The <see cref="CieLab"/></returns>
Expand All @@ -396,7 +393,7 @@ public CieLab ToCieLab(in Rgb color)
}

/// <summary>
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>
/// Performs the bulk conversion from <see cref="LinearRgb"/> into <see cref="CieLab"/>.
/// </summary>
/// <param name="source">The span to the source colors</param>
/// <param name="destination">The span to the destination colors</param>
Expand Down Expand Up @@ -429,7 +426,7 @@ public CieLab ToCieLab(in YCbCr color)
}

/// <summary>
/// Performs the bulk conversion from <see cref="YCbCr"/> into <see cref="CieLab"/>
/// Performs the bulk conversion from <see cref="YCbCr"/> into <see cref="CieLab"/>.
/// </summary>
/// <param name="source">The span to the source colors</param>
/// <param name="destination">The span to the destination colors</param>
Expand Down
Loading