基于github上面gpuimage库和magiccamera库,
1:改写了OpenGlUtil工具。
2:自定义surfaceview组件,使其可以左右滑动,
关键代码:
package com.view;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by xq on 16/9/26.
*/
public class SwitchGLSurfaceView extends GLSurfaceView{
public static final String TAG = "TAG";
public Switch switchFilter;
float start_x = 0;
float end_x = 0;
public SwitchGLSurfaceView(Context context) {
super(context);
}
public SwitchGLSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
start_x = event.getRawX();
end_x = start_x;
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
end_x = event.getRawX();
break;
case MotionEvent.ACTION_CANCEL: