From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/imio/tf/imflss.x | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sys/imio/tf/imflss.x (limited to 'sys/imio/tf/imflss.x') diff --git a/sys/imio/tf/imflss.x b/sys/imio/tf/imflss.x new file mode 100644 index 00000000..1034413b --- /dev/null +++ b/sys/imio/tf/imflss.x @@ -0,0 +1,34 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include +include + +# IMFLS? -- Flush the output buffer, if necessary. Convert the datatype +# of the pixels upon output, if the datatype of the pixels in the imagefile +# is different than that requested by the calling program. + +procedure imflss (imdes) + +pointer imdes +pointer bdes, bp +errchk imflsh + +begin + # Ignore the flush request if the output buffer has already been + # flushed. + + if (IM_FLUSH(imdes) == YES) { + bdes = IM_OBDES(imdes) + bp = BD_BUFPTR(bdes) + + # Convert datatype of pixels, if necessary, and flush buffer. + if (IM_PIXTYPE(imdes) != TY_SHORT || SZ_INT != SZ_INT32) { + call impaks (Memc[bp], Memc[bp], BD_NPIX(bdes), + IM_PIXTYPE(imdes)) + } + + call imflsh (imdes, bp, BD_VS(bdes,1), BD_VE(bdes,1), BD_NDIM(bdes)) + + IM_FLUSH(imdes) = NO + } +end -- cgit