Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

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

Open
Corion opened this issue Jul 7, 2020 · 4 comments
Open

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

Corion opened this issue Jul 7, 2020 · 4 comments

Comments

@Corion
Copy link

Corion commented Jul 7, 2020

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.
@haakonnessjoen
Copy link
Member

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.

@Corion
Copy link
Author

Corion commented Jul 7, 2020

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.

@latenitefilms
Copy link

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.

@latenitefilms
Copy link

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

CommandPost/CommandPost-App@fba903b

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants