bitfocus / loupedeck-ct

Loupedeck CT Node.js module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pixel buffer memory layout is 5-6-5, not 5-3-5

Corion opened this issue · comments

Hi all,

thanks again for your very helpful Javascript code!

I'm playing around with a Loupedeck CT myself and documented the issue for Lua as well ( CommandPost/CommandPost#2369 ).

The pixel buffer memory layout is 5-6-5 r-g-b , and the bytes are stored little-endian. The code in index.js calculates the number as 5-5-3 r-b-g , big-endian. The upper "unused" three bits of the number belong to green.

I can't run your code, so I have to make vague suggestions here, but I think the two changes should be:

  1. Change the rgb2int() function to return a 5-6-5 number.
  2. Write that number as little-endian byte sequence instead of big-endian byte sequence.

Are you sure about this? I am pretty sure we tested every bit, and 3 of them was doing nothing, hence 5,5,3. Are you getting results on all the bits? Wonder how we were seeing something different then. And the colors reproduced by our rgb2col is producing images nicely. I don't have it in front of me to test now though.

The code I have works on my Loupedeck CT, but maybe I have a different firmware version. I have only talked to the device via Websocket (Linux) and never updated it or connected it to the official (Windows) app.

The colours on "your" version lack 3 bits of green, so maybe try setting the high bits too in the final 16-bit numbers, to see if you get more levels of green that way.

FWIW - All Loupedeck CT's are currently all running the same firmware version. I don't believe there's been a firmware update yet - although one is due at some point soon to solve the macOS sleep issue.

Here's the fix we applied to CommandPost which seemed to work:

CommandPost/CommandPost-App@fba903b