2
2
3
3
import android .graphics .Rect ;
4
4
5
+ import androidx .annotation .FloatRange ;
6
+ import androidx .annotation .NonNull ;
7
+
5
8
import com .google .zxing .BarcodeFormat ;
6
9
import com .google .zxing .DecodeHintType ;
7
10
import com .google .zxing .common .GlobalHistogramBinarizer ;
8
11
import com .google .zxing .common .HybridBinarizer ;
9
12
10
13
import java .util .Map ;
11
14
12
- import androidx .annotation .FloatRange ;
13
-
14
15
/**
15
16
* 解码配置:主要用于在扫码识别时,提供一些配置,便于扩展。通过配置可决定内置分析器的能力,从而间接的控制并简化扫码识别的流程
16
17
* <p></>
25
26
* {@link DecodeFormatManager#DEFAULT_HINTS}
26
27
* <p>
27
28
*
28
- * @author <a href="mailto:[email protected] ">Jenly</a>
29
29
* <p>
30
30
* 如果不满足您也可以通过{@link DecodeFormatManager#createDecodeHints(BarcodeFormat...)}自己配置支持的格式
31
31
*
38
38
* 因为{@link androidx.camera.view.PreviewView}的预览区域是经过裁剪的,所以这里的区域并不是用户所能预览到的区域,而是指Camera预览的真实区域,
39
39
* <p>
40
40
* 即判定区域分析的优先级顺序为:{@link #setFullAreaScan(boolean)} -> {@link #setAnalyzeAreaRect(Rect)} -> {@link #setAreaRectRatio(float)}
41
- * <p></>
41
+ * <p>
42
+ *
43
+ * @author <a href="mailto:[email protected] ">Jenly</a>
44
+ * <p>
45
+ * <a href="https://github.com/jenly1314">Follow me</a>
42
46
*/
43
47
@ SuppressWarnings ("unused" )
44
48
public class DecodeConfig {
@@ -325,7 +329,7 @@ public int getAreaRectVerticalOffset() {
325
329
/**
326
330
* 设置识别区域垂直方向偏移量,支持负数,大于0时,居中心向下偏移,小于0时,居中心向上偏移
327
331
*
328
- * @param areaRectVerticalOffset
332
+ * @param areaRectVerticalOffset 识别区域垂直方向偏移量
329
333
* @return {@link DecodeConfig}
330
334
*/
331
335
public DecodeConfig setAreaRectVerticalOffset (int areaRectVerticalOffset ) {
@@ -345,14 +349,15 @@ public int getAreaRectHorizontalOffset() {
345
349
/**
346
350
* 设置识别区域水平方向偏移量,支持负数,大于0时,居中心向右偏移,小于0时,居中心向左偏移
347
351
*
348
- * @param areaRectHorizontalOffset
352
+ * @param areaRectHorizontalOffset 识别区域水平方向偏移量
349
353
* @return {@link DecodeConfig}
350
354
*/
351
355
public DecodeConfig setAreaRectHorizontalOffset (int areaRectHorizontalOffset ) {
352
356
this .areaRectHorizontalOffset = areaRectHorizontalOffset ;
353
357
return this ;
354
358
}
355
359
360
+ @ NonNull
356
361
@ Override
357
362
public String toString () {
358
363
return "DecodeConfig{" +
0 commit comments