barcode4j 2.1.0

org.krysalis.barcode4j.tools
Class UnitConv

java.lang.Object
  extended by org.krysalis.barcode4j.tools.UnitConv

public class UnitConv
extends java.lang.Object

Utility class for unit conversions.

Version:
$Id: UnitConv.java,v 1.2 2004/09/04 20:25:56 jmaerki Exp $
Author:
Jeremias Maerki

Constructor Summary
protected UnitConv()
          Utility class: Constructor prevents instantiating when subclassed.
 
Method Summary
static double in2mm(double in)
          Converts inches (in) to millimeters (mm)
static double mm2in(double mm)
          Converts millimeters (mm) to inches (in)
static double mm2pt(double mm)
          Converts millimeters (mm) to points (pt)
static int mm2px(double mm, int resolution)
          Converts millimeters (mm) to pixels (px)
static double pt2mm(double pt)
          Converts points (pt) to millimeters (mm)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitConv

protected UnitConv()
Utility class: Constructor prevents instantiating when subclassed.

Method Detail

mm2pt

public static double mm2pt(double mm)
Converts millimeters (mm) to points (pt)

Parameters:
mm - the value in mm
Returns:
the value in pt

pt2mm

public static double pt2mm(double pt)
Converts points (pt) to millimeters (mm)

Parameters:
pt - the value in pt
Returns:
the value in mm

mm2in

public static double mm2in(double mm)
Converts millimeters (mm) to inches (in)

Parameters:
mm - the value in mm
Returns:
the value in inches

in2mm

public static double in2mm(double in)
Converts inches (in) to millimeters (mm)

Parameters:
in - the value in inches
Returns:
the value in mm

mm2px

public static int mm2px(double mm,
                        int resolution)
Converts millimeters (mm) to pixels (px)

Parameters:
mm - the value in mm
resolution - the resolution in dpi (dots per inch)
Returns:
the value in pixels

barcode4j 2.1.0

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