From bd9e5747e514ad33adc050a81dc4ff09a2a188e7 Mon Sep 17 00:00:00 2001 From: dscho Date: Mon, 10 Feb 2003 14:16:32 +0000 Subject: added colourmapexample; fixed LinuxVNC to show the right colours --- examples/colourmaptest.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 examples/colourmaptest.c (limited to 'examples/colourmaptest.c') diff --git a/examples/colourmaptest.c b/examples/colourmaptest.c new file mode 100644 index 0000000..1e03f9e --- /dev/null +++ b/examples/colourmaptest.c @@ -0,0 +1,32 @@ +#include "rfb.h" + + +int main(int argc,char** argv) +{ + int i; + uint8_t bytes[256*3]; + + rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,256,256,8,1,1); + + server->rfbServerFormat.trueColour=FALSE; + server->colourMap.count=256; + server->colourMap.is16=FALSE; + for(i=0;i<256;i++) { + bytes[i*3+0]=255-i; /* red */ + bytes[i*3+1]=0; /* green */ + bytes[i*3+2]=i; /* blue */ + } + bytes[128*3+0]=0xff; + bytes[128*3+1]=0; + bytes[128*3+2]=0; + server->colourMap.data.bytes=bytes; + + server->frameBuffer=malloc(256*256); + for(i=0;i<256*256;i++) + server->frameBuffer[i]=(i/256); + + rfbInitServer(server); + rfbRunEventLoop(server,-1,FALSE); + + return(0); +} -- cgit v1.2.3