mirror of https://github.com/opencv/opencv.git
parent
24c920a33a
commit
86f7a357ae
2 changed files with 46 additions and 45 deletions
@ -1,19 +1,30 @@ |
||||
package org.opencv.samples.tutorial5; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.opencv.android.JavaCameraView; |
||||
|
||||
import android.content.Context; |
||||
import android.hardware.Camera; |
||||
import android.util.AttributeSet; |
||||
|
||||
public class CustomJavaCameraView extends JavaCameraView { |
||||
|
||||
public CustomJavaCameraView(Context context, AttributeSet attrs) { |
||||
super(context, attrs); |
||||
} |
||||
|
||||
@Override |
||||
protected boolean connectCamera(int width, int height) { |
||||
boolean result = super.connectCamera(width, height); |
||||
return result; |
||||
public CustomJavaCameraView(Context context, AttributeSet attrs) { |
||||
super(context, attrs); |
||||
} |
||||
|
||||
public List<String> getEffectList() { |
||||
return mCamera.getParameters().getSupportedColorEffects(); |
||||
} |
||||
|
||||
public String getEffect() { |
||||
return mCamera.getParameters().getColorEffect(); |
||||
} |
||||
|
||||
public void setEffect(String effect) { |
||||
Camera.Parameters params = mCamera.getParameters(); |
||||
params.setColorEffect(effect); |
||||
mCamera.setParameters(params); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue