Enum rxing::DecodeHintType
source · 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§
source§impl Clone for DecodeHintType
impl Clone for DecodeHintType
source§fn clone(&self) -> DecodeHintType
fn clone(&self) -> DecodeHintType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DecodeHintType
impl Debug for DecodeHintType
source§impl Hash for DecodeHintType
impl Hash for DecodeHintType
source§impl PartialEq<DecodeHintType> for DecodeHintType
impl PartialEq<DecodeHintType> for DecodeHintType
source§fn eq(&self, other: &DecodeHintType) -> bool
fn eq(&self, other: &DecodeHintType) -> bool
self and other values to be equal, and is used
by ==.impl Copy for DecodeHintType
impl Eq for DecodeHintType
impl StructuralEq for DecodeHintType
impl StructuralPartialEq for DecodeHintType
Auto Trait Implementations§
impl RefUnwindSafe for DecodeHintType
impl Send for DecodeHintType
impl Sync for DecodeHintType
impl Unpin for DecodeHintType
impl UnwindSafe for DecodeHintType
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.