Giter Site home page Giter Site logo

Comments (6)

AimplainLeo avatar AimplainLeo commented on July 2, 2024

And where this function is placed in project?

from magiccamera.

monxarat avatar monxarat commented on July 2, 2024

this function I put in the class Renderer.

from magiccamera.

AimplainLeo avatar AimplainLeo commented on July 2, 2024

Sorry, but i dont know where getBitmapWithFilter and createBitmap should be use! Could you show me that? Thank you very much!

from magiccamera.

monxarat avatar monxarat commented on July 2, 2024

Thank you for a reply.
Below code, I have implemented.

public abstract class EffectBaseViewRenderer implements GLSurfaceView.Renderer{

public void getBitmapWithFilter(final Bitmap bitmap, final File outFile, final OnBitmapReceiveListener onBitmapReceiveListener) {
        ......
    }

}


public abstract class EffectBase extends GLSurfaceBaseView {

   private EffectViewRenderer mEffectViewRenderer;
    ....
   public void getBitmapWithFilter(final Bitmap bitmap, final File outFile, final OnBitmapReceiveListener onBitmapReceiveListener) {
        mEffectViewRenderer.getBitmapWithFilter(bitmap, outFile, receiveListener);
        ....
    }
}

public class PlayerView extends EffectBase {

   .....
}

public class ExportImage extends AsyncTask<Void, Integer, Boolean> implements EffectBaseViewRenderer.OnBitmapReceiveListener {

private EffectBase mEffectBase;
...
@Override
    protected Boolean doInBackground(Void... voids) {
        while (index < count) {
            if (!isRunning) {
                isRunning = true;
                Bitmap bitmap = effectBase.getBitmap(index);
                final File outFile = new File(mFolderContaining, String.format(Locale.ENGLISH, Config.IN_FRAME_FORMAT, index));
                mEffectBase.getBitmapWithFilter(bitmap, outFile, this);
            }
        }
        return null;
    }
    ...
}

public class EditorViewBaseActivity extends BaseActivity {

private PlayerView mPlayerView;
 @Override
    public void onClick(final View v) {
    if (v == btnExport) {
          ExportImage exportImage = new ExportImage(EditorViewBaseActivity.this, mPlayerView);
          exportImage.setCount(mImageFolder.getCount());
          exportImage.execute();
          }
    }
               
}

from magiccamera.

xuzhiyong017 avatar xuzhiyong017 commented on July 2, 2024

// draw frame to texture
if(mFilter != null){
mFilter.onDrawFrame(mFrameBufferTextures[0], gLCubeBuffer, gLTextureBuffer);
} else {
imageInput.onDrawFrame(textureId, gLCubeBuffer, gLTextureBuffer);
}
Can two filters be superimposed?
for example
__
if(filter == null){
beautyFilter.onDrawFrame(textureId, gLCubeBuffer, gLTextureBuffer);
}else{
beautyFilter.onDrawFrame(textureId);
filter.onDrawFrame(mFrameBufferTextures[0], gLCubeBuffer, gLTextureBuffer);
}

from magiccamera.

AimplainLeo avatar AimplainLeo commented on July 2, 2024

Thank you so much! brs, Nam.

from magiccamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.