1 58 package org.krysalis.barcode.tools; 59 60 65 public class UnitConv { 66 67 70 protected UnitConv() { 71 throw new UnsupportedOperationException (); 72 } 73 74 79 public static double mm2pt(double mm) { 80 return mm * 2.835; 81 } 82 83 88 public static double pt2mm(double pt) { 89 return pt / 2.835; 90 } 91 92 97 public static double mm2in(double mm) { 98 return mm / 25.4; 99 } 100 101 106 public static double in2mm(double in) { 107 return in * 25.4; 108 } 109 110 116 public static int mm2px(double mm, int resolution) { 117 return (int)Math.round(mm2in(mm) * resolution); 118 } 119 120 } 121 | Popular Tags |