James Jackson-South
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with
17 additions and
72 deletions
-
src/ImageSharp/PixelFormats/Alpha8.cs
-
src/ImageSharp/PixelFormats/Argb32.cs
-
src/ImageSharp/PixelFormats/Bgr565.cs
-
src/ImageSharp/PixelFormats/Bgra32.cs
-
src/ImageSharp/PixelFormats/Bgra4444.cs
-
src/ImageSharp/PixelFormats/Bgra5551.cs
-
src/ImageSharp/PixelFormats/Byte4.cs
-
src/ImageSharp/PixelFormats/HalfSingle.cs
-
src/ImageSharp/PixelFormats/HalfVector2.cs
-
src/ImageSharp/PixelFormats/HalfVector4.cs
-
src/ImageSharp/PixelFormats/NormalizedByte2.cs
-
src/ImageSharp/PixelFormats/NormalizedByte4.cs
-
src/ImageSharp/PixelFormats/Rgba32.cs
-
src/ImageSharp/PixelFormats/Rgba64.cs
-
src/ImageSharp/PixelFormats/Short2.cs
-
src/ImageSharp/PixelFormats/Short4.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.
|
|
|
|
|
|
|
|
@ -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]
|
|
|
|
|
|
|
|
@ -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"/>.
|
|
|
|
|
|
|
|
@ -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]
|
|
|
|
|
|
|
|
@ -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"/>.
|
|
|
|
|
|
|
|
@ -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"/>.
|
|
|
|
|
|
|
|
@ -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.
|
|
|
|
|
|
|
|
@ -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() |
|
|
|
|
|
|
|
@ -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) |
|
|
|
|
|
|
|
@ -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) |
|
|
|
|
|
|
|
@ -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() |
|
|
|
|
|
|
|
@ -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() |
|
|
|
|
|
|
|
@ -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]
|
|
|
|
|
|
|
|
@ -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(); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -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() |
|
|
|
|
|
|
|
@ -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.
|
|
|
|
|