(* Copyright (C) 1992, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* *) (* Last modified on Thu Dec 31 13:44:28 PST 1992 by mhb *) (* modified on Tue Jun 16 12:56:44 PDT 1992 by muller *) (* modified on Fri Apr 17 18:14:06 1992 by steveg *) (* The "Pts" interface contains utilities to convert between points and pixels. VBTkit uses 72 points per inch, following the Postscript convention \cite[page 151]{Postscript}. There are 25.4 millimeters to the inch. The locking level is arbitrary for all procedures in this interface. *) INTERFACE Pts; IMPORT Axis, VBT; PROCEDURE ToScreenPixels (v: VBT.T; pts: REAL; ax: Axis.T): INTEGER; (* Return the number of screen pixels that correspond to "pts" points on "v"'s screentype in the axis "ax"; or return "0" if "v"'s screentype is "NIL". Equivalent to | ROUND (ToPixels (v, pts, ax)) *) PROCEDURE ToPixels (v: VBT.T; pts: REAL; ax: Axis.T): REAL; (* Return the number of pixels that correspond to "pts" points on "v"'s screentype in the axis "ax"; or return "0" if "v"'s screentype is "NIL". *) CONST PtsPerInch = 72.0; MMPerInch = 25.4; PROCEDURE FromMM (mm: REAL): REAL; (* Convert from millimeters to points. *) PROCEDURE ToMM (pts: REAL): REAL; (* Convert from points to millimeters. *) END Pts.