Hi all,
Processing newbie (part of an image processing course) here, my aim is to create a color corrector with a graph that you can change, changing the output of the RGB values of my picture (
sort of like this)
At the moment I'm focusing on getting the graph to be interactive, and once that's done I'll load it into the project with my image. Here's what I have so far:
- void setup()
- {
- int[ ] coords = {
- 0, 100, 100, 0
- };
- int i;
- noFill();
- stroke(0);
- beginShape();
- curveVertex(0, 100); // the first control point
- curveVertex(0, 100); // is also the start point of curve
- curveVertex(30, 50);
- curveVertex(100, 0); // the last point of curve
- curveVertex(100, 0); // is also the last control point
- endShape();
- }
I need to make it so when I click my mouse, it takes the x and y co-ordinate of where I just clicked and changes the values of line 14
If anyone could help me there, that'd be a great start.
After that I need to somehow correlate the values of that curve to change the RGB values of my picture, heres an excerpt of that project:
- RedPanda.loadPixels();
- RedPandaCC.loadPixels();
- for (int i=0; i < dimension; i+=1) {
- RedPandaCC.pixels[i] = color( red(RedPanda.pixels[i]), green(RedPanda.pixels[i]), blue(RedPanda.pixels[i]) );
- }
Greatly appreciated,
Danny
1