diff options
author | jsorg71 <jsorg71> | 2008-06-15 22:26:15 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2008-06-15 22:26:15 +0000 |
commit | 513a72e4d55315c2ac432d89939eca2f0f88a87a (patch) | |
tree | 13efeecce9cad9a1411eaf4e394649fa92413b3f /rdp/rdp_orders.c | |
parent | 31f19e5cd12972794c522d4d7f1436aa9f9b66c3 (diff) | |
download | xrdp-proprietary-513a72e4d55315c2ac432d89939eca2f0f88a87a.tar.gz xrdp-proprietary-513a72e4d55315c2ac432d89939eca2f0f88a87a.zip |
added more color conversion
Diffstat (limited to 'rdp/rdp_orders.c')
-rw-r--r-- | rdp/rdp_orders.c | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/rdp/rdp_orders.c b/rdp/rdp_orders.c index 020d6167..4bc4d057 100644 --- a/rdp/rdp_orders.c +++ b/rdp/rdp_orders.c @@ -1358,10 +1358,87 @@ rdp_orders_convert_bitmap(int in_bpp, int out_bpp, char* bmpdata, } return out; } + if ((in_bpp == 8) && (out_bpp == 24)) + { + out = (char*)g_malloc(width * height * 4, 0); + src = bmpdata; + dst = out; + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + pixel = *((tui8*)src); + pixel = palette[pixel]; + SPLITCOLOR32(red, green, blue, pixel); + pixel = COLOR24RGB(red, green, blue); + *((tui32*)dst) = pixel; + src++;; + dst += 4; + } + } + return out; + } + if ((in_bpp == 15) && (out_bpp == 16)) + { + out = (char*)g_malloc(width * height * 2, 0); + src = bmpdata; + dst = out; + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + pixel = *((tui16*)src); + SPLITCOLOR15(red, green, blue, pixel); + pixel = COLOR16(red, green, blue); + *((tui16*)dst) = pixel; + src += 2; + dst += 2; + } + } + return out; + } + if ((in_bpp == 15) && (out_bpp == 24)) + { + out = (char*)g_malloc(width * height * 4, 0); + src = bmpdata; + dst = out; + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + pixel = *((tui16*)src); + SPLITCOLOR15(red, green, blue, pixel); + pixel = COLOR24RGB(red, green, blue); + *((tui32*)dst) = pixel; + src += 2; + dst += 4; + } + } + return out; + } if ((in_bpp == 16) && (out_bpp == 16)) { return bmpdata; } + if ((in_bpp == 16) && (out_bpp == 24)) + { + out = (char*)g_malloc(width * height * 4, 0); + src = bmpdata; + dst = out; + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + pixel = *((tui16*)src); + SPLITCOLOR16(red, green, blue, pixel); + pixel = COLOR24RGB(red, green, blue); + *((tui32*)dst) = pixel; + src += 2; + dst += 4; + } + } + return out; + } if ((in_bpp == 24) && (out_bpp == 24)) { out = (char*)g_malloc(width * height * 4, 0); @@ -1411,10 +1488,38 @@ rdp_orders_convert_color(int in_bpp, int out_bpp, int in_color, int* palette) pixel = COLOR16(red, green, blue); return pixel; } + if ((in_bpp == 8) && (out_bpp == 24)) + { + pixel = palette[in_color]; + SPLITCOLOR32(red, green, blue, pixel); + pixel = COLOR24BGR(red, green, blue); + return pixel; + } + if ((in_bpp == 15) && (out_bpp == 16)) + { + pixel = in_color; + SPLITCOLOR15(red, green, blue, pixel); + pixel = COLOR16(red, green, blue); + return pixel; + } + if ((in_bpp == 15) && (out_bpp == 24)) + { + pixel = in_color; + SPLITCOLOR15(red, green, blue, pixel); + pixel = COLOR24BGR(red, green, blue); + return pixel; + } if ((in_bpp == 16) && (out_bpp == 16)) { return in_color; } + if ((in_bpp == 16) && (out_bpp == 24)) + { + pixel = in_color; + SPLITCOLOR16(red, green, blue, pixel); + pixel = COLOR24BGR(red, green, blue); + return pixel; + } if ((in_bpp == 24) && (out_bpp == 24)) { return in_color; |