From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/images/tv/display/imdmapfr.x | 108 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 pkg/images/tv/display/imdmapfr.x (limited to 'pkg/images/tv/display/imdmapfr.x') diff --git a/pkg/images/tv/display/imdmapfr.x b/pkg/images/tv/display/imdmapfr.x new file mode 100644 index 00000000..745febe2 --- /dev/null +++ b/pkg/images/tv/display/imdmapfr.x @@ -0,0 +1,108 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include +include +include +include "display.h" +include "iis.h" + +# IMD_MAPFRAME -- Open the given frame of the stdimage display device on an +# IMIO image descriptor. + +pointer procedure imd_mapframe (frame, mode, select_frame) + +int frame #I frame to be opened [1:N] +int mode #I access mode +int select_frame #I make frame the display frame + +pointer ds +int chan[MAXCHAN] +char device[SZ_FNAME] + +pointer imdmap() +extern imdopen() +int imstati(), fstati(), envgets() +errchk imdmap, imseti +include "iis.com" + +begin + if (envgets ("stdimage", device, SZ_FNAME) == 0) + call error (1, "variable `stdimage' not defined in environment") + + # Pass frame number into IIS code. + call iis_setframe (frame) + + # Map the frame onto an image descriptor. + ds = imdmap (device, mode, imdopen) + # call imseti (ds, IM_CLOSEFD, YES) + chan[1] = fstati (imstati (ds, IM_PIXFD), F_CHANNEL) + chan[2] = MONO + + # Pick up the frame size. + iis_xdim = IM_LEN(ds,1) + iis_ydim = IM_LEN(ds,2) + iis_config = IM_LEN(ds,3) + + # Optimize for sequential i/o. + call imseti (ds, IM_ADVICE, SEQUENTIAL) + + # Display frame being loaded? + if (select_frame == YES) + call zfrmim (chan) + + return (ds) +end + +# IMD_MAPFRAME1 -- Open the given frame of the stdimage display device on an +# IMIO image descriptor. +# This differs from imd_mapframe only in the addition of the erase option. + +pointer procedure imd_mapframe1 (frame, mode, select_frame, erase) + +int frame #I frame to be opened [1:N] +int mode #I access mode +int select_frame #I make frame the display frame +int erase #I erase frame + +pointer ds +int chan[MAXCHAN] +char device[SZ_FNAME] + +pointer imdmap() +extern imdopen() +int imstati(), fstati(), envgets() +errchk imdmap, imseti +include "iis.com" + +begin + if (envgets ("stdimage", device, SZ_FNAME) == 0) + call error (1, "variable `stdimage' not defined in environment") + + # Pass frame number into IIS code. + call iis_setframe (frame) + + # Map the frame onto an image descriptor. + ds = imdmap (device, mode, imdopen) + # call imseti (ds, IM_CLOSEFD, YES) + chan[1] = fstati (imstati (ds, IM_PIXFD), F_CHANNEL) + chan[2] = MONO + + # Pick up the frame size. + iis_xdim = IM_LEN(ds,1) + iis_ydim = IM_LEN(ds,2) + iis_config = IM_LEN(ds,3) + + # Optimize for sequential i/o. + call imseti (ds, IM_ADVICE, SEQUENTIAL) + + # Display frame being loaded? + if (select_frame == YES) + call zfrmim (chan) + + # Erase frame being loaded? + if (erase == YES) + call zersim (chan) + + return (ds) +end -- cgit