wysaid / android-gpuimage-plus

Android Image & Camera Filters Based on OpenGL.
MIT License
1.82k stars 475 forks source link

unable to get the bitmap of a requested render / resultBitmap #448

Closed moelle89 closed 4 years ago

moelle89 commented 4 years ago

hey, I am actually a Graphic Designer with just limited java development skills, so please forgive me if my question might sound weird or dumb. I really tried to figure it out by myself so far, yet wasnt able to find a proper way to do it.

So, I got setup an ImageGLSurfaceView with a bitmap and filterConfig by using a setSurfaceCreatedCallback. Everything works fine, but at a certain point I need to get the actual resultBitmap (or requested render ) provided as a Bitmap, to be able to modify it outside of the SurfaceView and finally get it back into the render-process to keep on using it on my surfaceView.

I would love to know about the proper way to get the resultBitmap or at least the latest render provided as "cached" Bitmap to use it on a different class. - If i save it as a local file, it works fine. I just want to avoid that.

createImageFromBitmap(bmp) works fine using that Callback:

    mImageView.getResultBitmap(new ImageGLSurfaceView.QueryResultBitmapCallback() {
        @Override
        public void get(Bitmap bmp) {
            **createImageFromBitmap(bmp);**
        }});

But if i am trying to do use the Bitmap bmp like a common bitmap to be used by another class, it doesnt work at all.

    mImageView.getResultBitmap(new ImageGLSurfaceView.QueryResultBitmapCallback() {
        @Override
        public void get(Bitmap bmp) {
            **externClass.setImage(bmp);**
        }});

So whats the deal? What do i completely miss? I used similar GPUimage libs before, fortunately the all pulled the requestedRender or ResultImage without any required Callbacks or queueEvent, "unfortunately" they cant compete with this awesome library!

wysaid commented 4 years ago

Please produce the problem with the demo. And I will take a look for that.

moelle89 commented 4 years ago

Please produce the problem with the demo. And I will take a look for that.

Thank you! I just managed to find the issue by trying to reproduce the issue with the demo. I was using the QueryResultBitmapCallback in a wrong way. - Sorry, for that.

moelle89 commented 4 years ago

Okay there is still something I couldnt figure out;

as I mentioned, at a certain point, I take the resultBitmap, modify it within another class and then I' m adding it back into the surfaceView.

Then I need to have all basic filters + seekbars reset. How can I reset the whole cobfig? Tge demo only shows how to reset the last filter.

wysaid commented 4 years ago

Okay there is still something I couldnt figure out;

as I mentioned, at a certain point, I take the resultBitmap, modify it within another class and then I' m adding it back into the surfaceView.

Then I need to have all basic filters + seekbars reset. How can I reset the whole cobfig? Tge demo only shows how to reset the last filter.

It's just a demo. Maybe you can do those things on your own way.

moelle89 commented 4 years ago

Okay there is still something I couldnt figure out; as I mentioned, at a certain point, I take the resultBitmap, modify it within another class and then I' m adding it back into the surfaceView. Then I need to have all basic filters + seekbars reset. How can I reset the whole cobfig? Tge demo only shows how to reset the last filter.

It's just a demo. Maybe you can do those things on your own way.

Gotcha, I'm sorry if I was bothering. Thanks for taking time to respond, though.