當前位置: 首頁>>代碼示例>>Java>>正文


Java ResultPointCallback類代碼示例

本文整理匯總了Java中com.google.zxing.ResultPointCallback的典型用法代碼示例。如果您正苦於以下問題:Java ResultPointCallback類的具體用法?Java ResultPointCallback怎麽用?Java ResultPointCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ResultPointCallback類屬於com.google.zxing包,在下文中一共展示了ResultPointCallback類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureActivity activity,
             Vector<BarcodeFormat> decodeFormats,
             String characterSet,
             ResultPointCallback resultPointCallback) {

  this.activity = activity;
  handlerInitLatch = new CountDownLatch(1);

  hints = new Hashtable<DecodeHintType, Object>(3);

  if (decodeFormats == null || decodeFormats.isEmpty()) {
  	 decodeFormats = new Vector<BarcodeFormat>();
  	 decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
  	 decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
  	 decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
  }
  
  hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

  if (characterSet != null) {
    hints.put(DecodeHintType.CHARACTER_SET, characterSet);
  }

  hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
 
開發者ID:CoderCF,項目名稱:ZXingDemo,代碼行數:26,代碼來源:DecodeThread.java

示例2: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureFragment fragment,
             Vector<BarcodeFormat> decodeFormats,
             String characterSet,
             ResultPointCallback resultPointCallback) {

    this.fragment = fragment;
    handlerInitLatch = new CountDownLatch(1);

    hints = new Hashtable<DecodeHintType, Object>(3);

    if (decodeFormats == null || decodeFormats.isEmpty()) {
        decodeFormats = new Vector<BarcodeFormat>();
        decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
    }

    hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

    if (characterSet != null) {
        hints.put(DecodeHintType.CHARACTER_SET, characterSet);
    }

    hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
 
開發者ID:Jusenr,項目名稱:zxing_qrcode_demo,代碼行數:26,代碼來源:DecodeThread.java

示例3: AlignmentPatternFinder

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
/**
 * <p>Creates a finder that will look in a portion of the whole image.</p>
 *
 * @param image image to search
 * @param startX left column from which to start searching
 * @param startY top row from which to start searching
 * @param width width of region to search
 * @param height height of region to search
 * @param moduleSize estimated module size so far
 */
AlignmentPatternFinder(BitMatrix image,
                       int startX,
                       int startY,
                       int width,
                       int height,
                       float moduleSize,
                       ResultPointCallback resultPointCallback) {
  this.image = image;
  this.possibleCenters = new ArrayList<>(5);
  this.startX = startX;
  this.startY = startY;
  this.width = width;
  this.height = height;
  this.moduleSize = moduleSize;
  this.crossCheckStateCount = new int[3];
  this.resultPointCallback = resultPointCallback;
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:28,代碼來源:AlignmentPatternFinder.java

示例4: decodePair

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
private Pair decodePair(BitArray row, boolean right, int rowNumber, Map<DecodeHintType,?> hints) {
  try {
    int[] startEnd = findFinderPattern(row, 0, right);
    FinderPattern pattern = parseFoundFinderPattern(row, rowNumber, right, startEnd);

    ResultPointCallback resultPointCallback = hints == null ? null :
      (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);

    if (resultPointCallback != null) {
      float center = (startEnd[0] + startEnd[1]) / 2.0f;
      if (right) {
        // row is actually reversed
        center = row.getSize() - 1 - center;
      }
      resultPointCallback.foundPossibleResultPoint(new ResultPoint(center, rowNumber));
    }

    DataCharacter outside = decodeDataCharacter(row, pattern, true);
    DataCharacter inside = decodeDataCharacter(row, pattern, false);
    return new Pair(1597 * outside.getValue() + inside.getValue(),
                    outside.getChecksumPortion() + 4 * inside.getChecksumPortion(),
                    pattern);
  } catch (NotFoundException ignored) {
    return null;
  }
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:27,代碼來源:RSS14Reader.java

示例5: detectMulti

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
public DetectorResult[] detectMulti(Map<DecodeHintType,?> hints) throws NotFoundException {
  BitMatrix image = getImage();
  ResultPointCallback resultPointCallback =
      hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
  MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);
  FinderPatternInfo[] infos = finder.findMulti(hints);

  if (infos.length == 0) {
    throw NotFoundException.getNotFoundInstance();
  }

  List<DetectorResult> result = new ArrayList<>();
  for (FinderPatternInfo info : infos) {
    try {
      result.add(processFinderPatternInfo(info));
    } catch (ReaderException e) {
      // ignore
    }
  }
  if (result.isEmpty()) {
    return EMPTY_DETECTOR_RESULTS;
  } else {
    return result.toArray(new DetectorResult[result.size()]);
  }
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:26,代碼來源:MultiDetector.java

示例6: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureActivity activity,
                Collection<BarcodeFormat> decodeFormats, String characterSet,
                ResultPointCallback resultPointCallback) {

	this.activity = activity;
	handlerInitLatch = new CountDownLatch(1);

	hints = new Hashtable<DecodeHintType, Object>(3);

	if (decodeFormats == null || decodeFormats.isEmpty()) {
		decodeFormats = new Vector<BarcodeFormat>();
		decodeFormats.addAll(ONE_D_FORMATS);
		decodeFormats.addAll(QR_CODE_FORMATS);
		decodeFormats.addAll(DATA_MATRIX_FORMATS);
	}
	hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

	if (characterSet != null) {
		hints.put(DecodeHintType.CHARACTER_SET, characterSet);
	}
	hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK,
			resultPointCallback);
	Log.i("DecodeThread", "Hints: " + hints);
}
 
開發者ID:dufangyu1990,項目名稱:LeCatApp,代碼行數:25,代碼來源:DecodeThread.java

示例7: decodePair

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
private Pair decodePair(BitArray row, boolean right, int rowNumber, Map<DecodeHintType,?> hints) {
  try {
    int[] startEnd = findFinderPattern(row, right);
    FinderPattern pattern = parseFoundFinderPattern(row, rowNumber, right, startEnd);

    ResultPointCallback resultPointCallback = hints == null ? null :
      (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);

    if (resultPointCallback != null) {
      float center = (startEnd[0] + startEnd[1]) / 2.0f;
      if (right) {
        // row is actually reversed
        center = row.getSize() - 1 - center;
      }
      resultPointCallback.foundPossibleResultPoint(new ResultPoint(center, rowNumber));
    }

    DataCharacter outside = decodeDataCharacter(row, pattern, true);
    DataCharacter inside = decodeDataCharacter(row, pattern, false);
    return new Pair(1597 * outside.getValue() + inside.getValue(),
                    outside.getChecksumPortion() + 4 * inside.getChecksumPortion(),
                    pattern);
  } catch (NotFoundException ignored) {
    return null;
  }
}
 
開發者ID:simplezhli,項目名稱:Tesseract-OCR-Scanner,代碼行數:27,代碼來源:RSS14Reader.java

示例8: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureActivity activity,
             Vector<BarcodeFormat> decodeFormats,
             String characterSet,
             ResultPointCallback resultPointCallback) {

    this.activity = activity;
    handlerInitLatch = new CountDownLatch(1);

    hints = new Hashtable<DecodeHintType, Object>(3);

    if (decodeFormats == null || decodeFormats.isEmpty()) {
        decodeFormats = new Vector<BarcodeFormat>();
        decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
    }

    hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

    if (characterSet != null) {
        hints.put(DecodeHintType.CHARACTER_SET, characterSet);
    }

    hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:26,代碼來源:DecodeThread.java

示例9: BarcodeReaderHandler

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
BarcodeReaderHandler(BarcodeReaderView barcodeReaderView,
                     Collection<BarcodeFormat> decodeFormats,
                     Map<DecodeHintType, ?> baseHints,
                     String characterSet,
                     ResultPointCallback resultPointCallback,
                     CameraManager cameraManager) {
    this.barcodeReaderView = barcodeReaderView;
    decodeThread = new DecodeThread(barcodeReaderView, decodeFormats, baseHints, characterSet, resultPointCallback);
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
開發者ID:CoderChoy,項目名稱:BarcodeReaderView,代碼行數:17,代碼來源:BarcodeReaderHandler.java

示例10: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(QrScannerActivity activity,
             Vector<BarcodeFormat> decodeFormats,
             String characterSet,
             ResultPointCallback resultPointCallback) {

    this.activity = activity;
    handlerInitLatch = new CountDownLatch(1);

    hints = new Hashtable<DecodeHintType, Object>(3);

    if (decodeFormats == null || decodeFormats.isEmpty()) {
        decodeFormats = new Vector<BarcodeFormat>();
        decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
        decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
    }

    hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

    if (characterSet != null) {
        hints.put(DecodeHintType.CHARACTER_SET, characterSet);
    }

    hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
 
開發者ID:Ydcool,項目名稱:QrModule,代碼行數:26,代碼來源:DecodeThread.java

示例11: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(MipcaActivityCapture activity,
             Vector<BarcodeFormat> decodeFormats,
             String characterSet,
             ResultPointCallback resultPointCallback) {

  this.activity = activity;
  handlerInitLatch = new CountDownLatch(1);

  hints = new Hashtable<DecodeHintType, Object>(3);

  if (decodeFormats == null || decodeFormats.isEmpty()) {
  	 decodeFormats = new Vector<BarcodeFormat>();
  	 decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
  	 decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
  	 decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
  }
  
  hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

  if (characterSet != null) {
    hints.put(DecodeHintType.CHARACTER_SET, characterSet);
  }

  hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:26,代碼來源:DecodeThread.java

示例12: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureActivity activity,
             Collection<BarcodeFormat> decodeFormats,
             Map<DecodeHintType,?> baseHints,
             String characterSet,
             ResultPointCallback resultPointCallback) {

  this.activity = activity;
  handlerInitLatch = new CountDownLatch(1);

  hints = new EnumMap<>(DecodeHintType.class);
  if (baseHints != null) {
    hints.putAll(baseHints);
  }

  // The prefs can't change while the thread is running, so pick them up once here.
  if (decodeFormats == null || decodeFormats.isEmpty()) {
    decodeFormats = EnumSet.noneOf(BarcodeFormat.class);
  }
  hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

  if (characterSet != null) {
    hints.put(DecodeHintType.CHARACTER_SET, characterSet);
  }
  hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
  Log.i("DecodeThread", "Hints: " + hints);
}
 
開發者ID:Hamaoui-Issame,項目名稱:nutriflash,代碼行數:27,代碼來源:DecodeThread.java

示例13: decodePair

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
private Pair decodePair(BitArray row, boolean right, int rowNumber, Map<DecodeHintType,?> hints) {
  try {
    int[] startEnd = findFinderPattern(row, 0, right);
    FinderPattern pattern = parseFoundFinderPattern(row, rowNumber, right, startEnd);

    ResultPointCallback resultPointCallback = hints == null ? null :
      (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);

    if (resultPointCallback != null) {
      float center = (startEnd[0] + startEnd[1]) / 2.0f;
      if (right) {
        // row is actually reversed
        center = row.getSize() - 1 - center;
      }
      resultPointCallback.foundPossibleResultPoint(new ResultPoint(center, rowNumber));
    }

    DataCharacter outside = decodeDataCharacter(row, pattern, true);
    DataCharacter inside = decodeDataCharacter(row, pattern, false);
    return new Pair(1597 * outside.getValue() + inside.getValue(),
                    outside.getChecksumPortion() + 4 * inside.getChecksumPortion(),
                    pattern);
  } catch (NotFoundException re) {
    return null;
  }
}
 
開發者ID:atomsheep,項目名稱:sres-app,代碼行數:27,代碼來源:RSS14Reader.java

示例14: DecodeThread

import com.google.zxing.ResultPointCallback; //導入依賴的package包/類
DecodeThread(CaptureActivity activity, Vector<BarcodeFormat> decodeFormats,
		String characterSet, ResultPointCallback resultPointCallback) {

	this.activity = activity;
	handlerInitLatch = new CountDownLatch(1);

	hints = new Hashtable<DecodeHintType, Object>(3);

	if (decodeFormats == null || decodeFormats.isEmpty()) {
		decodeFormats = new Vector<BarcodeFormat>();
		decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
		decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
		decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
	}

	hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

	if (characterSet != null) {
		hints.put(DecodeHintType.CHARACTER_SET, characterSet);
	}

	hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK,
			resultPointCallback);
}
 
開發者ID:13120241790,項目名稱:RongChat,代碼行數:25,代碼來源:DecodeThread.java


注:本文中的com.google.zxing.ResultPointCallback類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。