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.
 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 ReaderException
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:
ReaderException - Any errors which occurred
Since:
BlackBerry API 6.0.0

decode

public Result decode(BinaryBitmap image,
                     Hashtable hints)
              throws ReaderException
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:
ReaderException - Any errors which occurred
Since:
BlackBerry API 6.0.0

decodeWithState

public Result decodeWithState(BinaryBitmap image)
                       throws ReaderException
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:
ReaderException - 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





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.