Created
January 29, 2017 23:41
-
-
Save antonfirsov/a43391087d5d0e18370b5b1454b51daf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |
public unsafe void CopyColorsTo(Span<byte> buffer, int stride, Block8x8F* tempBlockPtr) | |
{ | |
this.TransformByteConvetibleColorValuesInto(ref *tempBlockPtr); | |
float* src = (float*)tempBlockPtr; | |
for (int i = 0; i < 8; i++) | |
{ | |
buffer[0] = (byte)src[0]; | |
buffer[1] = (byte)src[1]; | |
buffer[2] = (byte)src[2]; | |
buffer[3] = (byte)src[3]; | |
buffer[4] = (byte)src[4]; | |
buffer[5] = (byte)src[5]; | |
buffer[6] = (byte)src[6]; | |
buffer[7] = (byte)src[7]; | |
if (i < 7) | |
{ | |
buffer = buffer.Slice(stride); | |
} | |
src += 8; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment