Giter VIP home page Giter VIP logo

camerafilter's Introduction

###CameraFilter

研究 Android 用 OpenGL ES 2.0 处理相机预览和滤镜。

#####实时滤镜 使用 GLSurfaceView 显示相机画面,用 OpenGL 实现不同滤镜效果。

android-gpuimage 使用 GL_TEXTURE_2D 作为纹理目标。 在处理相机预览画面时,需要将每帧的图像颜色由 YUV 转成 RBGA,画面不流畅。

这里使用 GL_TEXTURE_EXTERNAL_OES 作为纹理目标,绕过了 YUV 转 RBGA 步骤。 另外简单处理了一下预览画面的比例。

#####录制视频 使用 grafika 方案(需要Android 4.3),用 MediaCodec、MediaMuxer 编码生成 MP4。使用 MediaCodec 的 createInputSurface,接收来自 OpenGL 渲染的画面。

#####图片滤镜 与 android-gpuimage 一样,使用 GL_TEXTURE_2D 作为纹理目标,传入需要处理的图片,然后用滤镜渲染。不过因为纹理目标不同,不能直接套用相机的滤镜,导致每个滤镜分别要写两次……

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.