Silence-GitHub / BBMetalImage

A high performance Swift library for GPU-accelerated image/video processing based on Metal.
MIT License
988 stars 126 forks source link

How could I change the image when apply the tool chain? #47

Closed lygialiem closed 4 years ago

lygialiem commented 4 years ago

Hi team.

I'm make an iOS App which can let user edit their image. In my way, I apply the tool chain asynchronously. And then let user change the param like brightness, contrast... . But now I want to change the image in BBMetalStaticImageSource(image: newImage). But the lastTool.outputTexture.bb_image does not produce any image when I change the param of filter. I don't know why? Could you give me some suggestion? Thank you very much,.

Silence-GitHub commented 4 years ago

Please try version 1.1.3

Here is sample code.

imageSource = BBMetalStaticImageSource(image: oldImage)
imageSource.add(consumer: filter)
imageSource.transmitTexture()
...

// Update image and transmit texture
imageSource.update(newImage)
imageSource.transmitTexture()
lygialiem commented 4 years ago

Hi.

Thanks for you quick response. I really appreciate your help. When I apply update function, it issued the error: Thread 1: EXC_BAD_ACCESS (code=1, address=0x0). My logic is very simple. I make chain filter at viewDidLoad, and when user press the button, the update(newImage) will be called to change another image. The error appear at the function update(newImage).

Silence-GitHub commented 4 years ago

Sorry, I can not reproduce the bug. Please show me the code or sample project.

lygialiem commented 4 years ago

Hi Team!.

Thank you for your response. After I made another sample code to send to you. It seemed that the bug didn't happend. So the bug is on my side totally in the main project. I'll double check again.

Once again. Thank you very much for your supporting.