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 /pkg/utilities/nttools/threed/tximage/txicpy.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/threed/tximage/txicpy.x')
-rw-r--r-- | pkg/utilities/nttools/threed/tximage/txicpy.x | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/threed/tximage/txicpy.x b/pkg/utilities/nttools/threed/tximage/txicpy.x new file mode 100644 index 00000000..1428ee9e --- /dev/null +++ b/pkg/utilities/nttools/threed/tximage/txicpy.x @@ -0,0 +1,61 @@ +include <tbset.h> + +# TXICPY -- Copy data from single row and column in 3D table to +# 1-D image. +# +# +# +# +# Revision history: +# ---------------- +# +# 26-Nov-96 - Task created (I.Busko) + +procedure txicpy (itp, im, irow, icp, datatype, size) + +pointer itp # i: pointer to descriptor of input table +pointer im # i: pointer to output image +int irow # i: row in input table +pointer icp # i: array of pointers for input columns +int datatype # i: data type +int size # i: array size +#-- +int nbuf +pointer sp, bufin, bufout, errmsg, colname + +string badtype "Unsupported column data type (%s)" + +pointer impl1s(), impl1i(), impl1r(), impl1d() +begin + call smark (sp) + call salloc (bufin, size, datatype) + + switch (datatype) { + case TY_SHORT: + call tcs_rdarys (itp, icp, irow, size, nbuf, Mems[bufin]) + bufout = impl1s (im) + call amovs (Mems[bufin], Mems[bufout], size) + case TY_INT,TY_LONG: + call tcs_rdaryi (itp, icp, irow, size, nbuf, Memi[bufin]) + bufout = impl1i (im) + call amovi (Memi[bufin], Memi[bufout], size) + case TY_REAL: + call tcs_rdaryr (itp, icp, irow, size, nbuf, Memr[bufin]) + bufout = impl1r (im) + call amovr (Memr[bufin], Memr[bufout], size) + case TY_DOUBLE: + call tcs_rdaryd (itp, icp, irow, size, nbuf, Memd[bufin]) + bufout = impl1d (im) + call amovd (Memd[bufin], Memd[bufout], size) + default: + # Unsupported type, write error message + call salloc (colname, SZ_COLNAME, TY_CHAR) + call salloc (errmsg, SZ_LINE, TY_CHAR) + call tcs_txtinfo (icp, TBL_COL_NAME, Memc[colname], SZ_COLNAME) + call sprintf (Memc[errmsg], SZ_LINE, badtype) + call pargstr (Memc[colname]) + call error (1, Memc[errmsg]) + } + + call sfree (sp) +end |