Closed piccinnigius closed 3 years ago
Hey, the protocol consists of a Json array, which contains as many Json objects as the set number of pixels. A Json object contains the RGB color ("value") represented as 4 bytes integer and the alpha value ("falpha"), which is actually always 0.0.
Example packet (2 pixels):
[{"value":-65536,"falpha":0.0},{"value":-65536,"falpha":0.0}]
value
parametervalue '-65536' converted to binary (2's complement):
11111111 11111111 00000000 00000000
== red
11111111 00000000 00000000 00000000
would be black
falpha
parameterHere are the relevant lines in the code:
However, I had planned to rework and optimize the protocol (only send colors as bytes and not serialized as json). As soon as the new protocol is ready, I would post it here.
Hi @Drumber sorry for late feedback. I would like to reach a point where the server can be called throght websocket or some generic js apis! As soon as I can make a test i and I will keep you updated under this issue
Awesome work! only one question, wich is the server protocol of json? i've tried to send the json array over 20002 port but i've got only errors in decoding...
Thanks so much!