发布v3.0.1

This commit is contained in:
Jenly
2023-09-13 00:38:50 +08:00
parent 91f55bb7dd
commit 13024e733a
14 changed files with 48 additions and 35 deletions

View File

@@ -15,15 +15,17 @@ import androidx.annotation.FloatRange;
* 解码配置:主要用于在扫码识别时,提供一些配置,便于扩展。通过配置可决定内置分析器的能力,从而间接的控制并简化扫码识别的流程
* <p></>
* 设置解码 {@link #setHints(Map)}内置的一些解码可参见如下:
* <p>
* {@link DecodeFormatManager#DEFAULT_HINTS}
* {@link DecodeFormatManager#ALL_HINTS}
* {@link DecodeFormatManager#CODE_128_HINTS}
* {@link DecodeFormatManager#QR_CODE_HINTS}
* {@link DecodeFormatManager#ONE_DIMENSIONAL_HINTS}
* {@link DecodeFormatManager#TWO_DIMENSIONAL_HINTS}
* {@link DecodeFormatManager#DEFAULT_HINTS}
* <p>
*
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
* @see {@link DecodeFormatManager#DEFAULT_HINTS}
* @see {@link DecodeFormatManager#ALL_HINTS}
* @see {@link DecodeFormatManager#CODE_128_HINTS}
* @see {@link DecodeFormatManager#QR_CODE_HINTS}
* @see {@link DecodeFormatManager#ONE_DIMENSIONAL_HINTS}
* @see {@link DecodeFormatManager#TWO_DIMENSIONAL_HINTS}
* @see {@link DecodeFormatManager#DEFAULT_HINTS}
* <p>
* 如果不满足您也可以通过{@link DecodeFormatManager#createDecodeHints(BarcodeFormat...)}自己配置支持的格式
*
@@ -38,6 +40,7 @@ import androidx.annotation.FloatRange;
* 即判定区域分析的优先级顺序为:{@link #setFullAreaScan(boolean)} -> {@link #setAnalyzeAreaRect(Rect)} -> {@link #setAreaRectRatio(float)}
* <p></>
*/
@SuppressWarnings("unused")
public class DecodeConfig {
private Map<DecodeHintType, Object> hints = DecodeFormatManager.DEFAULT_HINTS;
@@ -107,16 +110,16 @@ public class DecodeConfig {
* 设置解码
*
* @param hints {@link DecodeFormatManager}
* <p>
* 内置的一些解码可参见如下:
* @return {@link DecodeConfig}
* @see {@link DecodeFormatManager#DEFAULT_HINTS}
* @see {@link DecodeFormatManager#ALL_HINTS}
* @see {@link DecodeFormatManager#CODE_128_HINTS}
* @see {@link DecodeFormatManager#QR_CODE_HINTS}
* @see {@link DecodeFormatManager#ONE_DIMENSIONAL_HINTS}
* @see {@link DecodeFormatManager#TWO_DIMENSIONAL_HINTS}
* @see {@link DecodeFormatManager#DEFAULT_HINTS}
* <p>
* 内置的一些解码可参见如下:
* {@link DecodeFormatManager#DEFAULT_HINTS}
* {@link DecodeFormatManager#ALL_HINTS}
* {@link DecodeFormatManager#CODE_128_HINTS}
* {@link DecodeFormatManager#QR_CODE_HINTS}
* {@link DecodeFormatManager#ONE_DIMENSIONAL_HINTS}
* {@link DecodeFormatManager#TWO_DIMENSIONAL_HINTS}
* {@link DecodeFormatManager#DEFAULT_HINTS}
* <p>
* 如果不满足您也可以通过{@link DecodeFormatManager#createDecodeHints(BarcodeFormat...)}自己配置支持的格式
*/

View File

@@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
*
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
@SuppressWarnings("unused")
public abstract class BarcodeFormatAnalyzer extends AreaRectAnalyzer {
private Reader mReader;
@@ -48,7 +49,7 @@ public abstract class BarcodeFormatAnalyzer extends AreaRectAnalyzer {
rawResult = decodeInternal(source, isMultiDecode);
if (rawResult == null && mDecodeConfig != null) {
if (rawResult == null && mDecodeConfig.isSupportVerticalCode()) {
if (mDecodeConfig.isSupportVerticalCode()) {
byte[] rotatedData = new byte[data.length];
for (int y = 0; y < dataHeight; y++) {
for (int x = 0; x < dataWidth; x++) {

View File

@@ -84,7 +84,7 @@ public abstract class ImageAnalyzer implements Analyzer<Result> {
} catch (Exception e) {
queue.add(nv21Data);
listener.onSuccess(null);
listener.onFailure(null);
}
}

View File

@@ -20,6 +20,7 @@ import androidx.annotation.Nullable;
*
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
@SuppressWarnings("unused")
public class MultiFormatAnalyzer extends AreaRectAnalyzer {
MultiFormatReader mReader;
@@ -52,7 +53,7 @@ public class MultiFormatAnalyzer extends AreaRectAnalyzer {
rawResult = decodeInternal(source, isMultiDecode);
if (rawResult == null && mDecodeConfig != null) {
if (rawResult == null && mDecodeConfig.isSupportVerticalCode()) {
if (mDecodeConfig.isSupportVerticalCode()) {
byte[] rotatedData = new byte[data.length];
for (int y = 0; y < dataHeight; y++) {
for (int x = 0; x < dataWidth; x++) {

View File

@@ -15,6 +15,7 @@ import androidx.annotation.Nullable;
*
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
@SuppressWarnings("unused")
public class QRCodeAnalyzer extends BarcodeFormatAnalyzer {
public QRCodeAnalyzer() {

View File

@@ -54,6 +54,7 @@ import java.util.Map;
*
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
@SuppressWarnings("unused")
public final class CodeUtils {
public static final int DEFAULT_REQ_WIDTH = 480;