Package org.krysalis.barcode4j
Class BarcodeDimension
java.lang.Object
org.krysalis.barcode4j.BarcodeDimension
This class provides information on the dimensions of a barcode. It makes a
distinction between the dimensions with and without quiet zone.
- Version:
- $Id: BarcodeDimension.java,v 1.3 2006-11-07 16:43:37 jmaerki Exp $
- Author:
- Jeremias Maerki
-
Constructor Summary
ConstructorsConstructorDescriptionBarcodeDimension(double w, double h) Creates a new BarcodeDimension object.BarcodeDimension(double w, double h, double wpq, double hpq, double xoffset, double yoffset) Creates a new BarcodeDimension object. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the height of the barcode (ignores quiet-zone).doublegetHeight(int orientation) doubleReturns the height of the barcode (quiet-zone included).doublegetHeightPlusQuiet(int orientation) doublegetWidth()Returns the width of the barcode (ignores quiet-zone).doublegetWidth(int orientation) doubleReturns the width of the barcode (quiet-zone included).doublegetWidthPlusQuiet(int orientation) doubleReturns the x-offset of the upper-left corner of the barcode within the extended barcode area.doubleReturns the y-offset of the upper-left corner of the barcode within the extended barcode area.static intnormalizeOrientation(int orientation) toString()
-
Constructor Details
-
BarcodeDimension
public BarcodeDimension(double w, double h) Creates a new BarcodeDimension object. No quiet-zone is respected.- Parameters:
w- width of the barcode in millimeters (mm).h- height of the barcode in millimeters (mm).
-
BarcodeDimension
public BarcodeDimension(double w, double h, double wpq, double hpq, double xoffset, double yoffset) Creates a new BarcodeDimension object.- Parameters:
w- width of the raw barcode (without quiet-zone) in millimeters (mm).h- height of the raw barcode (without quiet-zone) in millimeters (mm).wpq- width of the barcode (quiet-zone included) in millimeters (mm).hpq- height of the barcode (quiet-zone included) in millimeters (mm).xoffset- x-offset if the upper-left corner of the barcode within the extended barcode area.yoffset- y-offset if the upper-left corner of the barcode within the extended barcode area.
-
-
Method Details
-
normalizeOrientation
public static int normalizeOrientation(int orientation) -
getHeight
public double getHeight()Returns the height of the barcode (ignores quiet-zone).- Returns:
- height in millimeters (mm)
-
getHeight
public double getHeight(int orientation) -
getHeightPlusQuiet
public double getHeightPlusQuiet()Returns the height of the barcode (quiet-zone included).- Returns:
- height in millimeters (mm)
-
getHeightPlusQuiet
public double getHeightPlusQuiet(int orientation) -
getWidth
public double getWidth()Returns the width of the barcode (ignores quiet-zone).- Returns:
- width in millimeters (mm)
-
getWidth
public double getWidth(int orientation) -
getWidthPlusQuiet
public double getWidthPlusQuiet()Returns the width of the barcode (quiet-zone included).- Returns:
- width in millimeters (mm)
-
getWidthPlusQuiet
public double getWidthPlusQuiet(int orientation) -
getXOffset
public double getXOffset()Returns the x-offset of the upper-left corner of the barcode within the extended barcode area.- Returns:
- double x-offset in millimeters (mm)
-
getYOffset
public double getYOffset()Returns the y-offset of the upper-left corner of the barcode within the extended barcode area.- Returns:
- double y-offset in millimeters (mm)
-
getBoundingRect
- Returns:
- a bounding rectangle (including quiet zone if applicable)
-
getContentRect
- Returns:
- a content rectangle (excluding quiet zone)
-
toString
-