1 #define OUT_T CONCAT3E(uint,OUT,_t)
2 #define FUNCTION CONCAT2E(FUNCNAME,OUT)
4 static void FUNCTION(rfbScreenInfoPtr screen)
6 OUT_T* buffer = (OUT_T*)screen->frameBuffer;
7 int i, j, w = screen->width, h = screen->height;
8 OUT_T* newBuffer = (OUT_T*)malloc(w * h * sizeof(OUT_T));
10 for (j = 0; j < h; j++)
11 for (i = 0; i < w; i++)
12 newBuffer[FUNC(i, j)] = buffer[i + j * w];
14 memcpy(buffer, newBuffer, w * h * sizeof(OUT_T));
19 screen->paddedWidthInBytes = h * OUT / 8;
23 rfbClientIteratorPtr iterator;
25 iterator = rfbGetClientIterator(screen);
26 while ((cl = rfbClientIteratorNext(iterator)) != NULL)
27 cl->newFBSizePending = 1;
31 rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height);
35 void FUNCNAME(rfbScreenInfoPtr screen) {
36 if (screen->serverFormat.bitsPerPixel == 32)
37 CONCAT2E(FUNCNAME,32)(screen);
38 else if (screen->serverFormat.bitsPerPixel == 16)
39 CONCAT2E(FUNCNAME,16)(screen);
40 else if (screen->serverFormat.bitsPerPixel == 8)
41 CONCAT2E(FUNCNAME,8)(screen);
43 rfbErr("Unsupported pixel depth: %d\n",
44 screen->serverFormat.bitsPerPixel);