diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/imio/tf/imgl1i.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'sys/imio/tf/imgl1i.x')
-rw-r--r-- | sys/imio/tf/imgl1i.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/imio/tf/imgl1i.x b/sys/imio/tf/imgl1i.x new file mode 100644 index 00000000..0de66fa2 --- /dev/null +++ b/sys/imio/tf/imgl1i.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include <imhdr.h> +include <imio.h> + +# IMGL1? -- Get a line from an apparently one dimensional image. If there +# is only one input buffer, no image section, we are not referencing out of +# bounds, and no datatype conversion needs to be performed, directly access +# the pixels to reduce the overhead per line. + +pointer procedure imgl1i (im) + +pointer im +int fd, nchars +long offset +pointer bp, imggsi(), freadp() +errchk imopsf + +begin + repeat { + if (IM_FAST(im) == YES && IM_PIXTYPE(im) == TY_INT) { + fd = IM_PFD(im) + if (fd == NULL) { + call imopsf (im) + next + } + + offset = IM_PIXOFF(im) + nchars = IM_PHYSLEN(im,1) * SZ_INT + ifnoerr (bp = (freadp (fd, offset, nchars) - 1) / SZ_INT + 1) + return (bp) + } + return (imggsi (im, long(1), IM_LEN(im,1), 1)) + } +end |