|
|
|
@ -836,14 +836,6 @@ namespace SixLabors.ImageSharp |
|
|
|
return Sse2.ConvertToInt32(vsum); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Calculates floored log of the specified value, base 2.
|
|
|
|
/// Note that by convention, input value 0 returns 0 since Log(0) is undefined.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="value">The value.</param>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static int Log2(uint value) => BitOperations.Log2(value); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Fast division with ceiling for <see cref="uint"/> numbers.
|
|
|
|
/// </summary>
|
|
|
|
@ -852,24 +844,6 @@ namespace SixLabors.ImageSharp |
|
|
|
/// <returns>Ceiled division result.</returns>
|
|
|
|
public static uint DivideCeil(uint value, uint divisor) => (value + divisor - 1) / divisor; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Rotates the specified value left by the specified number of bits.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="value">The value to rotate.</param>
|
|
|
|
/// <param name="offset">The number of bits to rotate with.</param>
|
|
|
|
/// <returns>The rotated value.</returns>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static uint RotateLeft(uint value, int offset) => BitOperations.RotateLeft(value, offset); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Rotates the specified value right by the specified number of bits.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="value">The value to rotate.</param>
|
|
|
|
/// <param name="offset">The number of bits to rotate with.</param>
|
|
|
|
/// <returns>The rotated value.</returns>
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)] |
|
|
|
public static uint RotateRight(uint value, int offset) => BitOperations.RotateRight(value, offset); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Tells whether input value is outside of the given range.
|
|
|
|
/// </summary>
|
|
|
|
|