namespace ScreenConnect; public class WebColorScreenDecoder(IMultiCallCoder coder) : SimpleScreenDecoder(8, 0, coder) { private readonly byte[] map = new byte[6] { 0, 51, 102, 153, 204, 255 }; protected unsafe override void Process(byte* data, int width, int height, int stride, byte* workingBuffer, int rowLength, bool hasPadding) { fixed (byte* ptr = map) { int num = 0; while (num < height) { ReadRowData(workingBuffer, rowLength, num == height - 1); byte* ptr2 = workingBuffer; int* ptr3 = (int*)data; for (int i = 0; i < width; i++) { byte b = *(ptr2++); *(ptr3++) = -16777216 | ptr[b % 6] | (ptr[b % 36 / 6] << 8) | (ptr[b / 36] << 16); } num++; data += stride; } } } }