|
|
@ -201,7 +201,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
public void CopyTo(Span<float> dest) |
|
|
public void ScaledCopyTo(Span<float> dest) |
|
|
{ |
|
|
{ |
|
|
ref byte d = ref Unsafe.As<float, byte>(ref MemoryMarshal.GetReference(dest)); |
|
|
ref byte d = ref Unsafe.As<float, byte>(ref MemoryMarshal.GetReference(dest)); |
|
|
ref byte s = ref Unsafe.As<Block8x8F, byte>(ref this); |
|
|
ref byte s = ref Unsafe.As<Block8x8F, byte>(ref this); |
|
|
@ -215,7 +215,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
/// <param name="blockPtr">Pointer to block</param>
|
|
|
/// <param name="blockPtr">Pointer to block</param>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
public static unsafe void CopyTo(Block8x8F* blockPtr, Span<byte> dest) |
|
|
public static unsafe void ScaledCopyTo(Block8x8F* blockPtr, Span<byte> dest) |
|
|
{ |
|
|
{ |
|
|
float* fPtr = (float*)blockPtr; |
|
|
float* fPtr = (float*)blockPtr; |
|
|
for (int i = 0; i < Size; i++) |
|
|
for (int i = 0; i < Size; i++) |
|
|
@ -231,9 +231,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
/// <param name="blockPtr">The block pointer.</param>
|
|
|
/// <param name="blockPtr">The block pointer.</param>
|
|
|
/// <param name="dest">The destination.</param>
|
|
|
/// <param name="dest">The destination.</param>
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
public static unsafe void CopyTo(Block8x8F* blockPtr, Span<float> dest) |
|
|
public static unsafe void ScaledCopyTo(Block8x8F* blockPtr, Span<float> dest) |
|
|
{ |
|
|
{ |
|
|
blockPtr->CopyTo(dest); |
|
|
blockPtr->ScaledCopyTo(dest); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
@ -241,7 +241,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
public unsafe void CopyTo(float[] dest) |
|
|
public unsafe void ScaledCopyTo(float[] dest) |
|
|
{ |
|
|
{ |
|
|
fixed (void* ptr = &this.V0L) |
|
|
fixed (void* ptr = &this.V0L) |
|
|
{ |
|
|
{ |
|
|
@ -253,7 +253,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
/// Copy raw 32bit floating point data to dest
|
|
|
/// Copy raw 32bit floating point data to dest
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
/// <param name="dest">Destination</param>
|
|
|
public unsafe void CopyTo(Span<int> dest) |
|
|
public unsafe void ScaledCopyTo(Span<int> dest) |
|
|
{ |
|
|
{ |
|
|
fixed (Vector4* ptr = &this.V0L) |
|
|
fixed (Vector4* ptr = &this.V0L) |
|
|
{ |
|
|
{ |
|
|
@ -268,7 +268,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components |
|
|
public float[] ToArray() |
|
|
public float[] ToArray() |
|
|
{ |
|
|
{ |
|
|
var result = new float[Size]; |
|
|
var result = new float[Size]; |
|
|
this.CopyTo(result); |
|
|
this.ScaledCopyTo(result); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|