hi, im very new with openframeworks im trying to make an old program i did before with processing in of.
The program works in this way, the program iterates over all the pixels of an image and create 3 news vectors or arrays based in its luminosty. My question is : which is the best way to converting back a vector into a image? if this is not possible which is the best way to draw a vector as an image?
here is an example of the code:
the 3 vectos are: oscuros, medios and claros, thanks
void testApp::keyPressed (int key){
if (key = 358){
unsigned char * pixels = img.getPixels();
int w = img.width;
int h = img.height;
vector<int> claros;
vector<int> medios;
vector<int> oscuros;
for (int i = 0; i < w; i++){
for (int j = 0; j < h; j++){
int value = pixels[j * w + i];
//cout << value << endl;
if (value >= 0 && value <= 50)
oscuros.push_back(value);
else if (value >= 51 && value <= 101)
medios.push_back(value);
else
claros.push_back(value);
}
}
//cout < claros.
}
}