Package com.google.zxing.aztec.encoder
Class Encoder
java.lang.Object
com.google.zxing.aztec.encoder.Encoder
Generates Aztec 2D barcodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
private static final int
private static final int
private static final int[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int[]
bitsToWords
(BitArray stuffedBits, int wordSize, int totalWords) private static void
drawBullsEye
(BitMatrix matrix, int center, int size) private static void
drawModeMessage
(BitMatrix matrix, boolean compact, int matrixSize, BitArray modeMessage) static AztecCode
encode
(byte[] data) Encodes the given binary content as an Aztec symbol (without ECI code)static AztecCode
encode
(byte[] data, int minECCPercent, int userSpecifiedLayers) Encodes the given binary content as an Aztec symbol (without ECI code)static AztecCode
Encodes the given binary content as an Aztec symbolstatic AztecCode
Encodes the given string content as an Aztec symbol (without ECI code)static AztecCode
Encodes the given string content as an Aztec symbol (without ECI code)static AztecCode
Encodes the given string content as an Aztec symbolprivate static BitArray
generateCheckWords
(BitArray bitArray, int totalBits, int wordSize) (package private) static BitArray
generateModeMessage
(boolean compact, int layers, int messageSizeInWords) private static GenericGF
getGF
(int wordSize) (package private) static BitArray
private static int
totalBitsInLayer
(int layers, boolean compact)
-
Field Details
-
DEFAULT_EC_PERCENT
public static final int DEFAULT_EC_PERCENT- See Also:
-
DEFAULT_AZTEC_LAYERS
public static final int DEFAULT_AZTEC_LAYERS- See Also:
-
MAX_NB_BITS
private static final int MAX_NB_BITS- See Also:
-
MAX_NB_BITS_COMPACT
private static final int MAX_NB_BITS_COMPACT- See Also:
-
WORD_SIZE
private static final int[] WORD_SIZE
-
-
Constructor Details
-
Encoder
private Encoder()
-
-
Method Details
-
encode
Encodes the given string content as an Aztec symbol (without ECI code)- Parameters:
data
- input data string; must be encodable as ISO/IEC 8859-1 (Latin-1)- Returns:
- Aztec symbol matrix with metadata
-
encode
Encodes the given string content as an Aztec symbol (without ECI code)- Parameters:
data
- input data string; must be encodable as ISO/IEC 8859-1 (Latin-1)minECCPercent
- minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended)userSpecifiedLayers
- if non-zero, a user-specified value for the number of layers- Returns:
- Aztec symbol matrix with metadata
-
encode
public static AztecCode encode(String data, int minECCPercent, int userSpecifiedLayers, Charset charset) Encodes the given string content as an Aztec symbol- Parameters:
data
- input data stringminECCPercent
- minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended)userSpecifiedLayers
- if non-zero, a user-specified value for the number of layerscharset
- character set in which to encode string using ECI; if null, no ECI code will be inserted, and the string must be encodable as ISO/IEC 8859-1 (Latin-1), the default encoding of the symbol.- Returns:
- Aztec symbol matrix with metadata
-
encode
Encodes the given binary content as an Aztec symbol (without ECI code)- Parameters:
data
- input data string- Returns:
- Aztec symbol matrix with metadata
-
encode
Encodes the given binary content as an Aztec symbol (without ECI code)- Parameters:
data
- input data stringminECCPercent
- minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended)userSpecifiedLayers
- if non-zero, a user-specified value for the number of layers- Returns:
- Aztec symbol matrix with metadata
-
encode
public static AztecCode encode(byte[] data, int minECCPercent, int userSpecifiedLayers, Charset charset) Encodes the given binary content as an Aztec symbol- Parameters:
data
- input data stringminECCPercent
- minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended)userSpecifiedLayers
- if non-zero, a user-specified value for the number of layerscharset
- character set to mark using ECI; if null, no ECI code will be inserted, and the default encoding of ISO/IEC 8859-1 will be assuming by readers.- Returns:
- Aztec symbol matrix with metadata
-
drawBullsEye
-
generateModeMessage
-
drawModeMessage
-
generateCheckWords
-
bitsToWords
-
getGF
-
stuffBits
-
totalBitsInLayer
private static int totalBitsInLayer(int layers, boolean compact)
-