namespace ScreenConnect; public abstract class SimpleScreenDecoder : SimpleScreenCodec { private IMultiCallCoder coder; protected SimpleScreenDecoder(int bitsPerPixel, int rowPadding, IMultiCallCoder coder) : base(bitsPerPixel, rowPadding) { this.coder = coder; } protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { coder.DisposeQuietly(); } } protected unsafe void ReadRowData(byte* data, int rowLength, bool isLastRow) { ReadThroughCoder(coder, data, rowLength, isLastRow); } protected unsafe override void Process(byte* data, int width, int height, int stride) { int rowLength = GetRowLength(width); fixed (byte* workingBuffer = GetWorkingBuffer(rowLength)) { Process(data, width, height, stride, workingBuffer, rowLength, base.RowPadding != 0); } } protected unsafe abstract void Process(byte* data, int width, int height, int stride, byte* workingBuffer, int rowLength, bool hasPadding); }