Skip to content
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

GUACAMOLE VNC corrected translation values to RGB #412

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/protocols/vnc/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ void guac_vnc_cursor(rfbClient* client, int x, int y, int w, int h, int bpp) {
else alpha = 0x00;

/* Translate value to RGB */
red = (v >> client->format.redShift) * 0x100 / (client->format.redMax + 1);
green = (v >> client->format.greenShift) * 0x100 / (client->format.greenMax+ 1);
blue = (v >> client->format.blueShift) * 0x100 / (client->format.blueMax + 1);
red = ((v >> client->format.redShift) & client->format.redMax) * 0xFF / client->format.redMax;
green = ((v >> client->format.greenShift) & client->format.greenMax)* 0xFF / client->format.greenMax;
blue = ((v >> client->format.blueShift) & client->format.blueMax) * 0xFF / client->format.blueMax;

/* Output ARGB */
if (vnc_client->settings->swap_red_blue)
Expand Down
6 changes: 3 additions & 3 deletions src/protocols/vnc/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ void guac_vnc_update(rfbClient* client, int x, int y, int w, int h) {
}

/* Translate value to RGB */
red = (v >> client->format.redShift) * 0x100 / (client->format.redMax + 1);
green = (v >> client->format.greenShift) * 0x100 / (client->format.greenMax+ 1);
blue = (v >> client->format.blueShift) * 0x100 / (client->format.blueMax + 1);
red = ((v >> client->format.redShift) & client->format.redMax) * 0xFF / client->format.redMax;
green = ((v >> client->format.greenShift) & client->format.greenMax)* 0xFF / client->format.greenMax;
blue = ((v >> client->format.blueShift) & client->format.blueMax) * 0xFF / client->format.blueMax;

/* Output RGB */
if (vnc_client->settings->swap_red_blue)
Expand Down