(Rect r, Object buffer,
int buflen, ServerParams server,
ModifiablePixelBuffer pb)
| 63 | } |
| 64 | |
| 65 | public void decodeRect(Rect r, Object buffer, |
| 66 | int buflen, ServerParams server, |
| 67 | ModifiablePixelBuffer pb) |
| 68 | { |
| 69 | MemInStream is = new MemInStream((byte[])buffer, 0, buflen); |
| 70 | PixelFormat pf = server.pf(); |
| 71 | switch (pf.bpp) { |
| 72 | case 8: zrleDecode8(r, is, zis, pf, pb); break; |
| 73 | case 16: zrleDecode16(r, is, zis, pf, pb); break; |
| 74 | case 32: |
| 75 | { |
| 76 | if (pf.depth <= 24) { |
| 77 | int maxPixel = pf.pixelFromRGB(-1, -1, -1, pf.getColorModel()); |
| 78 | boolean fitsInLS3Bytes = maxPixel < (1<<24); |
| 79 | boolean fitsInMS3Bytes = (maxPixel & 0xff) == 0; |
| 80 | |
| 81 | if ((fitsInLS3Bytes && pf.isLittleEndian()) || |
| 82 | (fitsInMS3Bytes && pf.isBigEndian())) |
| 83 | { |
| 84 | zrleDecode24A(r, is, zis, pf, pb); |
| 85 | break; |
| 86 | } |
| 87 | |
| 88 | if ((fitsInLS3Bytes && pf.isBigEndian()) || |
| 89 | (fitsInMS3Bytes && pf.isLittleEndian())) |
| 90 | { |
| 91 | zrleDecode24B(r, is, zis, pf, pb); |
| 92 | break; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | zrleDecode32(r, is, zis, pf, pb); |
| 97 | break; |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | private static enum PIXEL_T { U8, U16, U24A, U24B, U32 }; |
| 103 |
nothing calls this directly
no test coverage detected