Skip to content
Filter rendering for Android,can add filter effect to GLSurfaceView using OpenGL. 视频滤镜渲染处理,可以添加多种滤镜,使用了OpenGL
Java GLSL
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
filterrenderer first commit Aug 25, 2018
gradle/wrapper first commit Aug 25, 2018
sample first commit Aug 25, 2018
screenshot first commit Aug 25, 2018
.gitignore first commit Aug 25, 2018
README.md Create README.md Aug 25, 2018
build.gradle first commit Aug 25, 2018
gradle.properties first commit Aug 25, 2018
gradlew first commit Aug 25, 2018
gradlew.bat first commit Aug 25, 2018
settings.gradle first commit Aug 25, 2018

README.md

FilterRenderer

Filter rendering for Android,can add filter effect to GLSurfaceView using OpenGL. 视频滤镜渲染处理,可以添加多种滤镜,使用了OpenGL

screenshot1~

Usage

1.New a renderer and call glsurfaceview.setRenderer

 FilterRenderer mRenderer = new FilterRenderer(glSurfaceView);
 
 //set renderer
 glSurfaceView.setEGLContextClientVersion(2);
 glSurfaceView.setRenderer(mRenderer);
 glSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
 
 
 //add listener for surfacetexture
 mRenderer.setSurfaceListener(new FilterRenderer.SurfaceListener() {
            @Override
            public void onSurfaceTextureAvailable(SurfaceTexture surface) {

                // use surfacetexture
            }

            @Override
            public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {

            }
        });
   
  
        

2.Set filter you want

  //New a filter implement you want 
  GLFilter mFilter = new LookupGLFilter(MainActivity.this, R.raw.pic_table);
  
  mRenderer.setFilter(mFilter);
  
  //if you don't want any filter,just call mRenderer.setFilter(null);
 
  

License

Copyright 2018 Zolad

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You can’t perform that action at this time.