# GPUImage for Android
Idea from: [iOS GPUImage framework](https://github.com/BradLarson/GPUImage)
Goal is to have something as similar to GPUImage as possible. Vertex and fragment shaders are exactly the same. That way it makes it easier to port filters from GPUImage iOS to Android.
## Requirements
* Android 2.2 or higher (OpenGL ES 2.0)
## Usage
### Include in own project
GPUImage can be used as a library project or by copying the following files/folders to your libs folder.
* library/libs/armeabi (only needed for camera live preview)
* library/bin/gpuimage.jar
### Maven dependency
<dependency>
<groupId>jp.co.cyberagent.android.gpuimage</groupId>
<artifactId>gpuimage-library</artifactId>
<type>apklib</type>
<version>(use current version here)</version>
</dependency>
If you want to use it with live camera preview, than you will need to add the following as well:
<dependency>
<groupId>jp.co.cyberagent.android.gpuimage</groupId>
<artifactId>gpuimage-library</artifactId>
<classifier>armeabi</classifier>
<type>so</type>
<version>(use current version here)</version>
</dependency>
### Sample Code
With preview:
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity);
Uri imageUri = ...;
mGPUImage = new GPUImage(this);
mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
mGPUImage.setImage(imageUri); // this loads image on the current thread, should be run in a thread
mGPUImage.setFilter(new GPUImageSepiaFilter());
// Later when image should be saved saved:
mGPUImage.saveToPictures("GPUImage", "ImageWithFilter.jpg", null);
}
Without preview:
Uri imageUri = ...;
mGPUImage = new GPUImage(context);
mGPUImage.setFilter(new GPUImageSobelEdgeDetection());
mGPUImage.setImage(imageUri);
mGPUImage.saveToPictures("GPUImage", "ImageWithFilter.jpg", null);
## Create libs/armeabi
Run the following command in the library folder. Make sure you have android-ndk in your PATH.
cd library
ndk-build
### Maven
Make sure that you run the clean target when using maven.
mvn clean install
## License
Copyright 2012 CyberAgent
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.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
实现各种各样图像滤镜(图像处理)效果,多达50多种效果,基本囊括了最常见的图像处理效果。包括:contrast,hue,gamma,brightness,sharpness,emboss,saturation,exposure,shadow,blend等等。 由于需要用到OpenGL ES 2.0,所以,仅能在真机中测试。可以载入本地相册的照片或者直接拍照后进行照片处理。
资源推荐
资源详情
资源评论
收起资源包目录
实现各种各样图像滤镜(图像处理)效果,多达50多种效果 (278个子文件)
tone_cuver_sample.acv 62B
resources.ap_ 53KB
gpuimage-sample.apk 115KB
yuv-decoder.c 4KB
jarlist.cache 120B
GPUImageFilterTools.class 14KB
GPUImage.class 11KB
GPUImageRenderer.class 10KB
GPUImageFilterTools$FilterAdjuster.class 10KB
GPUImageToneCurveFilter.class 9KB
ActivityCamera.class 8KB
GPUImageFilter.class 8KB
PixelBuffer.class 7KB
GPUImage$LoadImageTask.class 5KB
ActivityGallery.class 5KB
GPUImageFilterGroup.class 4KB
OpenGlUtils.class 4KB
GPUImage$SaveTask.class 4KB
GPUImageFilterTools$FilterType.class 4KB
ActivityCamera$CameraLoader.class 4KB
GPUImage3x3TextureSamplingFilter.class 4KB
GPUImageTwoInputFilter.class 4KB
GPUImageSharpenFilter.class 3KB
CameraHelper.class 3KB
ActivityCamera$3.class 3KB
GPUImageVignetteFilter.class 3KB
GPUImageView.class 3KB
GPUImageSaturationBlendFilter.class 3KB
GPUImageHueBlendFilter.class 3KB
GPUImageMonochromeFilter.class 3KB
GPUImageChromaKeyBlendFilter.class 3KB
GPUImage3x3ConvolutionFilter.class 3KB
GPUImageSobelEdgeDetection.class 3KB
GPUImage$LoadImageUriTask.class 3KB
GPUImageWhiteBalanceFilter.class 3KB
GPUImageHueFilter.class 3KB
GPUImageDirectionalSobelEdgeDetectionFilter.class 2KB
GPUImageHighlightShadowFilter.class 2KB
GPUImageFilterTools$FilterAdjuster$Adjuster.class 2KB
GPUImageRGBFilter.class 2KB
GPUImageFilterTools$1.class 2KB
GPUImageColorMatrixFilter.class 2KB
TextureRotationUtil.class 2KB
GPUImageRenderer$5.class 2KB
CameraHelperGB.class 2KB
CameraHelperBase.class 2KB
GPUImagePixelationFilter.class 2KB
GPUImageRenderer$1.class 2KB
GPUImageSaturationFilter.class 2KB
GPUImageHardLightBlendFilter.class 2KB
GPUImageToneCurveFilter$1.class 2KB
GPUImageFilterTools$FilterAdjuster$HighlightShadowAdjuster.class 2KB
GPUImage$SaveTask$1.class 2KB
GPUImageOverlayBlendFilter.class 2KB
GPUImageDivideBlendFilter.class 2KB
GPUImage$LoadImageFileTask.class 2KB
GPUImageFilterTools$FilterAdjuster$GPU3x3TextureAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$WhiteBalanceAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$DissolveBlendAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$BrightnessAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$SharpnessAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$PixelationAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$SaturationAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$MonochromeAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$ExposureAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$VignetteAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$PosterizeAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$SobelAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$ContrastAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$EmbossAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$OpacityAdjuster.class 2KB
GPUImageLookupFilter.class 2KB
GPUImageFilterTools$FilterAdjuster$GammaAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$SepiaAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$HueAdjuster.class 2KB
GPUImageFilterTools$FilterAdjuster$RGBAdjuster.class 2KB
GPUImageLuminosityBlendFilter.class 2KB
GPUImageColorBlendFilter.class 2KB
GPUImageRenderer$2.class 2KB
GPUImageContrastFilter.class 2KB
GPUImageBrightnessFilter.class 2KB
GPUImageExposureFilter.class 2KB
GPUImageOpacityFilter.class 2KB
GPUImageGammaFilter.class 2KB
ActivityMain.class 2KB
GPUImageAddBlendFilter.class 2KB
GPUImagePosterizeFilter.class 2KB
ActivityGallery$1.class 2KB
GPUImageRenderer$3.class 1KB
GPUImageColorDodgeBlendFilter.class 1KB
ActivityCamera$3$1.class 1KB
GPUImage$SaveTask$1$1.class 1KB
GPUImageFilterTools$FilterList.class 1KB
ActivityCamera$1.class 1KB
GPUImageToneCurveFilter$2.class 1KB
GPUImage$ScaleType.class 1KB
Rotation.class 1KB
GPUImageMixBlendFilter.class 1KB
GPUImageTwoInputFilter$1.class 1KB
GPUImageNormalBlendFilter.class 1KB
共 278 条
- 1
- 2
- 3
anonymousblogs
- 粉丝: 34
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页