projects
/
zxing.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactorings to allow raw bytes to be passed back with reader result, where applicable
[zxing.git]
/
core
/
src
/
com
/
google
/
zxing
/
Result.java
diff --git
a/core/src/com/google/zxing/Result.java
b/core/src/com/google/zxing/Result.java
index
17ebb55
..
b9d0f5a
100644
(file)
--- a/
core/src/com/google/zxing/Result.java
+++ b/
core/src/com/google/zxing/Result.java
@@
-24,27
+24,45
@@
package com.google.zxing;
public final class Result {
private final String text;
public final class Result {
private final String text;
+ private final byte[] rawBytes;
private final ResultPoint[] resultPoints;
private final ResultPoint[] resultPoints;
+ private final BarcodeFormat format;
- public Result(String text,
ResultPoint[] resultPoints
) {
+ public Result(String text,
byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format
) {
this.text = text;
this.text = text;
+ this.rawBytes = rawBytes;
this.resultPoints = resultPoints;
this.resultPoints = resultPoints;
+ this.format = format;
}
/**
}
/**
- * @return raw text encoded by the barcode, if a
ny
+ * @return raw text encoded by the barcode, if a
pplicable, otherwise <code>null</code>
*/
public String getText() {
return text;
}
*/
public String getText() {
return text;
}
+ /**
+ * @return raw bytes encoded by the barcode, if applicable, otherwise <code>null</code>
+ */
+ public byte[] getRawBytes() {
+ return rawBytes;
+ }
+
/**
* @return points related to the barcode in the image. These are typically points
/**
* @return points related to the barcode in the image. These are typically points
- * identifying finder patterns or the corners of the barcode. The exact meaning is
- * specific to the type of barcode that was decoded.
+ *
identifying finder patterns or the corners of the barcode. The exact meaning is
+ *
specific to the type of barcode that was decoded.
*/
public ResultPoint[] getResultPoints() {
return resultPoints;
}
*/
public ResultPoint[] getResultPoints() {
return resultPoints;
}
+ /**
+ * @return {@link BarcodeFormat} representing the format of the barcode that was recognized and decoded
+ */
+ public BarcodeFormat getBarcodeFormat() {
+ return format;
+ }
+
}
}