Problem looping through a 4D array

:wink:

MY problem is that I don’t really understand what @RichardDL 's code is doing!

Is it making the patterns for ONE gray scale (which one, 12??) or for all?

I suggested to make the result of brightness(fromPixel) to int to get 0 to 255 as a result.
Then we would need 256 different sets of patterns.

My approach

My approach is simple:

First Line of thought

  • PixelRepresentation[][] myList; holds the image as patterns (2D array)
  • PixelRepresentation contains a 2D array of the pattern (probably this is unnecessary because we have ListOfPermuts)

The 2nd Line of thought

  • ListOfPermuts[] permuts holds a 256 long list (one for each int(brightness()) )
  • ListOfPermuts holds an ArrayList to hold the patterns for each brightness (different numbers)

The 3rd Line of thought

  • To bring this together, we for loop-for loop over the image and fill PixelRepresentation[][] myList; with brightnesses
  • We fill ListOfPermuts[] permuts with permuts for each brightness
  • We display myList which uses the permuts with its brightness and animates over the patterns in its ArrayList

I hope this helps!

Chrisir

1 Like