Hi all,
I'm just wondering how I would go about splitting a pixel array (R,G,B,A,R,G,B,A,R,G,B,A,etc.) into 64x64 chunks. I've tried several methods myself but they all seem really over-complex and a bit too messy.
I have the following variables (obviously filled with information):
int nWidth, nHeight;
unsigned char *pImage;
And basically for each chunk I want to call:
void ProcessChunk(int x, int y, int width, int height)
You may be wondering why there is a width and height argument for the processing function, but if the image is not exactly divisible by 64, then there will be smaller chunks at the edge of the image (right-hand side and the bottom). See this image for a better understanding what I mean (red chunks are the chunks that will have <64 width or height arguments).
Thanks in advance.