Coder Social home page Coder Social logo

yutouxiansheng / glcamerademo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangshengyang1996/glcamerademo

0.0 1.0 0.0 10.64 MB

多种方式实现相机圆形预览,其中OpenGL的方式还包含灰度预览、雕塑化预览

Java 99.52% GLSL 0.48%

glcamerademo's Introduction

使用多种方式实现圆形预览

  • 使用Camera API和Camera2 API并选择最接近正方形的预览尺寸

  • 使用Camera API并为其动态添加一层父控件,达到正方形预览的效果

  • 使用Camera API获取预览数据,使用OpenGL的方式进行显示

  • 左侧使用1088x1088的分辨率,TextureView和GLSurfaceView的显示效果相同,均为正方形;
    右侧使用1920x1080的分辨率,TextureView显示效果为长方形,GLSurfaceView显示效果为TextureView显示内容中心的正方形部分

TextureView + GLSurfaceView,1088x1088 TextureView + GLSurfaceView,1920x1080

2019.8.10 更新:

添加滤镜,实现灰度效果预览和浮雕效果预览(其实灰度和浮雕效果不需要 U V 数据,偷个懒没加判断)

灰度效果 浮雕效果

glcamerademo's People

Contributors

wangshengyang1996 avatar

Watchers

 avatar

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.