com.google.zxing
Class MultiFormatReader

java.lang.Object
  extended by com.google.zxing.MultiFormatReader
All Implemented Interfaces:
Reader

public final class MultiFormatReader
extends Object
implements Reader

MultiFormatReader is a convenience class and the main entry point into the library for most uses. By default it attempts to decode all barcode formats that the library supports. Optionally, you can provide a hints object to request different behavior, for example only decoding QR codes.

Since:
BlackBerry API 6.0.0

Constructor Summary
MultiFormatReader()
           
 
Method Summary
 Result decode(BinaryBitmap image)
          This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it passes null as a hint to the decoders.
 Result decode(BinaryBitmap image, Hashtable hints)
          Decode an image using the hints provided.
 Result decodeWithState(BinaryBitmap image)
          Decode an image using the state set up by calling setHints() previously.
 boolean has1DReader()
           
 boolean has2DReader()
           
 void reset()
          Should be invoked after each call to decode in case the contained readers store state
 void setHints(Hashtable hints)
          This method adds state to the MultiFormatReader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

MultiFormatReader

public MultiFormatReader()
Since:
BlackBerry API 6.0.0


Method Detail

decode

public Result decode(BinaryBitmap image)
              throws NotFoundException
This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly. Use setHints() followed by decodeWithState() for continuous scan applications.

Specified by:
decode in interface Reader
Parameters:
image - The pixel data to decode
Returns:
The contents of the image
Throws:
NotFoundException - Any errors which occurred
Since:
BlackBerry API 6.0.0

decode

public Result decode(BinaryBitmap image,
                     Hashtable hints)
              throws NotFoundException
Decode an image using the hints provided. Does not honor existing state.

Specified by:
decode in interface Reader
Parameters:
image - The pixel data to decode
hints - The hints to use, clearing the previous state.
Returns:
The contents of the image
Throws:
NotFoundException - Any errors which occurred
Since:
BlackBerry API 6.0.0

decodeWithState

public Result decodeWithState(BinaryBitmap image)
                       throws NotFoundException
Decode an image using the state set up by calling setHints() previously. Continuous scan clients will get a large speed increase by using this instead of decode().

Parameters:
image - The pixel data to decode
Returns:
The contents of the image
Throws:
NotFoundException - Any errors which occurred
Since:
BlackBerry API 6.0.0

setHints

public void setHints(Hashtable hints)
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.

Parameters:
hints - The set of hints to use for subsequent calls to decode(image)
Since:
BlackBerry API 6.0.0

has1DReader

public boolean has1DReader()
Since:
BlackBerry API 7.0.0

has2DReader

public boolean has2DReader()
Since:
BlackBerry API 7.0.0

reset

public void reset()
Should be invoked after each call to decode in case the contained readers store state

Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal