Applying filters to image sequences.

edited March 2015 in Questions about Code

I have some images sequences in a grid on the left side of my main program window. They are used as buttons to change the content in a viewing area which are also image sequences.

I have incorporated a fade so when I click on an image in my grid the current image sequence displayed in the viewing area fades out and the new content fades in. This fade occurs only on the viewing area section (called as 'area' below).

I have been wanting to add some filters to my program to add other effects however when I go though the same process to apply a filter as I did with the fade the filter shows up on the grid of images as well as the viewing area.

Here is a simplified version of my program.

void draw() {
  for (int grid =0; grid<content.length; grid++) {
  tint(255);
  content[grid].display();
  if (content[grid].clicked) {
  img=grid;
  alpha = 0;
}
 area[img].display(alpha, Slider);
} 
 pushMatrix();
 if (alpha<255) {
 alpha += 10;
 } else {
 alpha = 0;
 }
 popMatrix();
 }

And here is the display part of my viewer class (called as area above).

  void display(float alpha) {
  currentFrame = (currentFrame+1) % numFrames;
  tint(255, alpha);
  image(viewImages[(currentFrame) % numFrames], 504, 0);
  filter(POSTERIZE, Slider);
}

I have resolved my issue of the filter showing up on the grid as well as the viewing area by changing this line "filter(POSTERIZE, 4);" with "viewImages[(currentFrame) % numFrames].filter(POSTERIZE, Slider);"

However now I am not calling image before view images. Therefore if the value of Slider changes it it not updated because I am not calling image again.

Is there a way to update the value of Slider even if I am still on the same image sequence?

Thanks.

Tagged:

Answers

  • I don't understand what Slider is in your code. Is it just an integer? Why the capital S? (which is source of confusion...)

Sign In or Register to comment.