diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/images/tv/iis/iism70/iislut.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/images/tv/iis/iism70/iislut.x')
-rw-r--r-- | pkg/images/tv/iis/iism70/iislut.x | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/pkg/images/tv/iis/iism70/iislut.x b/pkg/images/tv/iis/iism70/iislut.x new file mode 100644 index 00000000..07819247 --- /dev/null +++ b/pkg/images/tv/iis/iism70/iislut.x @@ -0,0 +1,67 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <mach.h> +include "iis.h" +include "../lib/ids.h" + +define LUT_LMAX 255 + +# IISLUT -- Read and Write look up table. +# NOTE the ASYMMETRY ... written data is derived from end +# points, but read data is the full array (see zsnapinit, +# for instance, for read usage.) + +procedure iislut (rw, frame, color, offset, n, data) + +short rw # read or write +short frame[ARB] # frame array +short color[ARB] # color array +short offset # offset into lut +short n # number of data values +short data[ARB] # the data + +int command,len,x,y,z,t +short iispack() +int mapcolor() +pointer sp, ldata + +include "iis.com" + +begin + z = mapcolor (color) + t = iispack(frame) + if (t == GRCHAN) { + return + } + + if ( rw == IDS_WRITE) { + if ( n < 4) + return + command = IWRITE+VRETRACE + + # data space for manipulating lut information + + call smark (sp) + call salloc (ldata, LEN_LUT, TY_SHORT) + call aclrs (Mems[ldata], LEN_LUT) + + # We could have negative lut values, but don't bother for now + call idslfill (data, int(n), Mems[ldata], LEN_LUT, 0, LUT_LMAX) + + len = LEN_LUT + } else { + len = n + command = IREAD+VRETRACE + } + + x = ADVXONTC + y = 0 + + call iishdr (command, len, LUT, x, y, z, t) + + if ( rw == IDS_WRITE) { + call iisio (Mems[ldata], len * SZB_CHAR) + call sfree (sp) + } else + call iisio (data, len * SZB_CHAR) +end |