use of jp.co.cyberagent.android.gpuimage.GPUImage in project android-gpuimage by CyberAgent.
the class ActivityCamera method onCreate.
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
((SeekBar) findViewById(R.id.seekBar)).setOnSeekBarChangeListener(this);
findViewById(R.id.button_choose_filter).setOnClickListener(this);
findViewById(R.id.button_capture).setOnClickListener(this);
mGPUImage = new GPUImage(this);
mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
mCameraHelper = new CameraHelper(this);
mCamera = new CameraLoader();
View cameraSwitchView = findViewById(R.id.img_switch_camera);
cameraSwitchView.setOnClickListener(this);
if (!mCameraHelper.hasFrontCamera() || !mCameraHelper.hasBackCamera()) {
cameraSwitchView.setVisibility(View.GONE);
}
}
use of jp.co.cyberagent.android.gpuimage.GPUImage in project glide-transformations by wasabeef.
the class GPUFilterTransformation method transform.
@Override
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {
Bitmap source = resource.get();
GPUImage gpuImage = new GPUImage(mContext);
gpuImage.setImage(source);
gpuImage.setFilter(mFilter);
Bitmap bitmap = gpuImage.getBitmapWithFilterApplied();
return BitmapResource.obtain(bitmap, mBitmapPool);
}
Aggregations