pub enum EncodeHintType {
Show 20 variants
ERROR_CORRECTION,
CHARACTER_SET,
DATA_MATRIX_SHAPE,
DATA_MATRIX_COMPACT,
MIN_SIZE,
MAX_SIZE,
MARGIN,
PDF417_COMPACT,
PDF417_COMPACTION,
PDF417_DIMENSIONS,
PDF417_AUTO_ECI,
AZTEC_LAYERS,
QR_VERSION,
QR_MASK_PATTERN,
QR_COMPACT,
GS1_FORMAT,
FORCE_CODE_SET,
FORCE_C40,
CODE128_COMPACT,
TELEPEN_AS_NUMERIC,
}Expand description
These are a set of hints that you may pass to Writers to specify their behavior.
@author dswitkin@google.com (Daniel Switkin)
Variants§
ERROR_CORRECTION
Specifies what degree of error correction to use, for example in QR Codes. Type depends on the encoder. For example for QR codes it’s type {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}. For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words. For PDF417 it is of type {@link Integer}, valid values being 0 to 8. In all cases, it can also be a {@link String} representation of the desired value as well. Note: an Aztec symbol should have a minimum of 25% EC words.
CHARACTER_SET
Specifies what character encoding to use where applicable (type {@link String})
DATA_MATRIX_SHAPE
Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
DATA_MATRIX_COMPACT
Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or “true” or “false” {@link String } value). The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1 character set via ECIs. Please note that in that case, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint. Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords for the purpose of delimiting AIs. This option and {@link #FORCE_C40} are mutually exclusive.
MIN_SIZE
Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
@deprecated use width/height params in {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
MAX_SIZE
Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
@deprecated without replacement
MARGIN
Specifies margin, in pixels, to use when generating the barcode. The meaning can vary by format; for example it controls margin before and after the barcode horizontally for most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
PDF417_COMPACT
Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or “true” or “false” {@link String} value).
PDF417_COMPACTION
Specifies what compaction mode to use for PDF417 (type {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its enum values).
PDF417_DIMENSIONS
Specifies the minimum and maximum number of rows and columns for PDF417 (type {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
PDF417_AUTO_ECI
Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or “true” or “false” {@link String} value). Please note that in that case, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
AZTEC_LAYERS
Specifies the required number of layers for an Aztec code. A negative number (-1, -2, -3, -4) specifies a compact Aztec code. 0 indicates to use the minimum number of layers (the default). A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code. (Type {@link Integer}, or {@link String} representation of the integer value).
QR_VERSION
Specifies the exact version of QR code to be encoded. (Type {@link Integer}, or {@link String} representation of the integer value).
QR_MASK_PATTERN
Specifies the QR code mask pattern to be used. Allowed values are 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select the optimal mask pattern.
- (Type {@link Integer}, or {@link String} representation of the integer value).
QR_COMPACT
Specifies whether to use compact mode for QR code (type {@link Boolean}, or “true” or “false” {@link String } value). Please note that when compaction is performed, the most compact character encoding is chosen for characters in the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
GS1_FORMAT
Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or “true” or “false” {@link String } value).
FORCE_CODE_SET
Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}). Valid values are “A”, “B”, “C”. This option and {@link #CODE128_COMPACT} are mutually exclusive.
FORCE_C40
Forces C40 encoding for data-matrix (type {@link Boolean}, or “true” or “false”) {@link String } value). This option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
CODE128_COMPACT
Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or “true” or “false” {@link String } value). This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually exclusive.
TELEPEN_AS_NUMERIC
Trait Implementations§
Source§impl Clone for EncodeHintType
impl Clone for EncodeHintType
Source§fn clone(&self) -> EncodeHintType
fn clone(&self) -> EncodeHintType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EncodeHintType
impl Debug for EncodeHintType
Source§impl<'de> Deserialize<'de> for EncodeHintType
impl<'de> Deserialize<'de> for EncodeHintType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for EncodeHintType
impl Hash for EncodeHintType
Source§impl PartialEq for EncodeHintType
impl PartialEq for EncodeHintType
Source§impl Serialize for EncodeHintType
impl Serialize for EncodeHintType
impl Copy for EncodeHintType
impl Eq for EncodeHintType
impl StructuralPartialEq for EncodeHintType
Auto Trait Implementations§
impl Freeze for EncodeHintType
impl RefUnwindSafe for EncodeHintType
impl Send for EncodeHintType
impl Sync for EncodeHintType
impl Unpin for EncodeHintType
impl UnwindSafe for EncodeHintType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.