MultiFormatReader

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.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun decode(image: BinaryBitmap): Result

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.

open override fun decode(image: BinaryBitmap, hints: Map<DecodeHintType, *>?): Result

Decode an image using the hints provided. Does not honor existing state.

Link copied to clipboard

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().

Link copied to clipboard
open override fun reset()

Resets any internal state the implementation has after a decode, to prepare it for reuse.

Link copied to clipboard
fun setHints(hints: Map<DecodeHintType, *>?)

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.