diff options
| author | Jay Sorg <jay.sorg@gmail.com> | 2014-06-10 16:25:54 -0700 |
|---|---|---|
| committer | Jay Sorg <jay.sorg@gmail.com> | 2014-06-10 16:25:54 -0700 |
| commit | 5d495539196d4c9645f50fbb8f685b33ea5c5820 (patch) | |
| tree | d190afbd4d2276683885f092cd9abcb1938d6329 /xrdp/xrdp_bitmap.c | |
| parent | 547a34cb6c8c75bea5e021b7d5b7385ef481b4ce (diff) | |
| download | xrdp-proprietary-5d495539196d4c9645f50fbb8f685b33ea5c5820.tar.gz xrdp-proprietary-5d495539196d4c9645f50fbb8f685b33ea5c5820.zip | |
work on 32 bit planar bitmap compressor
Diffstat (limited to 'xrdp/xrdp_bitmap.c')
| -rw-r--r-- | xrdp/xrdp_bitmap.c | 79 |
1 files changed, 74 insertions, 5 deletions
diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 49750221..87fb0ebc 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -679,7 +679,7 @@ xrdp_bitmap_get_pixel(struct xrdp_bitmap *self, int x, int y) { return GETPIXEL16(self->data, x, y, self->width); } - else if (self->bpp == 24) + else if (self->bpp >= 24) { return GETPIXEL32(self->data, x, y, self->width); } @@ -712,7 +712,7 @@ xrdp_bitmap_set_pixel(struct xrdp_bitmap *self, int x, int y, int pixel) { SETPIXEL16(self->data, x, y, self->width, pixel); } - else if (self->bpp == 24) + else if (self->bpp >= 24) { SETPIXEL32(self->data, x, y, self->width, pixel); } @@ -779,7 +779,7 @@ xrdp_bitmap_copy_box(struct xrdp_bitmap *self, return 1; } - if (self->bpp == 24) + if (self->bpp >= 24) { s32 = ((tui32 *)(self->data)) + (self->width * y + x); d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); @@ -849,7 +849,7 @@ xrdp_bitmap_hash_crc(struct xrdp_bitmap *self) int index; char hash_data[16]; - if (self->bpp == 24) + if (self->bpp >= 24) { bytes = self->width * self->height * 4; } @@ -953,7 +953,76 @@ xrdp_bitmap_copy_box_with_crc(struct xrdp_bitmap *self, CRC_PASS(self->height, crc); CRC_PASS(self->height >> 8, crc); - if (self->bpp == 24) + if (self->bpp == 32) + { + s32 = ((tui32 *)(self->data)) + (self->width * y + x); + d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); + incs = self->width - cx; + incd = dest->width - cx; + + for (i = 0; i < cy; i++) + { + j = 0; + + while (j < cx - 4) + { + pixel = *s32; + *d32 = pixel; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + CRC_PASS(pixel >> 24, crc); + s32++; + d32++; + + pixel = *s32; + *d32 = pixel; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + CRC_PASS(pixel >> 24, crc); + s32++; + d32++; + + pixel = *s32; + *d32 = pixel; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + CRC_PASS(pixel >> 24, crc); + s32++; + d32++; + + pixel = *s32; + *d32 = pixel; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + CRC_PASS(pixel >> 24, crc); + s32++; + d32++; + + j += 4; + } + while (j < cx) + { + pixel = *s32; + *d32 = pixel; + CRC_PASS(pixel, crc); + CRC_PASS(pixel >> 8, crc); + CRC_PASS(pixel >> 16, crc); + CRC_PASS(pixel >> 24, crc); + s32++; + d32++; + + j += 1; + } + + s32 += incs; + d32 += incd; + } + } + else if (self->bpp == 24) { s32 = ((tui32 *)(self->data)) + (self->width * y + x); d32 = ((tui32 *)(dest->data)) + (dest->width * desty + destx); |
