Correction to color inversion

This commit is contained in:
Sharat M R 2019-04-24 19:57:15 +05:30
parent db25a5a0c1
commit 97a620482c
No known key found for this signature in database
GPG Key ID: E450A6E45DAE1B94
1 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ static NSLock *lock;
static size_t width; static size_t width;
static size_t height; static size_t height;
static size_t byte_per_pixel; static size_t byte_per_pixel;
static const size_t bits_per_sample = 8;
static CFTypeRef (*$GSSystemCopyCapability)(CFStringRef); static CFTypeRef (*$GSSystemCopyCapability)(CFStringRef);
static CFTypeRef (*$GSSystemGetCapability)(CFStringRef); static CFTypeRef (*$GSSystemGetCapability)(CFStringRef);
@ -46,8 +47,11 @@ static void VNCSetup() {
int argc(1); int argc(1);
char *arg0(strdup("ScreenDumpVNC")); char *arg0(strdup("ScreenDumpVNC"));
char *argv[] = {arg0, NULL}; char *argv[] = {arg0, NULL};
screen = rfbGetScreen(&argc, argv, width, height, 8, 3, byte_per_pixel); screen = rfbGetScreen(&argc, argv, width, height, bits_per_sample, 3, byte_per_pixel);
screen->frameBuffer = (char *)malloc(width*height*byte_per_pixel); screen->frameBuffer = (char *)malloc(width*height*byte_per_pixel);
screen->serverFormat.redShift = bits_per_sample * 2;
screen->serverFormat.greenShift = bits_per_sample * 1;
screen->serverFormat.blueShift = bits_per_sample * 0;
free(arg0); free(arg0);
} }