Browse Source

Format color spaces

pull/870/head
Jason Nelson 8 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> /// </summary>
public readonly struct CieLch : IEquatable<CieLch> 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> /// <summary>
/// D50 standard illuminant. /// D50 standard illuminant.
/// Used when reference white is not specified explicitly. /// Used when reference white is not specified explicitly.
/// </summary> /// </summary>
public static readonly CieXyz DefaultWhitePoint = Illuminants.D50; 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> /// <summary>
/// Gets the lightness dimension. /// Gets the lightness dimension.
/// <remarks>A value ranging between 0 (black), 100 (diffuse white) or higher (specular white).</remarks> /// <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; public readonly float Y;
/// <summary> /// <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> /// <remarks>A value usually ranging between 0 and 1.</remarks>
/// </summary> /// </summary>
public readonly float Z; public readonly float Z;

9
src/ImageSharp/ColorSpaces/HunterLab.cs

@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
{ {
/// <summary> /// <summary>
/// Represents an Hunter LAB color. /// 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> /// </summary>
public readonly struct HunterLab : IEquatable<HunterLab> public readonly struct HunterLab : IEquatable<HunterLab>
{ {
@ -38,7 +38,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public readonly float B; public readonly float B;
/// <summary> /// <summary>
/// Gets the reference white point of this color /// Gets the reference white point of this color.
/// </summary> /// </summary>
public readonly CieXyz WhitePoint; public readonly CieXyz WhitePoint;
@ -117,10 +117,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/> /// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)] [MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode() public override int GetHashCode() => HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
{
return HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
}
/// <inheritdoc/> /// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"HunterLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})"); 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 /// Standard illuminants provide a basis for comparing images or colors recorded under different lighting
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Coefficients taken from: /// Coefficients taken from: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
/// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
/// <br /> /// <br />
/// Descriptions taken from: /// Descriptions taken from: http://en.wikipedia.org/wiki/Standard_illuminant
/// http://en.wikipedia.org/wiki/Standard_illuminant
/// </remarks> /// </remarks>
public static class Illuminants public static class Illuminants
{ {

8
src/ImageSharp/ColorSpaces/Rgb.cs

@ -14,14 +14,14 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// </summary> /// </summary>
public readonly struct Rgb : IEquatable<Rgb> public readonly struct Rgb : IEquatable<Rgb>
{ {
private static readonly Vector3 Min = Vector3.Zero;
private static readonly Vector3 Max = Vector3.One;
/// <summary> /// <summary>
/// The default rgb working space /// The default rgb working space.
/// </summary> /// </summary>
public static readonly RgbWorkingSpaceBase DefaultWorkingSpace = RgbWorkingSpaces.SRgb; public static readonly RgbWorkingSpaceBase DefaultWorkingSpace = RgbWorkingSpaces.SRgb;
private static readonly Vector3 Min = Vector3.Zero;
private static readonly Vector3 Max = Vector3.One;
/// <summary> /// <summary>
/// Gets the red component. /// Gets the red component.
/// <remarks>A value usually ranging between 0 and 1.</remarks> /// <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 namespace SixLabors.ImageSharp.ColorSpaces
{ {
/// <summary> /// <summary>
/// Chromaticity coordinates taken from: /// Chromaticity coordinates based on: <see href="http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html"/>
/// <see href="http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html"/>
/// </summary> /// </summary>
public static class RgbWorkingSpaces public static class RgbWorkingSpaces
{ {

Loading…
Cancel
Save