New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libvncclient] find a way to preset alpha data in framebuffer data #277
Comments
Hi Will, If you'd be able to use HTH, |
@bk138 Christian, thanks for the reply! 👍 I actually do skip What would be very helpful is if you could set the default alpha value per connection. I'm using FLTK with libvncclient and the drawing routines draw everything transparent (so not visible) from |
I can do some digging in the code, it's been a while since touched this. But should be possible! |
Hello, it's been a while. I have been experimenting with libvncclient 0.9.12 (from MacPorts) on macOS and now it appears I no longer need to set the alpha to 255. I looked through the commits but didn't see anything mentioning this issue. Was this issue resolved (in my case) by a commit for another issue? Thanks! 👍 |
Greetings again, after a long time! My message above was in error, the 'problem' is not resolved. @bk138 Is there some way, through Thank you! 👍 |
Same issue here, I solved it using the following code. However, it would be nice if libvnc would be able to set the alpha itself during frame buffer update. This way we would not have to loop over the framebuffer twice and save some cycles ... #define DUFFS_LOOP(pixel_copy_increment, width) \
{ int n = (width+7)/8; \
switch (width & 7) { \
case 0: do { pixel_copy_increment; \
case 7: pixel_copy_increment; \
case 6: pixel_copy_increment; \
case 5: pixel_copy_increment; \
case 4: pixel_copy_increment; \
case 3: pixel_copy_increment; \
case 2: pixel_copy_increment; \
case 1: pixel_copy_increment; \
} while ( --n > 0 ); \
} \
}
static void handleFrameBufferUpdate_alpha (struct _rfbClient *client, int x, int y, int w, int h)
{
int skip = (client->width - w) * 4; // 4 bytes per pixel (ARGB)
unsigned char *buffer = client->frameBuffer + (y * client->width + x) * 4;
DUFFS_LOOP ({
DUFFS_LOOP({
*buffer = 0xFF;
buffer+=4;
}, w);
buffer += skip;
}, h);
}
...
client->GotFrameBufferUpdate = handleFrameBufferUpdate_alpha;
... |
I have been using libvncclient for a while now in my project, but I still have not found a way to disable the alpha information on a client connection. I do not need or want the alpha information, so I am forced to go through the framebuffer and pick out the RGB data and then manually set the alpha to full so that my graphical toolkit will actually draw the image.
I am init'ing the connection like so (relevant code only):
I am setting the alpha to full from the framebuffer like so (simplified from the original):
To improve app performance, I want to avoid doing this extra step. Is there any way to disable alpha on the connection? If it's a specific kind of encoding, what kind would you suggest and how do I set this? The documentation is not super clear about how this is performed.
Thanks! 👍
The text was updated successfully, but these errors were encountered: