Thought I'd let you know about this app I made. Available for free on the android market:
here . Feedback is much appreciated! The framerate is quite slow but that seems quite common. Would've liked to have build in some integration particularly with facebook (as it is under the name of a facebook character) but couldn't get my head around Eclipse or their APIs. I'll save it for the update.
This is probably a simple problem but I can't seem to find a solution. Working with the Shiffman example to get the brightness of an images pixels, I want to make a new array out of these brightness values in order to get the min() and max() brightness values
At the moment I have
PImage img;
void setup(){
img=loadImage("example.jpg");
}
void draw(){
img.loadPixels();
for (int x = 0; x < img.width; x++ ) {
for (int y = 0; y < img.height; y++ ) {
int loc = x + y*img.width;
float[] brightArray=new float[loc];
for (int i=0;i<brightArray.length;i++) {
brightArray[i]=brightness(img.pixels[loc]);
}
float maxBright=max(brightArray);
float minBright=min(brightArray);
float range=maxBright-minBright;
}
}
}
I know this (line 16) is not really the right place to introduce a new array but I can't do so until [loc] has a value....? I am getting an error message saying the min() and max() cannot be got from an empty array.