Browse Source

Format color spaces

pull/870/head
Jason Nelson 7 years ago
parent
commit
0936b5882f
  1. 6
      src/ImageSharp/ColorSpaces/CieLch.cs
  2. 2
      src/ImageSharp/ColorSpaces/CieXyz.cs
  3. 9
      src/ImageSharp/ColorSpaces/HunterLab.cs
  4. 6
      src/ImageSharp/ColorSpaces/Illuminants.cs
  5. 8
      src/ImageSharp/ColorSpaces/Rgb.cs
  6. 3
      src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs

6
src/ImageSharp/ColorSpaces/CieLch.cs

@ -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);
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>

2
src/ImageSharp/ColorSpaces/CieXyz.cs

@ -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;

9
src/ImageSharp/ColorSpaces/HunterLab.cs

@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
{
/// <summary>
/// Represents an Hunter LAB color.
/// <see href="https://en.wikipedia.org/wiki/Lab_color_space"/>
/// <see href="https://en.wikipedia.org/wiki/Lab_color_space"/>.
/// </summary>
public readonly struct HunterLab : IEquatable<HunterLab>
{
@ -38,7 +38,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public readonly float B;
/// <summary>
/// Gets the reference white point of this color
/// Gets the reference white point of this color.
/// </summary>
public readonly CieXyz WhitePoint;
@ -117,10 +117,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
}
public override int GetHashCode() => HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"HunterLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})");

6
src/ImageSharp/ColorSpaces/Illuminants.cs

@ -8,11 +8,9 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// Standard illuminants provide a basis for comparing images or colors recorded under different lighting
/// </summary>
/// <remarks>
/// Coefficients taken from:
/// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
/// Coefficients taken from: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
/// <br />
/// Descriptions taken from:
/// http://en.wikipedia.org/wiki/Standard_illuminant
/// Descriptions taken from: http://en.wikipedia.org/wiki/Standard_illuminant
/// </remarks>
public static class Illuminants
{

8
src/ImageSharp/ColorSpaces/Rgb.cs

@ -14,14 +14,14 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// </summary>
public readonly struct Rgb : IEquatable<Rgb>
{
private static readonly Vector3 Min = Vector3.Zero;
private static readonly Vector3 Max = Vector3.One;
/// <summary>
/// The default rgb working space
/// The default rgb working space.
/// </summary>
public static readonly RgbWorkingSpaceBase DefaultWorkingSpace = RgbWorkingSpaces.SRgb;
private static readonly Vector3 Min = Vector3.Zero;
private static readonly Vector3 Max = Vector3.One;
/// <summary>
/// Gets the red component.
/// <remarks>A value usually ranging between 0 and 1.</remarks>

3
src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs

@ -8,8 +8,7 @@ using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation;
namespace SixLabors.ImageSharp.ColorSpaces
{
/// <summary>
/// Chromaticity coordinates taken from:
/// <see href="http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html"/>
/// Chromaticity coordinates based on: <see href="http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html"/>
/// </summary>
public static class RgbWorkingSpaces
{

Loading…
Cancel
Save