Пример #1
0
        public static byte[] DecodeRLE(VideoModeResolution size, byte[] data)
        {
            byte[] res = new byte[size.GetByteCount()];
            int    p   = 0;

            const int colBytes = 8;

            for (int i = 0; i < data.Length; i += 8)
            {
                // Ensure it looks correct
                if (!IsTerminator(data, i))
                {
                    Array.Copy(data, i, res, p, colBytes);
                    p += colBytes;
                    continue;
                }

                long count = BitConverter.ToInt64(data.Skip(i + 8).Take(8).Reverse().ToArray(), 0);
                i += 16;
                if (count == 0)
                {
                    continue;
                }

                // Find the pixels to repeat
                for (int o = 0; o < count; o++)
                {
                    Array.Copy(data, i, res, p, colBytes);
                    p += colBytes;
                }
            }

            return(res);
        }
Пример #2
0
 public static byte[] DecodeRLE(VideoModeResolution size, byte[] data)
 {
     return(DecodeRLESegment((uint)size.GetByteCount(), data).Item2);
 }
Пример #3
0
 public StillDownloadJobEntry(string deviceId, uint index, VideoModeResolution res, Action <DataTransferJob> notifyChanged) : this(deviceId,
                                                                                                                                   new DownloadMediaStillJob3(index, res.GetByteCount()), notifyChanged)
 {
 }