From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/imio/tf/impl1d.x | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sys/imio/tf/impl1d.x (limited to 'sys/imio/tf/impl1d.x') diff --git a/sys/imio/tf/impl1d.x b/sys/imio/tf/impl1d.x new file mode 100644 index 00000000..227d25dd --- /dev/null +++ b/sys/imio/tf/impl1d.x @@ -0,0 +1,34 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include + +# IMPL1? -- Put a line to 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 impl1d (im) + +pointer im # image header pointer +int fd, nchars +long offset +pointer bp, impgsd(), fwritep() +errchk imopsf + +begin + repeat { + if (IM_FAST(im) == YES && IM_PIXTYPE(im) == TY_DOUBLE) { + fd = IM_PFD(im) + if (fd == NULL) { + call imopsf (im) + next + } + offset = IM_PIXOFF(im) + nchars = IM_PHYSLEN(im,1) * SZ_DOUBLE + ifnoerr (bp = (fwritep (fd, offset, nchars) - 1) / SZ_DOUBLE + 1) + return (bp) + } + return (impgsd (im, long(1), IM_LEN(im,1), 1)) + } +end -- cgit