Hi folks,
I just retook my code of a prototype initiated one month ago about a little iOS app which produce some strange fx on picture taken with the cam.
I’d like to process an array of pixels, so I’m doing that:
unsigned char *pixels = photo.getPixels();
int w = photo.width;
int h = photo.height;
int skip = 10;
for(int j = 0; j < h; j+=skip){
for(int i = 0; i < w; i+=skip){
int index = j*w*4 + i*4;
int valueR = pixels[index];
int valueG = pixels[index+1];
int valueB = pixels[index+2];
ofSetColor(valueR,valueG,valueB);
ofRect(i, j, skip, skip);
}
}
This is a very basic code producing a pixelization
But the result is inverted.
Second question, I’d like to put the result into another ofImage in order to convert it as an UIImage in a further routine.
Any one would help with that ?