We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey Guys,
I'm quite new in Programming. English is not my native language (and programming-language neither :P), but I will try to explain my question the best I can.
My main-question is: Where can I find the code of the methods loadPixels() and updatePixels()? I searched for the source code at GitHub but those two methods were not written there.
I want to write a program where many different pictures can be stored and drawn again; loadPixels und updatePixels store an image in an array called pixels[]. I want to modify those two methods, so I can store pictures in more than one array.
I would be glad if you guys can help me :)
xzap
Answers
A) loadPixels():
B) updatePixels():
"I want to modify those two methods, so I can store pictures in more than one array."
That's not the right approach. You don't change Processing to make it do what you want, you build code around the functions it exposes, to do what you want.
Here, if you want to duplicate the pixels[] array, just use arrayCopy() (see the Reference page).
And the sumtotal of an array of pixels[] is called a PImage. Maybe you just need a bunch of PImages, then you can access the pixels from each as you like. Often it works better if you describe the problem, instead of asking for a specific solution.
Late answer, but I solved it with a copy of pixels[]. Thanks for your help!