Code39Reader.java (zxing-zxing-3.4.1) | : | Code39Reader.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
*/ | */ | |||
package com.google.zxing.oned; | package com.google.zxing.oned; | |||
import com.google.zxing.BarcodeFormat; | import com.google.zxing.BarcodeFormat; | |||
import com.google.zxing.ChecksumException; | import com.google.zxing.ChecksumException; | |||
import com.google.zxing.DecodeHintType; | import com.google.zxing.DecodeHintType; | |||
import com.google.zxing.FormatException; | import com.google.zxing.FormatException; | |||
import com.google.zxing.NotFoundException; | import com.google.zxing.NotFoundException; | |||
import com.google.zxing.Result; | import com.google.zxing.Result; | |||
import com.google.zxing.ResultMetadataType; | ||||
import com.google.zxing.ResultPoint; | import com.google.zxing.ResultPoint; | |||
import com.google.zxing.common.BitArray; | import com.google.zxing.common.BitArray; | |||
import java.util.Arrays; | import java.util.Arrays; | |||
import java.util.Map; | import java.util.Map; | |||
/** | /** | |||
* <p>Decodes Code 39 barcodes. Supports "Full ASCII Code 39" if USE_CODE_39_EXT ENDED_MODE is set.</p> | * <p>Decodes Code 39 barcodes. Supports "Full ASCII Code 39" if USE_CODE_39_EXT ENDED_MODE is set.</p> | |||
* | * | |||
* @author Sean Owen | * @author Sean Owen | |||
skipping to change at line 168 | skipping to change at line 169 | |||
String resultString; | String resultString; | |||
if (extendedMode) { | if (extendedMode) { | |||
resultString = decodeExtended(result); | resultString = decodeExtended(result); | |||
} else { | } else { | |||
resultString = result.toString(); | resultString = result.toString(); | |||
} | } | |||
float left = (start[1] + start[0]) / 2.0f; | float left = (start[1] + start[0]) / 2.0f; | |||
float right = lastStart + lastPatternSize / 2.0f; | float right = lastStart + lastPatternSize / 2.0f; | |||
return new Result( | ||||
Result resultObject = new Result( | ||||
resultString, | resultString, | |||
null, | null, | |||
new ResultPoint[]{ | new ResultPoint[]{ | |||
new ResultPoint(left, rowNumber), | new ResultPoint(left, rowNumber), | |||
new ResultPoint(right, rowNumber)}, | new ResultPoint(right, rowNumber)}, | |||
BarcodeFormat.CODE_39); | BarcodeFormat.CODE_39); | |||
resultObject.putMetadata(ResultMetadataType.SYMBOLOGY_IDENTIFIER, "]A0"); | ||||
return resultObject; | ||||
} | } | |||
private static int[] findAsteriskPattern(BitArray row, int[] counters) throws NotFoundException { | private static int[] findAsteriskPattern(BitArray row, int[] counters) throws NotFoundException { | |||
int width = row.getSize(); | int width = row.getSize(); | |||
int rowOffset = row.getNextSet(0); | int rowOffset = row.getNextSet(0); | |||
int counterPosition = 0; | int counterPosition = 0; | |||
int patternStart = rowOffset; | int patternStart = rowOffset; | |||
boolean isWhite = false; | boolean isWhite = false; | |||
int patternLength = counters.length; | int patternLength = counters.length; | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added |