Package com.google.zxing.oned
Class Code128Writer
- java.lang.Object
-
- com.google.zxing.oned.OneDimensionalCodeWriter
-
- com.google.zxing.oned.Code128Writer
-
- All Implemented Interfaces:
Writer
public final class Code128Writer extends OneDimensionalCodeWriter
This object renders a CODE128 code as aBitMatrix
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Code128Writer.CType
private static class
Code128Writer.MinimalEncoder
Encodes minimally using Divide-And-Conquer with Memoization
-
Field Summary
Fields Modifier and Type Field Description private static int
CODE_CODE_A
private static int
CODE_CODE_B
private static int
CODE_CODE_C
private static int
CODE_FNC_1
private static int
CODE_FNC_2
private static int
CODE_FNC_3
private static int
CODE_FNC_4_A
private static int
CODE_FNC_4_B
private static int
CODE_START_A
private static int
CODE_START_B
private static int
CODE_START_C
private static int
CODE_STOP
private static char
ESCAPE_FNC_1
private static char
ESCAPE_FNC_2
private static char
ESCAPE_FNC_3
private static char
ESCAPE_FNC_4
-
Constructor Summary
Constructors Constructor Description Code128Writer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
check(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)
private static int
chooseCode(java.lang.CharSequence value, int start, int oldCode)
boolean[]
encode(java.lang.String contents)
Encode the contents to boolean array expression of one-dimensional barcode.boolean[]
encode(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)
Can be overwritten if the encode requires to read the hints map.private static boolean[]
encodeFast(java.lang.String contents, int forcedCodeSet)
private static Code128Writer.CType
findCType(java.lang.CharSequence value, int start)
protected java.util.Collection<BarcodeFormat>
getSupportedWriteFormats()
(package private) static boolean[]
produceResult(java.util.Collection<int[]> patterns, int checkSum)
-
Methods inherited from class com.google.zxing.oned.OneDimensionalCodeWriter
appendPattern, checkNumeric, encode, encode, getDefaultMargin
-
-
-
-
Field Detail
-
CODE_START_A
private static final int CODE_START_A
- See Also:
- Constant Field Values
-
CODE_START_B
private static final int CODE_START_B
- See Also:
- Constant Field Values
-
CODE_START_C
private static final int CODE_START_C
- See Also:
- Constant Field Values
-
CODE_CODE_A
private static final int CODE_CODE_A
- See Also:
- Constant Field Values
-
CODE_CODE_B
private static final int CODE_CODE_B
- See Also:
- Constant Field Values
-
CODE_CODE_C
private static final int CODE_CODE_C
- See Also:
- Constant Field Values
-
CODE_STOP
private static final int CODE_STOP
- See Also:
- Constant Field Values
-
ESCAPE_FNC_1
private static final char ESCAPE_FNC_1
- See Also:
- Constant Field Values
-
ESCAPE_FNC_2
private static final char ESCAPE_FNC_2
- See Also:
- Constant Field Values
-
ESCAPE_FNC_3
private static final char ESCAPE_FNC_3
- See Also:
- Constant Field Values
-
ESCAPE_FNC_4
private static final char ESCAPE_FNC_4
- See Also:
- Constant Field Values
-
CODE_FNC_1
private static final int CODE_FNC_1
- See Also:
- Constant Field Values
-
CODE_FNC_2
private static final int CODE_FNC_2
- See Also:
- Constant Field Values
-
CODE_FNC_3
private static final int CODE_FNC_3
- See Also:
- Constant Field Values
-
CODE_FNC_4_A
private static final int CODE_FNC_4_A
- See Also:
- Constant Field Values
-
CODE_FNC_4_B
private static final int CODE_FNC_4_B
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSupportedWriteFormats
protected java.util.Collection<BarcodeFormat> getSupportedWriteFormats()
- Overrides:
getSupportedWriteFormats
in classOneDimensionalCodeWriter
-
encode
public boolean[] encode(java.lang.String contents)
Description copied from class:OneDimensionalCodeWriter
Encode the contents to boolean array expression of one-dimensional barcode. Start code and end code should be included in result, and side margins should not be included.- Specified by:
encode
in classOneDimensionalCodeWriter
- Parameters:
contents
- barcode contents to encode- Returns:
- a
boolean[]
of horizontal pixels (false = white, true = black)
-
encode
public boolean[] encode(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)
Description copied from class:OneDimensionalCodeWriter
Can be overwritten if the encode requires to read the hints map. Otherwise it defaults toencode
.- Overrides:
encode
in classOneDimensionalCodeWriter
- Parameters:
contents
- barcode contents to encodehints
- encoding hints- Returns:
- a
boolean[]
of horizontal pixels (false = white, true = black)
-
check
private static int check(java.lang.String contents, java.util.Map<EncodeHintType,?> hints)
-
encodeFast
private static boolean[] encodeFast(java.lang.String contents, int forcedCodeSet)
-
produceResult
static boolean[] produceResult(java.util.Collection<int[]> patterns, int checkSum)
-
findCType
private static Code128Writer.CType findCType(java.lang.CharSequence value, int start)
-
chooseCode
private static int chooseCode(java.lang.CharSequence value, int start, int oldCode)
-
-