byte[] rawBytes,
ResultPoint[] resultPoints,
BarcodeFormat format) {
+ if (text == null && rawBytes == null) {
+ throw new IllegalArgumentException("Text and bytes are null");
+ }
this.text = text;
this.rawBytes = rawBytes;
this.resultPoints = resultPoints;
resultMetadata.put(type, value);
}
+ public String toString() {
+ if (text == null) {
+ return "[" + rawBytes.length + " bytes]";
+ } else {
+ return text;
+ }
+ }
+
}
return posY;
}
+ public String toString() {
+ StringBuffer result = new StringBuffer();
+ result.append('(');
+ result.append(posX);
+ result.append(',');
+ result.append(posY);
+ result.append(')');
+ return result.toString();
+ }
+
}
\ No newline at end of file
}
String resultString = result.toString();
+ float left = (float) (startPatternInfo[1] + startPatternInfo[0]) / 2.0f;
+ float right = (float) (nextStart + lastStart) / 2.0f;
return new Result(
resultString,
null,
new ResultPoint[]{
- new GenericResultPoint((float) (startPatternInfo[1] - startPatternInfo[0]) / 2.0f, (float) rowNumber),
- new GenericResultPoint((float) (nextStart - lastStart) / 2.0f, (float) rowNumber)},
+ new GenericResultPoint(left, (float) rowNumber),
+ new GenericResultPoint(right, (float) rowNumber)},
BarcodeFormat.CODE_128);
}
if (extendedMode) {
resultString = decodeExtended(resultString);
}
+ float left = (float) (start[1] + start[0]) / 2.0f;
+ float right = (float) (nextStart + lastStart) / 2.0f;
return new Result(
resultString,
null,
new ResultPoint[]{
- new GenericResultPoint((float) (start[1] - start[0]) / 2.0f, (float) rowNumber),
- new GenericResultPoint((float) (nextStart - lastStart) / 2.0f, (float) rowNumber)},
+ new GenericResultPoint(left, (float) rowNumber),
+ new GenericResultPoint(right, (float) rowNumber)},
BarcodeFormat.CODE_39);
}