summaryrefslogtreecommitdiffstats
path: root/vnc
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2007-04-28 17:44:36 +0000
committerjsorg71 <jsorg71>2007-04-28 17:44:36 +0000
commit1cd6c0c2fc74b045cf5f3f4189ce54cb9fbc8834 (patch)
treede8d3105a6e178429e4da5a0d21fe4835b468caf /vnc
parent13fa0768a78f8a694617b1350ce552b487366cf1 (diff)
downloadxrdp-proprietary-1cd6c0c2fc74b045cf5f3f4189ce54cb9fbc8834.tar.gz
xrdp-proprietary-1cd6c0c2fc74b045cf5f3f4189ce54cb9fbc8834.zip
24 bit color
Diffstat (limited to 'vnc')
-rw-r--r--vnc/vnc.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/vnc/vnc.c b/vnc/vnc.c
index d5501838..e2f390bb 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -492,6 +492,14 @@ get_pixel_safe(char* data, int x, int y, int width, int height, int bpp)
{
return *(((unsigned short*)data) + (y * width + x));
}
+ else if (bpp == 24 || bpp == 32)
+ {
+ return *(((unsigned int*)data) + (y * width + x));
+ }
+ else
+ {
+ g_writeln("error in get_pixel_safe bpp %d", bpp);
+ }
return 0;
}
@@ -543,6 +551,10 @@ set_pixel_safe(char* data, int x, int y, int width, int height, int bpp,
*(data + (3 * (y * width + x)) + 1) = pixel >> 8;
*(data + (3 * (y * width + x)) + 2) = pixel >> 16;
}
+ else
+ {
+ g_writeln("error in set_pixel_safe bpp %d", bpp);
+ }
}
/******************************************************************************/
@@ -564,6 +576,16 @@ split_color(int pixel, int* r, int* g, int* b, int bpp, int* palette)
*g = ((pixel >> 3) & 0xfc) | ((pixel >> 9) & 0x3);
*b = ((pixel << 3) & 0xf8) | ((pixel >> 2) & 0x7);
}
+ else if (bpp == 24 || bpp == 32)
+ {
+ *r = (pixel >> 16) & 0xff;
+ *g = (pixel >> 8) & 0xff;
+ *b = pixel & 0xff;
+ }
+ else
+ {
+ g_writeln("error in split_color bpp %d", bpp);
+ }
return 0;
}
@@ -575,6 +597,10 @@ make_color(int r, int g, int b, int bpp)
{
return (r << 16) | (g << 8) | b;
}
+ else
+ {
+ g_writeln("error in make_color bpp %d", bpp);
+ }
return 0;
}
@@ -613,6 +639,10 @@ lib_framebuffer_update(struct vnc* v)
data = 0;
num_recs = 0;
Bpp = (v->mod_bpp + 7) / 8;
+ if (Bpp == 3)
+ {
+ Bpp = 4;
+ }
make_stream(s);
init_stream(s, 8192);
error = lib_recv(v, s->data, 3);
@@ -704,7 +734,8 @@ lib_framebuffer_update(struct vnc* v)
}
else
{
- g_sprintf(text, "error in lib_framebuffer_update");
+ g_sprintf(text, "error in lib_framebuffer_update encoding = %8.8x",
+ encoding);
v->server_msg(v, text, 1);
}
}
@@ -908,9 +939,10 @@ lib_mod_connect(struct vnc* v)
v->server_msg(v, "started connecting", 0);
check_sec_result = 1;
/* only support 8 and 16 bpp connections from rdp client */
- if (v->server_bpp != 8 && v->server_bpp != 16)
+ if ((v->server_bpp != 8) && (v->server_bpp != 16) && (v->server_bpp != 24))
{
- v->server_msg(v, "error - only supporting 8 and 16 bpp rdp connections", 0);
+ v->server_msg(v, "error - only supporting 8, 16 and 24 bpp rdp \
+connections", 0);
return 1;
}
if (g_strcmp(v->ip, "") == 0)