Search in sources :

Example 16 with MultiFormatReader

use of com.google.zxing.MultiFormatReader in project zxing by zxing.

the class BenchmarkAsyncTask method doInBackground.

@Override
protected String doInBackground(Object... params) {
    MultiFormatReader reader = new MultiFormatReader();
    reader.setHints(null);
    // Try to get in a known state before starting the benchmark
    System.gc();
    List<BenchmarkItem> items = new ArrayList<>();
    walkTree(reader, file, items);
    int count = 0;
    int time = 0;
    for (BenchmarkItem item : items) {
        if (item != null) {
            Log.v(TAG, item.toString());
            count++;
            time += item.getAverageTime();
        }
    }
    return "TOTAL: Decoded " + count + " images in " + time + " us";
}
Also used : MultiFormatReader(com.google.zxing.MultiFormatReader) ArrayList(java.util.ArrayList)

Aggregations

MultiFormatReader (com.google.zxing.MultiFormatReader)16 BinaryBitmap (com.google.zxing.BinaryBitmap)10 Result (com.google.zxing.Result)10 HybridBinarizer (com.google.zxing.common.HybridBinarizer)10 ReaderException (com.google.zxing.ReaderException)5 DecodeHintType (com.google.zxing.DecodeHintType)4 LuminanceSource (com.google.zxing.LuminanceSource)4 BufferedImageLuminanceSource (com.google.zxing.client.j2se.BufferedImageLuminanceSource)3 BufferedImage (java.awt.image.BufferedImage)3 BarcodeFormat (com.google.zxing.BarcodeFormat)2 RGBLuminanceSource (com.google.zxing.RGBLuminanceSource)2 Reader (com.google.zxing.Reader)2 ResultPoint (com.google.zxing.ResultPoint)2 GlobalHistogramBinarizer (com.google.zxing.common.GlobalHistogramBinarizer)2 GenericMultipleBarcodeReader (com.google.zxing.multi.GenericMultipleBarcodeReader)2 MultipleBarcodeReader (com.google.zxing.multi.MultipleBarcodeReader)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 EnumMap (java.util.EnumMap)2 Bitmap (android.graphics.Bitmap)1