Closed lygialiem closed 4 years ago
Is there anyway to insert one or two New Filter to the chain with the same ImageSource?
This library only provides add(consumer:)
to set up filter chain now. Maintaining filter chain is our work.
There may be problems in your code.
Each filter in allTools
calls add(consumer:)
more than once. If a filter needs only one consumer, we should not call add(consumer:)
more than once without removing old consumers.
The reset()
function of BBMetalImageSource
is private. How can you call it like imageSource?.reset()
? If we don't need the image source anymore, we don't need to call reset()
. Removing consumers is enough. If we need to keep it and set up a new filter chain, remove old consumers and add new ones. If we need to change the image, call update(_:)
function.
Hi! Thank you for your suporting.
allTools
, so I make a loop in allTools
to make a chain with imageSource
. I created bbMetalImgSource
to chain every tool in allTools
.revmove old consumers
, you are meaning that we make it nil
, right?If we call a filter function add(consumer:)
twice, the filter has 2 consumers. If the filter needs only one consumer, we should call removeAllConsumers()
before each calling add(consumer:)
.
Hi Silence-GitHub! It's me again. I have an issue about imageSource = BBMetalStaticImageSource(image: UIImage) which chains about 14 BBMetalBaseFilter. Then I have a button, when click on that, I want to create a new imageSource and add one more BBMetalBaseFilter so that the chains now have 15 tool. But when I touched the button, App did not reply anything (It did not crash, memory measure still fine, also CPU processing). Here is my code:
Same as step 1.