Kreyerja,
In St33d's post, he defined the splitImage function. i.e. it's not built into Processing, he defined (created) it, then made use of it.
The part which defines the splitImage function is this:
Code:
PImage [] splitImage(PImage splitMe, int ratio){
PImage [] buffer = new PImage[ratio * ratio];
int xStep = splitMe.width / ratio;
int yStep = splitMe.height / ratio;
for(int i = 0; i < buffer.length; i++){
buffer[i] = new PImage(xStep, yStep);
println((i / (splitMe.height/yStep)) * yStep);
buffer[i].copy(splitMe, (i * xStep) % splitMe.width, (i / (splitMe.height / yStep)) * yStep, xStep, yStep, 0, 0, buffer[i].width, buffer[i].height);
}
return buffer;
}
the first bit:
PImage []
Tells Processing that this function returns an array ([]) of images (PImage)
second bit:
splitImage
Gives this new function a name
Third bit:
(PImage splitMe, int ratio)
Tells processing what variables will be passed to the function. In this case an image (which will be called 'splitMe' inside the function) and an integer (which will be called 'ratio').
So if you want to use the splitImage function in your code, you will have to paste that ^ above bit of code into your sktech, then you use the function like this:
somearray = splitImage(yourimagename, ratiotosplit);
Like in his example, St33d does this:
buffer = splitImage(g,ratio);
If you're really new to this, that might be a bit much for now and you might be best off familiarising yourself with manipulating an image as an array of pixels and looking at copy()
http://processing.org/reference/pixels.html
http://processing.org/reference/copy_.html