Issue 331
[zxing.git] / core / src / com / google / zxing / qrcode / decoder / Decoder.java
index 26394e5..6a576f8 100644 (file)
@@ -23,6 +23,8 @@ import com.google.zxing.common.reedsolomon.GF256;
 import com.google.zxing.common.reedsolomon.ReedSolomonDecoder;\r
 import com.google.zxing.common.reedsolomon.ReedSolomonException;\r
 \r
+import java.util.Hashtable;\r
+\r
 /**\r
  * <p>The main class which implements QR Code decoding -- as opposed to locating and extracting\r
  * the QR Code from an image.</p>\r
@@ -37,6 +39,10 @@ public final class Decoder {
     rsDecoder = new ReedSolomonDecoder(GF256.QR_CODE_FIELD);\r
   }\r
 \r
+  public DecoderResult decode(boolean[][] image) throws ReaderException {\r
+    return decode(image, null);\r
+  }\r
+\r
   /**\r
    * <p>Convenience method that can decode a QR Code represented as a 2D array of booleans.\r
    * "true" is taken to mean a black module.</p>\r
@@ -45,7 +51,7 @@ public final class Decoder {
    * @return text and bytes encoded within the QR Code\r
    * @throws ReaderException if the QR Code cannot be decoded\r
    */\r
-  public DecoderResult decode(boolean[][] image) throws ReaderException {\r
+  public DecoderResult decode(boolean[][] image, Hashtable hints) throws ReaderException {\r
     int dimension = image.length;\r
     BitMatrix bits = new BitMatrix(dimension);\r
     for (int i = 0; i < dimension; i++) {\r
@@ -55,7 +61,11 @@ public final class Decoder {
         }\r
       }\r
     }\r
-    return decode(bits);\r
+    return decode(bits, hints);\r
+  }\r
+\r
+  public DecoderResult decode(BitMatrix bits) throws ReaderException {\r
+    return decode(bits, null);\r
   }\r
 \r
   /**\r
@@ -65,7 +75,7 @@ public final class Decoder {
    * @return text and bytes encoded within the QR Code\r
    * @throws ReaderException if the QR Code cannot be decoded\r
    */\r
-  public DecoderResult decode(BitMatrix bits) throws ReaderException {\r
+  public DecoderResult decode(BitMatrix bits, Hashtable hints) throws ReaderException {\r
 \r
     // Construct a parser and read version, error-correction level\r
     BitMatrixParser parser = new BitMatrixParser(bits);\r
@@ -97,7 +107,7 @@ public final class Decoder {
     }\r
 \r
     // Decode the contents of that stream of bytes\r
-    return DecodedBitStreamParser.decode(resultBytes, version, ecLevel);\r
+    return DecodedBitStreamParser.decode(resultBytes, version, ecLevel, hints);\r
   }\r
 \r
   /**\r