use of com.marshalchen.common.uimodule.imageprocessing.filter.processing.SobelEdgeDetectionFilter in project UltimateAndroid by cymcsg.
the class ImageProcessingVideotoImageActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
view = new FastImageProcessingView(this);
pipeline = new FastImageProcessingPipeline();
video = new VideoResourceInput(view, this, R.raw.image_processing_birds);
edgeDetect = new SobelEdgeDetectionFilter();
image = new JPGFileEndpoint(this, false, Environment.getExternalStorageDirectory().getAbsolutePath() + "/Pictures/outputImage", false);
screen = new ScreenEndpoint(pipeline);
video.addTarget(edgeDetect);
edgeDetect.addTarget(image);
edgeDetect.addTarget(screen);
pipeline.addRootRenderer(video);
view.setPipeline(pipeline);
setContentView(view);
pipeline.startRendering();
video.startWhenReady();
view.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent me) {
if (System.currentTimeMillis() - 100 > touchTime) {
touchTime = System.currentTimeMillis();
if (video.isPlaying()) {
video.stop();
} else {
video.startWhenReady();
}
}
return true;
}
});
}
Aggregations