node-pixel icon indicating copy to clipboard operation
node-pixel copied to clipboard

Add matrix support

Open ajfisher opened this issue 10 years ago • 6 comments

Add the ability to have a rectangular matrix of pixels and support this natively.

ajfisher avatar May 24 '15 09:05 ajfisher

In multipin multiple strips will be available as well as single strip

Matrix support need to support (at minimum):

  • RC, CR order
  • 3 dimensional matrices
  • Take single strip and split into a matrix NxM (eg 1x25 single strip can become 5x5 square)

ajfisher avatar Dec 03 '15 02:12 ajfisher

Take single strip and split into a matrix NxM (eg 1x25 single strip can become 5x5 square)

This is exactly what I came here to find out if this library can do. I know its been a few years now, do we foresee this ever actually happening?

VictorioBerra avatar Aug 15 '18 18:08 VictorioBerra

Unfortunately my time is pretty limited at the moment but PRs are gratefully received. I can help guide you through what's needed to be done too.

On Thu, Aug 16, 2018, 04:05 Victorio Berra [email protected] wrote:

Take single strip and split into a matrix NxM (eg 1x25 single strip can become 5x5 square)

This is exactly what I came here to find out if this library can do. I know its been a few years now, do we foresee this ever actually happening?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ajfisher/node-pixel/issues/20#issuecomment-413283622, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHRowfiyIRUcxpUxSHsXTnUwuW4DEIEks5uRGLcgaJpZM4EnR00 .

ajfisher avatar Aug 15 '18 21:08 ajfisher

What is rc, cr order?

jakepearse avatar Dec 11 '18 21:12 jakepearse

Row-column or column-row order. It's used to designate how you apply a 2D matrix to a 1D array.

On Wed, Dec 12, 2018, 08:22 jakepearse [email protected] wrote:

What is rc, cr order?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ajfisher/node-pixel/issues/20#issuecomment-446366895, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHRo8pYG_wOXco2UjsCHzFe_llBEomNks5u4CIngaJpZM4EnR00 .

ajfisher avatar Dec 11 '18 21:12 ajfisher

My son and I have been playing with this requirement. Rather than messing about with a bunch of arrays, we used functions to re-map the addresses of pixels in a serpentine array. Because node-pixel uses functions for addressing rather than presenting strips as 'array-like'. It wouldn't take much to add cr/rc functionality, I guess. Although it would perhaps add the need for an argument/options style object, using minor/major axis rather than column/row. Which would probably better than a bunch of unnamed positional arguments the way we did it. Anyway its all in a nice-and-small PR :)

jakepearse avatar Feb 17 '19 09:02 jakepearse