aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/gim/gimwpix.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/gim/gimwpix.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/gio/gim/gimwpix.x')
-rw-r--r--sys/gio/gim/gimwpix.x47
1 files changed, 47 insertions, 0 deletions
diff --git a/sys/gio/gim/gimwpix.x b/sys/gio/gim/gimwpix.x
new file mode 100644
index 00000000..fc55a55b
--- /dev/null
+++ b/sys/gio/gim/gimwpix.x
@@ -0,0 +1,47 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <mach.h>
+include <gio.h>
+include <gescape.h>
+
+# GIM_WRITEPIXELS -- Write to a rectangular region of a raster.
+
+procedure gim_writepixels (gp, raster, data, nbits, x1, y1, nx, ny)
+
+pointer gp #I graphics descriptor
+int raster #I raster number (0 is display window)
+short data[ARB] #I output pixel data
+int nbits #I nbits per raster pixel (1,8,16,32)
+int x1, y1 #I first pixel to be written
+int nx, ny #I size of region to be written
+
+int npix, nchars, nwords
+short gim[GIM_WRITEPIXELS_LEN]
+errchk gpl_flush, gpl_cache
+include "../gpl.com"
+
+begin
+ # Flush any buffered polyline output. Make sure the wcs transformation
+ # in the cache is up to date.
+
+ if (op > 1)
+ call gpl_flush()
+ else if (gp != gp_out || GP_WCS(gp) != wcs)
+ call gpl_cache (gp)
+
+ # Output the writepixels escape.
+ npix = nx * ny
+ nchars = (npix * nbits / NBITS_BYTE + SZB_CHAR-1) / SZB_CHAR
+ nwords = (nchars + SZ_SHORT-1) / SZ_SHORT
+
+ gim[GIM_WRITEPIXELS_RN] = raster
+ gim[GIM_WRITEPIXELS_EC] = 0
+ gim[GIM_WRITEPIXELS_X1] = x1
+ gim[GIM_WRITEPIXELS_Y1] = y1
+ gim[GIM_WRITEPIXELS_NX] = nx
+ gim[GIM_WRITEPIXELS_NY] = ny
+ gim[GIM_WRITEPIXELS_BP] = nbits
+
+ call gki_wescape (GP_FD(gp), GIM_WRITEPIXELS,
+ gim, GIM_WRITEPIXELS_LEN, data, nwords)
+end