mirror of
https://github.com/zxing/zxing.git
synced 2025-01-13 04:07:27 -08:00
Issue 875 user supplied compile fix
git-svn-id: https://zxing.googlecode.com/svn/trunk@1827 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
0297363cfc
commit
cf0b37c045
|
@ -14,12 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.zxing.multi
|
||||
{
|
||||
package com.google.zxing.multi {
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.Reader;
|
||||
import com.google.zxing.ReaderException;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.common.flexdatatypes.ArrayList;
|
||||
import com.google.zxing.common.flexdatatypes.HashTable;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Attempts to locate multiple barcodes in an image by repeatedly decoding portion of the image.
|
||||
* After one barcode is found, the areas left, above, right and below the barcode's
|
||||
|
@ -36,16 +39,6 @@ package com.google.zxing.multi
|
|||
*/
|
||||
public final class GenericMultipleBarcodeReader implements MultipleBarcodeReader {
|
||||
|
||||
import Reader;
|
||||
import Result;
|
||||
import BinaryBitmap;
|
||||
import ReaderException;
|
||||
import ResultPoint;
|
||||
import common.flexdatatypes.HashTable;
|
||||
import common.flexdatatypes.ArrayList;
|
||||
|
||||
|
||||
|
||||
private static var MIN_DIMENSION_TO_RECUR:int = 30;
|
||||
|
||||
private var delegate:Reader;
|
||||
|
@ -54,9 +47,7 @@ import common.flexdatatypes.ArrayList;
|
|||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
|
||||
public function decodeMultiple(image:BinaryBitmap , hints:HashTable=null):Array
|
||||
{
|
||||
public function decodeMultiple(image:BinaryBitmap, hints:HashTable = null):Array {
|
||||
var results:ArrayList = new ArrayList();
|
||||
doDecodeMultiple(image, hints, results, 0, 0);
|
||||
if (results.isEmpty()) {
|
||||
|
@ -70,11 +61,8 @@ import common.flexdatatypes.ArrayList;
|
|||
return resultArray;
|
||||
}
|
||||
|
||||
private function doDecodeMultiple(image:BinaryBitmap,
|
||||
hints:HashTable ,
|
||||
results:ArrayList,
|
||||
xOffset:int,
|
||||
yOffset:int ):void {
|
||||
private function doDecodeMultiple(image:BinaryBitmap, hints:HashTable, results:ArrayList,
|
||||
xOffset:int, yOffset:int):void {
|
||||
var result:Result;
|
||||
try {
|
||||
result = delegate.decode(image, hints);
|
||||
|
|
|
@ -14,10 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.zxing.multi.qrcode
|
||||
{
|
||||
|
||||
package com.google.zxing.multi.qrcode {
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
import com.google.zxing.ReaderException;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.ResultMetadataType;
|
||||
import com.google.zxing.common.DecoderResult;
|
||||
import com.google.zxing.common.flexdatatypes.ArrayList;
|
||||
import com.google.zxing.common.flexdatatypes.HashTable;
|
||||
|
@ -37,7 +40,6 @@ public final class QRCodeMultiReader extends QRCodeReader implements MultipleBar
|
|||
|
||||
private static var EMPTY_RESULT_ARRAY:Array = new Array(0);
|
||||
|
||||
|
||||
public function decodeMultiple(image:BinaryBitmap, hints:HashTable = null):Array {
|
||||
var results:ArrayList = new ArrayList();
|
||||
var detectorResult:Array = new MultiDetector(image.getBlackMatrix()).detectMulti(hints);
|
||||
|
@ -45,13 +47,15 @@ public final class QRCodeMultiReader extends QRCodeReader implements MultipleBar
|
|||
try {
|
||||
var decoderResult:DecoderResult = getDecoder().decode(detectorResult[i].getBits());
|
||||
var points:Array = detectorResult[i].getPoints();
|
||||
var result:Result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points,
|
||||
var result:Result = new Result(decoderResult.getText(), decoderResult.getRawBytes(),
|
||||
points,
|
||||
BarcodeFormat.QR_CODE);
|
||||
if (decoderResult.getByteSegments() != null) {
|
||||
result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.getByteSegments());
|
||||
}
|
||||
if (decoderResult.getECLevel() != null) {
|
||||
result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, decoderResult.getECLevel().toString());
|
||||
result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL,
|
||||
decoderResult.getECLevel().toString());
|
||||
}
|
||||
results.addElement(result);
|
||||
} catch (re:ReaderException) {
|
||||
|
@ -68,7 +72,5 @@ public final class QRCodeMultiReader extends QRCodeReader implements MultipleBar
|
|||
return resultArray;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue