pub enum DecodeHintType {
    OTHER,
    PURE_BARCODE,
    POSSIBLE_FORMATS,
    TRY_HARDER,
    CHARACTER_SET,
    ALLOWED_LENGTHS,
    ASSUME_CODE_39_CHECK_DIGIT,
    ASSUME_GS1,
    RETURN_CODABAR_START_END,
    NEED_RESULT_POINT_CALLBACK,
    ALLOWED_EAN_EXTENSIONS,
    ALSO_INVERTED,
}
Expand description

Encapsulates a type of hint that a caller may pass to a barcode reader to help it more quickly or accurately decode it. It is up to implementations to decide what, if anything, to do with the information that is supplied.

@author Sean Owen @author dswitkin@google.com (Daniel Switkin) @see Reader#decode(BinaryBitmap,java.util.Map)

Variants§

§

OTHER

Unspecified, application-specific hint. Maps to an unspecified {@link Object}.

§

PURE_BARCODE

Image is a pure monochrome image of a barcode. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

§

POSSIBLE_FORMATS

Image is known to be of one of a few possible formats. Maps to a {@link List} of {@link BarcodeFormat}s.

§

TRY_HARDER

Spend more time to try to find a barcode; optimize for accuracy, not speed. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

§

CHARACTER_SET

Specifies what character encoding to use when decoding, where applicable (type String)

§

ALLOWED_LENGTHS

Allowed lengths of encoded data – reject anything else. Maps to an {@code int[]}.

§

ASSUME_CODE_39_CHECK_DIGIT

Assume Code 39 codes employ a check digit. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

§

ASSUME_GS1

Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed. For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

§

RETURN_CODABAR_START_END

If true, return the start and end digits in a Codabar barcode instead of stripping them. They are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them to not be. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

§

NEED_RESULT_POINT_CALLBACK

The caller needs to be notified via callback when a possible {@link RXingResultPoint} is found. Maps to a {@link RXingResultPointCallback}.

§

ALLOWED_EAN_EXTENSIONS

Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this. Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5]. If it is optional to have an extension, do not set this hint. If this is set, and a UPC or EAN barcode is found but an extension is not, then no result will be returned at all.

§

ALSO_INVERTED

If true, also tries to decode as inverted image. All configured decoders are simply called a second time with an inverted image. Doesn’t matter what it maps to; use {@link Boolean#TRUE}.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
The error type produced by a failed conversion.
Convert the given value into an approximately equivalent representation.
The error type produced by a failed conversion.
Convert the subject into an approximately equivalent representation.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Approximate the subject with the default scheme.
Approximate the subject with a specific scheme.
Approximate the subject to a given type with the default scheme.
Approximate the subject to a given type with a specific scheme.
Convert the subject to a given type.
Attempt to convert the subject to a given type.
Attempt a value conversion of the subject to a given type.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The error type produced by a failed conversion.
Convert the given value into the subject type.
The type returned in the event of a conversion error.
Performs the conversion.
The error type produced by a failed conversion.
Convert the subject into the destination type.
The type returned in the event of a conversion error.
Performs the conversion.
The error type produced by a failed conversion.
Convert the given value into an exactly equivalent representation.
The error type produced by a failed conversion.
Convert the subject into an exactly equivalent representation.