| 44 | } |
| 45 | |
| 46 | static BYTE *CaptureEnc(BYTE *src, BYTE *dst, int width) |
| 47 | { |
| 48 | int rleLength; |
| 49 | |
| 50 | do { |
| 51 | BYTE rlePixel = *src; |
| 52 | *src++; |
| 53 | rleLength = 1; |
| 54 | |
| 55 | width--; |
| 56 | |
| 57 | while (rlePixel == *src) { |
| 58 | if (rleLength >= 63) |
| 59 | break; |
| 60 | if (!width) |
| 61 | break; |
| 62 | rleLength++; |
| 63 | |
| 64 | width--; |
| 65 | src++; |
| 66 | } |
| 67 | |
| 68 | if (rleLength > 1 || rlePixel > 0xBF) { |
| 69 | *dst = rleLength | 0xC0; |
| 70 | *dst++; |
| 71 | } |
| 72 | |
| 73 | *dst = rlePixel; |
| 74 | *dst++; |
| 75 | } while (width); |
| 76 | |
| 77 | return dst; |
| 78 | } |
| 79 | |
| 80 | static bool CapturePix(WORD width, WORD height, WORD stride, BYTE *pixels, std::ofstream *out) |
| 81 | { |