public void RenderGray2(DMDFrame frame) { if (!_isOpen) { Init(); } int width = frame.width; int height = frame.height; if (_gray2Colorizer != null && frame.width == 128 && frame.height == 16 && _gray2Colorizer.Has128x32Animation) { // Pin2DMD colorization may have 512 byte masks with a 128x16 source, // indicating this should be upsized and treated as a centered 128x32 DMD. height = frame.height; height *= 2; _gray2Colorizer.SetDimensions(width, height); if (_upsizedFrame == null) { _upsizedFrame = new DMDFrame() { width = width, height = height, Data = new byte[width * height] } } ; Buffer.BlockCopy(frame.Data, 0, _upsizedFrame.Data, 8 * width, frame.Data.Length); _vpmGray2Source.NextFrame(_upsizedFrame); } else { _gray2Colorizer?.SetDimensions(width, height); _gray4Colorizer?.SetDimensions(width, height); _vpmGray2Source.NextFrame(frame); } }
public void RenderGray2(int width, int height, byte[] frame) { _gray2Colorizer?.SetDimensions(width, height); _gray4Colorizer?.SetDimensions(width, height); _vpmGray2Source.NextFrame(width, height, frame); }