├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── example ├── .DS_Store ├── android │ ├── .gitignore │ ├── .idea │ │ ├── caches │ │ │ └── build_file_checksums.ser │ │ ├── codeStyles │ │ │ └── Project.xml │ │ ├── compiler.xml │ │ ├── gradle.xml │ │ ├── jarRepositories.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ └── vcs.xml │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── rex │ │ │ │ └── gpu │ │ │ │ └── demo │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ │ ├── filter0.png │ │ │ │ ├── filter1.png │ │ │ │ ├── filter10.png │ │ │ │ ├── filter11.png │ │ │ │ ├── filter13.png │ │ │ │ ├── filter15.png │ │ │ │ ├── filter16.png │ │ │ │ ├── filter17.png │ │ │ │ ├── filter18.png │ │ │ │ ├── filter2.png │ │ │ │ ├── filter20.png │ │ │ │ ├── filter21.png │ │ │ │ ├── filter3.png │ │ │ │ ├── filter4.png │ │ │ │ ├── filter5.png │ │ │ │ ├── filter6.png │ │ │ │ ├── filter7.png │ │ │ │ ├── filter8.png │ │ │ │ ├── filter86.png │ │ │ │ ├── filter9.png │ │ │ │ ├── logo.png │ │ │ │ └── suyan.jpeg │ │ │ ├── cpp │ │ │ │ ├── Android.mk │ │ │ │ ├── Application.mk │ │ │ │ ├── gpu │ │ │ │ └── native │ │ │ │ │ ├── Android.mk │ │ │ │ │ └── NativeLoad.cpp │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── rex │ │ │ │ │ ├── gpu │ │ │ │ │ ├── GPU.java │ │ │ │ │ ├── GPURawBytesCallback.java │ │ │ │ │ ├── GPUVideoFrame.java │ │ │ │ │ └── demo │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ ├── PictureActivity.java │ │ │ │ │ │ └── TextureActivity.java │ │ │ │ │ ├── load │ │ │ │ │ └── NativeLoad.java │ │ │ │ │ └── utils │ │ │ │ │ ├── ApkUtil.java │ │ │ │ │ ├── CameraUtil.java │ │ │ │ │ ├── DeviceUtil.java │ │ │ │ │ ├── FileUtil.java │ │ │ │ │ ├── HttpUtil.java │ │ │ │ │ ├── LogUtil.java │ │ │ │ │ └── ManifestUtil.java │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_picture.xml │ │ │ │ └── activity_texture.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── rex │ │ │ └── gpu │ │ │ └── demo │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── ios │ ├── .DS_Store │ ├── ZipArchive │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE.txt │ ├── ObjectiveCExample │ │ ├── ObjectiveCExample.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ ├── ObjectiveCExample_iOS.xcscheme │ │ │ │ ├── ObjectiveCExample_macOS.xcscheme │ │ │ │ └── ObjectiveCExample_tvOS.xcscheme │ │ ├── ObjectiveCExample.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── ObjectiveCExample │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── Sample Data │ │ │ │ ├── 1.md │ │ │ │ ├── 2.md │ │ │ │ └── mountain.png │ │ │ ├── ViewController.h │ │ │ ├── ViewController.m │ │ │ └── main.m │ │ ├── ObjectiveCExampleTests │ │ │ ├── CancelDelegate.h │ │ │ ├── CancelDelegate.m │ │ │ ├── CollectingDelegate.h │ │ │ ├── CollectingDelegate.m │ │ │ ├── Fixtures │ │ │ │ ├── Empty.zip │ │ │ │ ├── IncorrectHeaders.zip │ │ │ │ ├── PathTraversal.zip │ │ │ │ ├── RelativeSymbolicLink.zip │ │ │ │ ├── SymbolicLink.zip │ │ │ │ ├── TestArchive.zip │ │ │ │ ├── TestPasswordArchive.zip │ │ │ │ ├── Unicode.zip │ │ │ │ └── hello.zip │ │ │ ├── Info.plist │ │ │ ├── Multi_Zip_Test │ │ │ │ ├── 0.m4a │ │ │ │ ├── 1.m4a │ │ │ │ ├── 2.m4a │ │ │ │ ├── 3.m4a │ │ │ │ ├── 4.m4a │ │ │ │ ├── 5.m4a │ │ │ │ ├── 6.m4a │ │ │ │ └── 7.m4a │ │ │ ├── ProgressDelegate.h │ │ │ ├── ProgressDelegate.m │ │ │ └── SSZipArchiveTests.m │ │ ├── Podfile │ │ └── Podfile.lock │ ├── README.md │ ├── Release-Instructions.md │ ├── SSZipArchive.podspec │ ├── SSZipArchive │ │ ├── Info.plist │ │ ├── SSZipArchive.h │ │ ├── SSZipArchive.m │ │ ├── SSZipCommon.h │ │ ├── ZipArchive.h │ │ └── minizip │ │ │ ├── aes │ │ │ ├── aes.h │ │ │ ├── aes_ni.c │ │ │ ├── aes_ni.h │ │ │ ├── aescrypt.c │ │ │ ├── aeskey.c │ │ │ ├── aesopt.h │ │ │ ├── aestab.c │ │ │ ├── aestab.h │ │ │ ├── brg_endian.h │ │ │ ├── brg_types.h │ │ │ ├── fileenc.c │ │ │ ├── fileenc.h │ │ │ ├── hmac.c │ │ │ ├── hmac.h │ │ │ ├── prng.c │ │ │ ├── prng.h │ │ │ ├── pwd2key.c │ │ │ ├── pwd2key.h │ │ │ ├── sha1.c │ │ │ └── sha1.h │ │ │ ├── crypt.c │ │ │ ├── crypt.h │ │ │ ├── ioapi.c │ │ │ ├── ioapi.h │ │ │ ├── ioapi_buf.c │ │ │ ├── ioapi_buf.h │ │ │ ├── ioapi_mem.c │ │ │ ├── ioapi_mem.h │ │ │ ├── minishared.c │ │ │ ├── minishared.h │ │ │ ├── unzip.c │ │ │ ├── unzip.h │ │ │ ├── zip.c │ │ │ └── zip.h │ ├── SwiftExample │ │ ├── Cartfile │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── SwiftExample.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ ├── SwiftExample.xcscheme │ │ │ │ └── SwiftExampleCarthage.xcscheme │ │ ├── SwiftExample.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── SwiftExample │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── Sample Data │ │ │ │ ├── 1.md │ │ │ │ ├── 2.md │ │ │ │ └── mountain.png │ │ │ └── ViewController.swift │ │ └── SwiftExampleTests │ │ │ ├── Info.plist │ │ │ └── SwiftExampleTests.swift │ ├── ZipArchive.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── ZipArchive-Mac.xcscheme │ │ │ ├── ZipArchive-iOS.xcscheme │ │ │ ├── ZipArchive-tvos.xcscheme │ │ │ └── ZipArchive-watchos.xcscheme │ └── icon.png │ ├── example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── Rex.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── Visionin.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── Rex.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ ├── example.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── Visionin.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── example.xcscheme │ │ └── xcschememanagement.plist │ └── example │ ├── .DS_Store │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── GPUVideoCamera.h │ ├── GPUVideoCamera.m │ ├── HomeViewController.h │ ├── HomeViewController.m │ ├── ImageViewController.h │ ├── ImageViewController.mm │ ├── Info.plist │ ├── PictureViewController.h │ ├── PictureViewController.mm │ ├── ViewController.h │ ├── ViewController.mm │ ├── facepoints.json │ ├── filter.zip │ ├── filter0.png │ ├── filter1.png │ ├── filter10.png │ ├── filter11.png │ ├── filter13.png │ ├── filter15.png │ ├── filter16.png │ ├── filter17.png │ ├── filter18.png │ ├── filter2.png │ ├── filter20.png │ ├── filter21.png │ ├── filter3.png │ ├── filter4.png │ ├── filter5.png │ ├── filter6.png │ ├── filter7.png │ ├── filter8.png │ ├── filter86.png │ ├── filter9.png │ ├── logo.png │ ├── main.m │ └── suyan.jpeg └── src ├── .DS_Store ├── Android.mk ├── base ├── .DS_Store ├── Android.mk ├── GL.h ├── GPU.h ├── GPUBlendFilter.cpp ├── GPUBlendFilter.h ├── GPUContext.cpp ├── GPUContext.h ├── GPUFileFilter.cpp ├── GPUFileFilter.h ├── GPUFilter.cpp ├── GPUFilter.h ├── GPUFrameBuffer.cpp ├── GPUFrameBuffer.h ├── GPUGroupFilter.cpp ├── GPUGroupFilter.h ├── GPUInput.cpp ├── GPUInput.h ├── GPULineFilter.cpp ├── GPULineFilter.h ├── GPUOutput.cpp ├── GPUOutput.h ├── GPUOutputFilter.cpp ├── GPUOutputFilter.h ├── GPUPicture.cpp ├── GPUPicture.h ├── GPUPixelBuffer.cpp ├── GPUPixelBuffer.h ├── GPUProgram.cpp ├── GPUProgram.h ├── GPURawGroup.cpp ├── GPURawGroup.h ├── GPURawInput.cpp ├── GPURawInput.h ├── GPURawOutput.cpp ├── GPURawOutput.h ├── GPUTextureInput.cpp ├── GPUTextureInput.h ├── GPUTriangleFilter.h ├── GPUTriangleFilter.h.cpp ├── GPUTwoPassFilter.cpp ├── GPUTwoPassFilter.h ├── GPUVertexBuffer.cpp ├── GPUVertexBuffer.h ├── GPUView.h ├── GPUYUV420Filter.cpp ├── GPUYUV420Filter.h ├── GPUYUVFilter.cpp ├── GPUYUVFilter.h ├── GPUZoomFilter.cpp ├── GPUZoomFilter.h ├── android │ ├── .DS_Store │ ├── GPUEglContext.cpp │ ├── GPUPicture.cpp │ └── GPUView.cpp └── ios │ ├── .DS_Store │ ├── GPUContext.mm │ ├── GPUIOSBuffer.h │ ├── GPUIOSBuffer.mm │ ├── GPUIOSView.h │ ├── GPUIOSView.mm │ ├── GPUPicture.mm │ ├── GPUSampleBufferInput.h │ └── GPUSampleBufferInput.mm ├── bs ├── .DS_Store ├── Android.mk ├── Makefile ├── bs.h ├── bs_common.c ├── bs_common.h ├── bs_conf.c ├── bs_conf.h ├── bs_cqueue.c ├── bs_cqueue.h ├── bs_data.c ├── bs_data.h ├── bs_def.h ├── bs_error.h ├── bs_file.c ├── bs_file.h ├── bs_hashmap.c ├── bs_hashmap.h ├── bs_list.c ├── bs_list.h ├── bs_lock.c ├── bs_lock.h ├── bs_log.c ├── bs_log.h ├── bs_macros.h ├── bs_mmap.c ├── bs_mmap.h ├── bs_object.c ├── bs_object.h ├── bs_pack.c ├── bs_pack.h ├── bs_pool.c ├── bs_pool.h ├── bs_sign.c ├── bs_sign.h ├── bs_socket.c ├── bs_socket.h ├── bs_string.c ├── bs_string.h ├── bs_struct.h ├── bs_timer.c ├── bs_timer.h ├── bs_type.h ├── bs_url.c ├── bs_url.h ├── bs_vector.c ├── bs_vector.h ├── ios.mk ├── linux.mk └── mac.mk ├── filter ├── .DS_Store ├── Android.mk ├── GPUBezierFilter.cpp ├── GPUBezierFilter.h ├── GPUBilateralBlurFilter.cpp ├── GPUBilateralBlurFilter.h ├── GPUBlankFilter.cpp ├── GPUBlankFilter.h ├── GPUBlend2Filter.cpp ├── GPUBlend2Filter.h ├── GPUBlendImageFilter.cpp ├── GPUBlendImageFilter.h ├── GPUColorFilter.cpp ├── GPUColorFilter.h ├── GPUGaussianBlurFilter.cpp ├── GPUGaussianBlurFilter.h ├── GPULookupFilter.cpp ├── GPULookupFilter.h ├── GPULuminanceFilter.cpp ├── GPULuminanceFilter.h ├── GPUMedianFilter.cpp ├── GPUMedianFilter.h ├── GPUOutlineFilter.cpp ├── GPUOutlineFilter.h ├── GPUPaintFilter.cpp ├── GPUPaintFilter.h ├── GPUPixellateFilter.cpp ├── GPUPixellateFilter.h ├── GPUPixellatePositionFilter.cpp ├── GPUPixellatePositionFilter.h ├── GPUSaturationFilter.cpp ├── GPUSaturationFilter.h ├── GPUSmoothFilter.cpp ├── GPUSmoothFilter.h ├── GPUSobelEdgeFilter.cpp ├── GPUSobelEdgeFilter.h ├── GPUWhiteningFilter.cpp └── GPUWhiteningFilter.h ├── frame ├── .DS_Store ├── Android.mk ├── GPUStreamFrame.cpp ├── GPUStreamFrame.h ├── android │ ├── .DS_Store │ └── android_gpu.cpp └── ios │ ├── .DS_Store │ ├── GPUVideoFrame.h │ └── GPUVideoFrame.mm ├── libGPU.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ ├── Rex.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── Visionin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── Rex.xcuserdatad │ └── xcschemes │ │ ├── libGPU.xcscheme │ │ └── xcschememanagement.plist │ └── Visionin.xcuserdatad │ └── xcschemes │ ├── libGPU.xcscheme │ └── xcschememanagement.plist └── output ├── .DS_Store └── include ├── .DS_Store ├── GL.h ├── GPU.h ├── GPUBezierFilter.h ├── GPUBilateralBlurFilter.h ├── GPUBlankFilter.h ├── GPUBlend2Filter.h ├── GPUBlendFilter.h ├── GPUBlendImageFilter.h ├── GPUColorFilter.h ├── GPUContext.h ├── GPUFileFilter.h ├── GPUFilter.h ├── GPUFrameBuffer.h ├── GPUGaussianBlurFilter.h ├── GPUGroupFilter.h ├── GPUIOSBuffer.h ├── GPUIOSView.h ├── GPUInput.h ├── GPULineFilter.h ├── GPULookupFilter.h ├── GPULuminanceFilter.h ├── GPUMedianFilter.h ├── GPUOutlineFilter.h ├── GPUOutput.h ├── GPUOutputFilter.h ├── GPUPaintFilter.h ├── GPUPicture.h ├── GPUPixelBuffer.h ├── GPUPixellateFilter.h ├── GPUPixellatePositionFilter.h ├── GPUProgram.h ├── GPURawInput.h ├── GPURawOutput.h ├── GPUSampleBufferInput.h ├── GPUSaturationFilter.h ├── GPUSmoothFilter.h ├── GPUSobelEdgeFilter.h ├── GPUStreamFrame.h ├── GPUTextureInput.h ├── GPUTriangleFilter.h ├── GPUTwoPassFilter.h ├── GPUVertexBuffer.h ├── GPUVideoFrame.h ├── GPUView.h ├── GPUWhiteningFilter.h ├── GPUYUV420Filter.h ├── GPUYUVFilter.h ├── GPUZoomFilter.h ├── bs.h ├── bs_common.h ├── bs_conf.h ├── bs_cqueue.h ├── bs_data.h ├── bs_def.h ├── bs_error.h ├── bs_file.h ├── bs_hashmap.h ├── bs_list.h ├── bs_lock.h ├── bs_log.h ├── bs_macros.h ├── bs_mmap.h ├── bs_object.h ├── bs_pack.h ├── bs_pool.h ├── bs_sign.h ├── bs_socket.h ├── bs_string.h ├── bs_struct.h ├── bs_timer.h ├── bs_type.h ├── bs_url.h └── bs_vector.h /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | *.lai 22 | *.la 23 | *.a 24 | *.lib 25 | 26 | # Executables 27 | *.exe 28 | *.out 29 | *.app 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libGPU 2 | 一个类似GPUImage的跨平台图片、视频处理库。 3 | 4 | C++实现,完美支持安卓+ios,cpu占用率大约是GPUImage的1/3。 5 | 6 | 包含安卓+ios的美颜+滤镜+裁剪+转码功能 7 | 8 | ### 功能列表 9 | * pipeline:多种filter串行叠加 10 | * 滤镜:十几款滤镜 11 | * 裁剪+缩放 12 | * 叠加:随意添加元素、logo、水印等 13 | * 转码,rgb <-> yuv <-> nv21、nv12、I420 14 | 15 | ### History 16 | * 2018.3.27 适配opengles 3.0 17 | * 2018.7.15 添加安卓、ios相机滤镜demo 18 | * 2022.2.12 处理几个编译错误和滤镜加载错误,注意打开demo app前授予权限。 19 | 20 | # English 21 | An cross-platform open source framework for GPU-based image and video processing like GPUImage 22 | -------------------------------------------------------------------------------- /example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/.DS_Store -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /example/android/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /example/android/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /example/android/.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /example/android/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.rex.gpu.demo" 7 | minSdkVersion 21 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | debug { 20 | jniDebuggable true 21 | } 22 | } 23 | sourceSets.main{ 24 | jni.srcDirs = ['cpp'] 25 | } 26 | externalNativeBuild { 27 | ndkBuild { 28 | path 'src/main/cpp/Android.mk' 29 | } 30 | } 31 | } 32 | 33 | dependencies { 34 | implementation fileTree(include: ['*.jar'], dir: 'libs') 35 | implementation 'com.android.support:appcompat-v7:27.1.1' 36 | implementation 'com.android.support.constraint:constraint-layout:1.1.2' 37 | testImplementation 'junit:junit:4.12' 38 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 39 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 40 | } 41 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /example/android/app/src/androidTest/java/com/rex/gpu/demo/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.rex.gpu.demo; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.rex.gpu.demo", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter0.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter1.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter10.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter11.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter13.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter15.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter16.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter17.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter18.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter2.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter20.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter21.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter3.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter4.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter5.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter6.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter7.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter8.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter86.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter86.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/filter9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/filter9.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/logo.png -------------------------------------------------------------------------------- /example/android/app/src/main/assets/suyan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neilcz/libGPU/38d5512eb888f2d69be0800220427c5539317ce2/example/android/app/src/main/assets/suyan.jpeg -------------------------------------------------------------------------------- /example/android/app/src/main/cpp/Android.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2009 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | include $(all-subdir-makefiles) 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/cpp/Application.mk: -------------------------------------------------------------------------------- 1 | #APP_ABI := all 2 | #APP_ABI := armeabi-v7a 3 | APP_ABI := armeabi-v7a arm64-v8a 4 | # 推荐使用stl库 5 | APP_STL := c++_static 6 | #APP_PLATFORM := android-19 7 | # 调试 8 | #APP_OPTIM := debug 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/cpp/gpu: -------------------------------------------------------------------------------- 1 | ../../../../../../src -------------------------------------------------------------------------------- /example/android/app/src/main/cpp/native/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_MODULE_FILENAME = libnative 5 | LOCAL_CFLAGS := -D__ANDROID__ -D__DEBUG__ -g 6 | 7 | LOCAL_SRC_FILES := \ 8 | NativeLoad.cpp 9 | 10 | LOCAL_LDLIBS := -llog -landroid -ldl 11 | LOCAL_MODULE := native 12 | 13 | include $(BUILD_SHARED_LIBRARY) 14 | 15 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rex/gpu/GPURawBytesCallback.java: -------------------------------------------------------------------------------- 1 | package com.rex.gpu; 2 | 3 | /** 4 | * Created by Visionin on 16/7/27. 5 | */ 6 | public interface GPURawBytesCallback { 7 | public void outputBytes(byte[] bytes); 8 | } 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rex/load/NativeLoad.java: -------------------------------------------------------------------------------- 1 | package com.rex.load; 2 | 3 | import android.content.Context; 4 | import com.rex.utils.DeviceUtil; 5 | 6 | /** 7 | * Created by Visionin on 16/8/12. 8 | */ 9 | public class NativeLoad { 10 | static { 11 | System.loadLibrary("native"); 12 | } 13 | 14 | public static long so; 15 | static public native long loadSo(String so); 16 | static public native int registJNIMethod(long so, String className, String funcName, String signature); 17 | 18 | /* 19 | 类型 相应的签名 20 | boolean Z 21 | byte B 22 | char C 23 | short S 24 | int I 25 | long J 26 | float F 27 | double D 28 | void V 29 | object L用/分隔包的完整类名: Ljava/lang/String; 30 | Array [签名 [I [Ljava/lang/Object; 31 | Method (参数1类型签名 参数2类型签名···)返回值类型签名 32 | 复制代码 33 | 特别注意:Object后面一定有分号(;)结束的,多个对象参数中间也用分号(;)来分隔 34 | 例子: 35 | 方法签名 36 | void f1() ()V 37 | int f2(int, long) (IJ)I 38 | boolean f3(int[]) ([I)B 39 | double f4(String, int) (Ljava/lang/String;I)D 40 | void f5(int, String [], char) (I[Ljava/lang/String;C)V 41 | */ 42 | 43 | } 44 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rex/utils/ApkUtil.java: -------------------------------------------------------------------------------- 1 | package com.rex.utils; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | 7 | import java.io.File; 8 | 9 | /** 10 | * Created by Rex on 14-5-20. 11 | */ 12 | public class ApkUtil { 13 | 14 | public static void install(Context context,String filePath) 15 | { 16 | Intent intent = new Intent(Intent.ACTION_VIEW); 17 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 18 | intent.setDataAndType(Uri.fromFile(new File(filePath)), "application/vnd.android.package-archive"); 19 | context.startActivity(intent); 20 | } 21 | 22 | public static void unInstall(Context context,String packageString) 23 | { 24 | Uri packageURI = Uri.parse("package:"+packageString); //com.demo.CanavaCancel 25 | Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); 26 | context.startActivity(uninstallIntent); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rex/utils/LogUtil.java: -------------------------------------------------------------------------------- 1 | package com.rex.utils; 2 | 3 | import java.io.FileWriter; 4 | import java.io.IOException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | /** 9 | * Created by Rex on 14-8-18. 10 | */ 11 | public class LogUtil { 12 | public static void initialize(String path){ 13 | LogUtil.path = path; 14 | } 15 | 16 | public static void log(String type, String s){ 17 | try { 18 | Date date = new Date(); 19 | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); 20 | SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 21 | FileWriter writer = new FileWriter(path+ dateFormat.format(date) +".log", true); 22 | writer.append("["+type+"]"+ timeFormat.format(date)+"\t\t"+ s+"\n"); 23 | writer.close(); 24 | } catch (IOException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | public static void debug(String s){ 29 | log("debug", s); 30 | } 31 | public static void notice(String s){ 32 | log("notice", s); 33 | } 34 | public static void err(String s){ 35 | log("err", s); 36 | } 37 | private static String path = null; 38 | } 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |