org.apache.poi.util
Class Units

java.lang.Object
  extended by org.apache.poi.util.Units

public class Units
extends java.lang.Object

Author:
Yegor Kozlov

Field Summary
static int EMU_PER_CENTIMETER
           
static int EMU_PER_PIXEL
          In Escher absolute distances are specified in English Metric Units (EMUs), occasionally referred to as A units; there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point.
static int EMU_PER_POINT
           
static int MASTER_DPI
          Master DPI (576 pixels per inch).
static int PIXEL_DPI
          Pixels DPI (96 pixels per inch)
static int POINT_DPI
          Points DPI (72 pixels per inch)
 
Constructor Summary
Units()
           
 
Method Summary
static int doubleToFixedPoint(double floatPoint)
          Converts a value of type floating point to a FixedPoint
static double fixedPointToDouble(int fixedPoint)
          Converts a value of type FixedPoint to a floating point
static double masterToPoints(int masterDPI)
           
static double pixelToPoints(int pixel)
           
static int pointsToMaster(double points)
           
static int pointsToPixel(double points)
           
static int toEMU(double points)
          Converts points to EMUs
static double toPoints(long emu)
          Converts EMUs to points
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMU_PER_PIXEL

public static final int EMU_PER_PIXEL
In Escher absolute distances are specified in English Metric Units (EMUs), occasionally referred to as A units; there are 360000 EMUs per centimeter, 914400 EMUs per inch, 12700 EMUs per point.

See Also:
Constant Field Values

EMU_PER_POINT

public static final int EMU_PER_POINT
See Also:
Constant Field Values

EMU_PER_CENTIMETER

public static final int EMU_PER_CENTIMETER
See Also:
Constant Field Values

MASTER_DPI

public static final int MASTER_DPI
Master DPI (576 pixels per inch). Used by the reference coordinate system in PowerPoint (HSLF)

See Also:
Constant Field Values

PIXEL_DPI

public static final int PIXEL_DPI
Pixels DPI (96 pixels per inch)

See Also:
Constant Field Values

POINT_DPI

public static final int POINT_DPI
Points DPI (72 pixels per inch)

See Also:
Constant Field Values
Constructor Detail

Units

public Units()
Method Detail

toEMU

public static int toEMU(double points)
Converts points to EMUs

Parameters:
points - points
Returns:
emus

toPoints

public static double toPoints(long emu)
Converts EMUs to points

Parameters:
emu - emu
Returns:
points

fixedPointToDouble

public static double fixedPointToDouble(int fixedPoint)
Converts a value of type FixedPoint to a floating point

Parameters:
fixedPoint -
Returns:
floating point (double)
See Also:
[MS-OSHARED] - 2.2.1.6 FixedPoint

doubleToFixedPoint

public static int doubleToFixedPoint(double floatPoint)
Converts a value of type floating point to a FixedPoint

Parameters:
floatPoint -
Returns:
fixedPoint
See Also:
[MS-OSHARED] - 2.2.1.6 FixedPoint

masterToPoints

public static double masterToPoints(int masterDPI)

pointsToMaster

public static int pointsToMaster(double points)

pointsToPixel

public static int pointsToPixel(double points)

pixelToPoints

public static double pixelToPoints(int pixel)


Copyright 2016 The Apache Software Foundation or its licensors, as applicable.