支持识别反色码(#66,#69,#72)

This commit is contained in:
jenly1314
2019-12-27 18:11:44 +08:00
parent 0a136a686b
commit 42a5cc926a
5 changed files with 83 additions and 28 deletions

View File

@@ -87,6 +87,11 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
*/
private boolean isSupportAutoZoom = true;
/**
* 是否支持识别颜色反转色的码,黑白颜色反转,默认不支持
*/
private boolean isSupportLuminanceInvert = false;
/**
* 是否支持连扫,默认不支持
*/
@@ -334,6 +339,7 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
captureHandler.setSupportVerticalCode(isSupportVerticalCode);
captureHandler.setReturnBitmap(isReturnBitmap);
captureHandler.setSupportAutoZoom(isSupportAutoZoom);
captureHandler.setSupportLuminanceInvert(isSupportLuminanceInvert);
}
} catch (IOException ioe) {
Log.w(TAG, ioe);
@@ -718,9 +724,22 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
return this;
}
/**
* 是否支持识别反色码,黑白颜色反转
* @param supportLuminanceInvert 默认为false当返回true时表示支持会增加识别率但相应的也会增加性能消耗。
* @return
*/
public CaptureHelper supportLuminanceInvert(boolean supportLuminanceInvert) {
isSupportLuminanceInvert = supportLuminanceInvert;
if(captureHandler!=null){
captureHandler.setSupportLuminanceInvert(isSupportLuminanceInvert);
}
return this;
}
/**
* 设置是否支持全屏扫码识别
* @param fullScreenScan
* @param fullScreenScan 默认为false
* @return
*/
public CaptureHelper fullScreenScan(boolean fullScreenScan) {