Class DataMatrixWriter
java.lang.Object
com.google.zxing.datamatrix.DataMatrixWriter
- All Implemented Interfaces:
Writer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BitMatrixconvertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) Convert the ByteMatrix to BitMatrix.encode(String contents, BarcodeFormat format, int width, int height) Encode a barcode using the default settings.encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) private static BitMatrixencodeLowLevel(DefaultPlacement placement, SymbolInfo symbolInfo, int width, int height) Encode the given symbol info to a bit matrix.
-
Constructor Details
-
DataMatrixWriter
public DataMatrixWriter()
-
-
Method Details
-
encode
Description copied from interface:WriterEncode a barcode using the default settings. -
encode
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) - Specified by:
encodein interfaceWriter- Parameters:
contents- The contents to encode in the barcodeformat- The barcode format to generatewidth- The preferred width in pixelsheight- The preferred height in pixelshints- Additional parameters to supply to the encoder- Returns:
BitMatrixrepresenting encoded barcode image
-
encodeLowLevel
private static BitMatrix encodeLowLevel(DefaultPlacement placement, SymbolInfo symbolInfo, int width, int height) Encode the given symbol info to a bit matrix.- Parameters:
placement- The DataMatrix placement.symbolInfo- The symbol info to encode.- Returns:
- The bit matrix generated.
-
convertByteMatrixToBitMatrix
private static BitMatrix convertByteMatrixToBitMatrix(ByteMatrix matrix, int reqWidth, int reqHeight) Convert the ByteMatrix to BitMatrix.- Parameters:
matrix- The input matrix.reqWidth- The requested width of the image (in pixels) with the Datamatrix codereqHeight- The requested height of the image (in pixels) with the Datamatrix code- Returns:
- The output matrix.
-