aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/cursor/grcscr.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/gio/cursor/grcscr.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/gio/cursor/grcscr.x')
-rw-r--r--sys/gio/cursor/grcscr.x49
1 files changed, 49 insertions, 0 deletions
diff --git a/sys/gio/cursor/grcscr.x b/sys/gio/cursor/grcscr.x
new file mode 100644
index 00000000..add322b4
--- /dev/null
+++ b/sys/gio/cursor/grcscr.x
@@ -0,0 +1,49 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <gio.h>
+include <gki.h>
+include "gtr.h"
+
+# GRC_SCRTONDC -- Coordinate transformation from screen coordinates to NDC
+# coordinates. Screen coordinates physically address the device screen and
+# range from 0 to 1 in either axis. NDC coordinates also range from 0 to 1
+# in either axis but differ from screen coordinates when the workstation
+# transformation is non unitary. The workstation transformation parameters
+# are cached in the GTR common. We assume that GTR_INIT has already been
+# called to initialize the common for a graphics stream.
+
+procedure grc_scrtondc (sx, sy, mx, my)
+
+real sx, sy # screen coordinates (input)
+real mx, my # NDC coordinates (output)
+include "gtr.com"
+
+begin
+ if (wstranset == YES) {
+ mx = ((sx * GKI_MAXNDC - xorigin) / xscale + mx1) / GKI_MAXNDC
+ my = ((sy * GKI_MAXNDC - yorigin) / yscale + my1) / GKI_MAXNDC
+ } else {
+ mx = sx
+ my = sy
+ }
+end
+
+
+# GRC_NDCTOSCR -- Coordinate transformation from NDC coordinates to screen
+# coordinates.
+
+procedure grc_ndctoscr (mx, my, sx, sy)
+
+real mx, my # NDC coordinates (input)
+real sx, sy # screen coordinates (output)
+include "gtr.com"
+
+begin
+ if (wstranset == YES) {
+ sx = ((mx * GKI_MAXNDC - mx1) * xscale + xorigin) / GKI_MAXNDC
+ sy = ((my * GKI_MAXNDC - my1) * yscale + yorigin) / GKI_MAXNDC
+ } else {
+ sx = mx
+ sy = my
+ }
+end