diff options
| author | Jay Sorg <jay.sorg@gmail.com> | 2014-06-10 17:49:15 -0700 |
|---|---|---|
| committer | Jay Sorg <jay.sorg@gmail.com> | 2014-06-10 17:49:15 -0700 |
| commit | 73bdb57ee27221f8bcce35b895afdb0df9fbb801 (patch) | |
| tree | f615a12a697829ce1f9eb77bf098707d0b4d3786 /libxrdp/xrdp_bitmap32_compress.c | |
| parent | d9b87e734b04dc860f46f2cfd6e9c34787e1c891 (diff) | |
| download | xrdp-proprietary-73bdb57ee27221f8bcce35b895afdb0df9fbb801.tar.gz xrdp-proprietary-73bdb57ee27221f8bcce35b895afdb0df9fbb801.zip | |
more fixes for 32 bit color
Diffstat (limited to 'libxrdp/xrdp_bitmap32_compress.c')
| -rw-r--r-- | libxrdp/xrdp_bitmap32_compress.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/libxrdp/xrdp_bitmap32_compress.c b/libxrdp/xrdp_bitmap32_compress.c index b1aaaa9a..6af7ed75 100644 --- a/libxrdp/xrdp_bitmap32_compress.c +++ b/libxrdp/xrdp_bitmap32_compress.c @@ -49,17 +49,20 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, int jindex; int cx; int cy; + int header; - alpha_data = g_malloc(width * height * 4, 0); - red_data = alpha_data + width * height; - green_data = red_data + width * height; - blue_data = green_data + width * height; + header = 0x20; /* no alpha TODO */ + + cx = width + e; + cy = 0; + alpha_data = g_malloc(cx * height * 4, 0); + red_data = alpha_data + cx * height; + green_data = red_data + cx * height; + blue_data = green_data + cx * height; alpha_bytes = 0; red_bytes = 0; green_bytes = 0; blue_bytes = 0; - cx = width; - cy = 0; /* split planes */ while (start_line >= 0) @@ -78,14 +81,29 @@ xrdp_bitmap32_compress(char *in_data, int width, int height, blue_data[blue_bytes] = pixel >> 0; blue_bytes++; } + for (iindex = 0; iindex < e; iindex++) + { + alpha_data[alpha_bytes] = 0; + alpha_bytes++; + red_data[red_bytes] = 0; + red_bytes++; + green_data[green_bytes] = 0; + green_bytes++; + blue_data[blue_bytes] = 0; + blue_bytes++; + } start_line--; cy++; } - out_uint8(s, 0x20); /* no alpha */ + out_uint8(s, header); out_uint8a(s, red_data, red_bytes); out_uint8a(s, green_data, green_bytes); out_uint8a(s, blue_data, blue_bytes); - out_uint8(s, 0x00); + if ((header & 0x10) == 0) + { + /* pad if no RLE */ + out_uint8(s, 0x00); + } g_free(alpha_data); return cy; } |
