Class PDF417LogicImpl
java.lang.Object
org.krysalis.barcode4j.impl.pdf417.PDF417LogicImpl
Top-level class for the logic part of the PDF417 implementation.
- Version:
- $Id: PDF417LogicImpl.java,v 1.5 2012-05-17 13:57:37 jmaerki Exp $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateNumberOfRows(int m, int k, int c) Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).static DimensiondetermineDimensions(PDF417Bean pdf417Bean, int sourceCodeWords) Determine optimal nr of columns and rows for the specified number of codewords.static voidgenerateBarcodeLogic(TwoDimBarcodeLogicHandler logic, String msg, PDF417Bean pdf417Bean) Generates the barcode logic.static intgetNumberOfDataCodewords(int m, int errorCorrectionLevel, int c) Calculates the number of data codewords (equals the Symbol Length Descriptor).static intgetNumberOfPadCodewords(int m, int k, int c, int r) Calculates the number of pad codewords as described in 4.9.2 of ISO/IEC 15438:2001(E).static intgetNumberOfRows(int m, int k, int c) Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
-
Constructor Details
-
PDF417LogicImpl
public PDF417LogicImpl()
-
-
Method Details
-
getNumberOfRows
public static int getNumberOfRows(int m, int k, int c) Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).- Parameters:
m- the number of source codewords prior to the additional of the Symbol Length Descriptor and any pad codewordsk- the number of error correction codewordsc- the number of columns in the symbol in the data region (excluding start, stop and row indicator codewords)- Returns:
- the number of rows in the symbol (r)
-
calculateNumberOfRows
public static int calculateNumberOfRows(int m, int k, int c) Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).- Parameters:
m- the number of source codewords prior to the additional of the Symbol Length Descriptor and any pad codewordsk- the number of error correction codewordsc- the number of columns in the symbol in the data region (excluding start, stop and row indicator codewords)- Returns:
- the number of rows in the symbol (r)
-
getNumberOfPadCodewords
public static int getNumberOfPadCodewords(int m, int k, int c, int r) Calculates the number of pad codewords as described in 4.9.2 of ISO/IEC 15438:2001(E).- Parameters:
m- the number of source codewords prior to the additional of the Symbol Length Descriptor and any pad codewordsk- the number of error correction codewordsc- the number of columns in the symbol in the data region (excluding start, stop and row indicator codewords)r- the number of rows in the symbol- Returns:
- the number of pad codewords
-
getNumberOfDataCodewords
public static int getNumberOfDataCodewords(int m, int errorCorrectionLevel, int c) Calculates the number of data codewords (equals the Symbol Length Descriptor).- Parameters:
m- the number of source codewords prior to the additional of the Symbol Length Descriptor and any pad codewordserrorCorrectionLevel- the error correction level (value between 0 and 8)c- the number of columns in the symbol in the data region (excluding start, stop and row indicator codewords)- Returns:
- the number of data codewords
-
generateBarcodeLogic
public static void generateBarcodeLogic(TwoDimBarcodeLogicHandler logic, String msg, PDF417Bean pdf417Bean) Generates the barcode logic.- Parameters:
logic- the logic handler to receive generated eventsmsg- the message to encodepdf417Bean- reference to the PDF417 bean for configuration access
-
determineDimensions
Determine optimal nr of columns and rows for the specified number of codewords.- Parameters:
pdf417Bean- contains configuration settingssourceCodeWords- number of code words- Returns:
- dimension object containing cols as width and rows as height
-