barcode4j 2.1.0

org.krysalis.barcode4j.impl.pdf417
Class PDF417LogicImpl

java.lang.Object
  extended by org.krysalis.barcode4j.impl.pdf417.PDF417LogicImpl

public class PDF417LogicImpl
extends java.lang.Object

Top-level class for the logic part of the PDF417 implementation.

Version:
$Id: PDF417LogicImpl.java,v 1.4 2007/07/11 08:22:41 jmaerki Exp $

Constructor Summary
PDF417LogicImpl()
           
 
Method Summary
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).
static java.awt.Dimension determineDimensions(PDF417Bean pdf417Bean, int sourceCodeWords)
          Determine optimal nr of columns and rows for the specified number of codewords.
static void generateBarcodeLogic(TwoDimBarcodeLogicHandler logic, java.lang.String msg, PDF417Bean pdf417Bean)
          Generates the barcode logic.
static int getNumberOfDataCodewords(int m, int errorCorrectionLevel, int c)
          Calculates the number of data codewords (equals the Symbol Length Descriptor).
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).
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDF417LogicImpl

public PDF417LogicImpl()
Method Detail

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 codewords
k - the number of error correction codewords
c - 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 codewords
k - the number of error correction codewords
c - 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 codewords
k - the number of error correction codewords
c - 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 codewords
errorCorrectionLevel - 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,
                                        java.lang.String msg,
                                        PDF417Bean pdf417Bean)
Generates the barcode logic.

Parameters:
logic - the logic handler to receive generated events
msg - the message to encode
pdf417Bean - reference to the PDF417 bean for configuration access

determineDimensions

public static java.awt.Dimension determineDimensions(PDF417Bean pdf417Bean,
                                                     int sourceCodeWords)
Determine optimal nr of columns and rows for the specified number of codewords.

Parameters:
pdf417Bean - contains configuration settings
sourceCodeWords - number of code words
Returns:
dimension object containing cols as width and rows as height

barcode4j 2.1.0

Copyright © 2000-2010 Jeremias Maerki. All rights reserved.