feature flag for optional compliant qr decode

This commit is contained in:
Henry Schimke
2023-01-09 11:38:23 -06:00
parent 379899d214
commit c04bf06d15
3 changed files with 76 additions and 7 deletions

View File

@@ -104,8 +104,19 @@ pub enum DecodeHintType {
* second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
*/
ALSO_INVERTED,
// End of enumeration values.
/**
* Specifies that the codes are expected to be in conformance with the specification
* ISO/IEC 18004 regading the interpretation of character encoding. Values encoded in BYTE mode
* or in KANJI mode are interpreted as ISO-8859-1 characters unless an ECI specified at a prior
* location in the input specified a different encoding. By default the encoding of BYTE encoded
* values is determinied by the {@link #CHARACTER_SET} hint or otherwise by a heuristic that
* examines the bytes. By default KANJI encoded values are interpreted as the bytes of Shift-JIS
* encoded characters (note that this is the case even if an ECI specifies a different
* encoding).
*/
#[cfg(feature = "allow_forced_iso_ied_18004_compliance")]
QR_ASSUME_SPEC_CONFORM_INPUT,
/*
* Data type the hint is expecting.
* Among the possible values the {@link Void} stands out as being used for
@@ -201,5 +212,17 @@ pub enum DecodeHintValue {
* second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
*/
AlsoInverted(bool),
// End of enumeration values.
/**
* Specifies that the codes are expected to be in conformance with the specification
* ISO/IEC 18004 regading the interpretation of character encoding. Values encoded in BYTE mode
* or in KANJI mode are interpreted as ISO-8859-1 characters unless an ECI specified at a prior
* location in the input specified a different encoding. By default the encoding of BYTE encoded
* values is determinied by the {@link #CHARACTER_SET} hint or otherwise by a heuristic that
* examines the bytes. By default KANJI encoded values are interpreted as the bytes of Shift-JIS
* encoded characters (note that this is the case even if an ECI specifies a different
* encoding).
*/
#[cfg(feature = "allow_forced_iso_ied_18004_compliance")]
QrAssumeSpecConformInput(bool),
}