+ setHints(hints);
+ return decodeInternal(image);
+ }
+
+ /**
+ * Decode an image using the state set up by calling setHints() previously. Continuous scan
+ * clients will get a <b>large</b> speed increase by using this instead of decode().
+ *
+ * @param image The pixel data to decode
+ * @return The contents of the image
+ * @throws ReaderException Any errors which occurred
+ */
+ public Result decodeWithState(MonochromeBitmapSource image) throws ReaderException {
+ // Make sure to set up the default state so we don't crash
+ if (readers == null) {
+ setHints(null);
+ }
+ return decodeInternal(image);
+ }
+
+ /**
+ * This method adds state to the MultiFormatReader. By setting the hints once, subsequent calls
+ * to decodeWithState(image) can reuse the same set of readers without reallocating memory. This
+ * is important for performance in continuous scan clients.
+ *
+ * @param hints The set of hints to use for subsequent calls to decode(image)
+ */
+ public void setHints(Hashtable hints) {
+ this.hints = hints;