asutherland / ni-controllers-lib

Modernized fork of met5678/node-traktor-f1 to support Maschine Mk3, Maschine Mk2 mikro, Traktor D2, and Traktor F1 Native Instruments controllers. Probably can support others too!
24 stars 7 forks source link

Accept RGB data as input for LCD displays #7

Closed jraoult closed 4 years ago

jraoult commented 4 years ago

What does this PR do?

Most drawing methods and image decompression libraries deliver RGB888 data rather than RGB565. I'm personally very interested in using the canvas' ImageData. This PR main goal is to enable the users to pass RGB data to the paintDisplay method so that they don't have to do the conversion from RGB565.

Doing so I also fixed a bug in the node USB adapter where the interface wasn't properly claimed. I also try to reduce data copy and buffer allocation to the bare minimum. I even enable a way for the caller to reuse the buffer from call to call.

How should this be tested by the reviewer?

I added a bit in the demo app that displays a picture of someone playing the guitar. It should show on the left screen of the Maschine MK3. It should work for both web and Node runtimes.

jraoult commented 4 years ago

@asutherland what do you think of this proposal?

jraoult commented 4 years ago

It would be good to clarify the origins of the image, its author, and its license

Good point, it is indeed the picture. I'll add this in the merge commit message.