BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.25k stars 4.61k forks source link

Low pass filter pauses when filterStrength is at 1.0 #2335

Open iobroyles opened 8 years ago

iobroyles commented 8 years ago

Hello, this is more a curiosity, I noticed that when setting .filterStrength on a LowPass filter to 1.0 it loops the last two frames.

I'm wondering if there is a clean way to get only one frame to pause instead of looping two? I looked at how it's using a buffer but I can't seem to make just one frame pause.

I want to have multiple live camera inputs displayed with the ability to pause and unpause one or both at will.

Thanks for any advice and thank you for your time.

BradLarson commented 8 years ago

A 1.0 filter strength simply means that the rolling average doesn't actually average anything, it just uses the last frame's colors and doesn't care about any incoming frames. Therefore, the frozen image. 0.0 means it uses only the colors from the input frame, 0.5 uses half the color from the incoming frame and half the color from the previous aggregate, and 1.0 uses all the color from the aggregate with no contribution from the incoming frame.

I'm not sure that there is a great way to pull a single frame and pause it for later reuse in any of the stock operations. You might be able to rewrite something like the buffer to pull a single framebuffer and hold onto it for later use.