Package com.google.zxing.datamatrix
Class DataMatrixWriter
java.lang.Object
com.google.zxing.datamatrix.DataMatrixWriter
- All Implemented Interfaces:
Writer
This object renders a Data Matrix code as a BitMatrix 2D array of greyscale values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BitMatrix
convertByteMatrixToBitMatrix
(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 BitMatrix
encodeLowLevel
(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:Writer
Encode a barcode using the default settings. -
encode
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) - Specified by:
encode
in 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:
BitMatrix
representing 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.
-