Browse Source

Merge branch 'master' into master

af/merge-core
James Jackson-South 8 years ago
committed by GitHub
parent
commit
7152eb4df4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/ImageSharp/PixelFormats/Alpha8.cs
  2. 7
      src/ImageSharp/PixelFormats/Argb32.cs
  3. 5
      src/ImageSharp/PixelFormats/Bgr565.cs
  4. 10
      src/ImageSharp/PixelFormats/Bgra32.cs
  5. 5
      src/ImageSharp/PixelFormats/Bgra4444.cs
  6. 5
      src/ImageSharp/PixelFormats/Bgra5551.cs
  7. 5
      src/ImageSharp/PixelFormats/Byte4.cs
  8. 5
      src/ImageSharp/PixelFormats/HalfSingle.cs
  9. 5
      src/ImageSharp/PixelFormats/HalfVector2.cs
  10. 5
      src/ImageSharp/PixelFormats/HalfVector4.cs
  11. 5
      src/ImageSharp/PixelFormats/NormalizedByte2.cs
  12. 5
      src/ImageSharp/PixelFormats/NormalizedByte4.cs
  13. 7
      src/ImageSharp/PixelFormats/Rgba32.cs
  14. 5
      src/ImageSharp/PixelFormats/Rgba64.cs
  15. 5
      src/ImageSharp/PixelFormats/Short2.cs
  16. 5
      src/ImageSharp/PixelFormats/Short4.cs

5
src/ImageSharp/PixelFormats/Alpha8.cs

@ -208,10 +208,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Packs a <see cref="float"/> into a byte.

7
src/ImageSharp/PixelFormats/Argb32.cs

@ -362,12 +362,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
int hash = HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode());
hash = HashHelpers.Combine(hash, this.B.GetHashCode());
return HashHelpers.Combine(hash, this.A.GetHashCode());
}
public override int GetHashCode() => this.Argb.GetHashCode();
/// <summary>
/// Gets the <see cref="Vector4"/> representation without normalizing to [0, 1]

5
src/ImageSharp/PixelFormats/Bgr565.cs

@ -224,10 +224,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Packs the <see cref="float"/> components into a <see cref="ushort"/>.

10
src/ImageSharp/PixelFormats/Bgra32.cs

@ -1,7 +1,6 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -105,19 +104,14 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/>
public bool Equals(Bgra32 other)
{
return this.R == other.R && this.G == other.G && this.B == other.B && this.A == other.A;
return this.Bgra == other.Bgra;
}
/// <inheritdoc/>
public override bool Equals(object obj) => obj is Bgra32 other && this.Equals(other);
/// <inheritdoc/>
public override int GetHashCode()
{
int hash = HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode());
hash = HashHelpers.Combine(hash, this.B.GetHashCode());
return HashHelpers.Combine(hash, this.A.GetHashCode());
}
public override int GetHashCode() => this.Bgra.GetHashCode();
/// <summary>
/// Gets the <see cref="Vector4"/> representation without normalizing to [0, 1]

5
src/ImageSharp/PixelFormats/Bgra4444.cs

@ -215,10 +215,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Packs the <see cref="float"/> components into a <see cref="ushort"/>.

5
src/ImageSharp/PixelFormats/Bgra5551.cs

@ -221,10 +221,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// </summary>
/// <returns>The hash code for the packed vector.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Packs the <see cref="float"/> components into a <see cref="ushort"/>.

5
src/ImageSharp/PixelFormats/Byte4.cs

@ -210,10 +210,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Returns a string representation of the current instance.

5
src/ImageSharp/PixelFormats/HalfSingle.cs

@ -229,10 +229,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private Vector4 ToByteScaledVector4()

5
src/ImageSharp/PixelFormats/HalfVector2.cs

@ -231,10 +231,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <inheritdoc />
public override bool Equals(object obj)

5
src/ImageSharp/PixelFormats/HalfVector4.cs

@ -224,10 +224,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <inheritdoc />
public override bool Equals(object obj)

5
src/ImageSharp/PixelFormats/NormalizedByte2.cs

@ -257,10 +257,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <inheritdoc />
public override string ToString()

5
src/ImageSharp/PixelFormats/NormalizedByte4.cs

@ -250,10 +250,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <inheritdoc />
public override string ToString()

7
src/ImageSharp/PixelFormats/Rgba32.cs

@ -437,12 +437,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
int hash = HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode());
hash = HashHelpers.Combine(hash, this.B.GetHashCode());
return HashHelpers.Combine(hash, this.A.GetHashCode());
}
public override int GetHashCode() => this.Rgba.GetHashCode();
/// <summary>
/// Gets the <see cref="Vector4"/> representation without normalizing to [0, 1]

5
src/ImageSharp/PixelFormats/Rgba64.cs

@ -295,9 +295,6 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
}
}

5
src/ImageSharp/PixelFormats/Short2.cs

@ -249,10 +249,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <inheritdoc />
public override string ToString()

5
src/ImageSharp/PixelFormats/Short4.cs

@ -247,10 +247,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// </summary>
/// <returns>Hash code for the instance.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return this.PackedValue.GetHashCode();
}
public override int GetHashCode() => this.PackedValue.GetHashCode();
/// <summary>
/// Returns a string representation of the current instance.

Loading…
Cancel
Save