aboutsummaryrefslogtreecommitdiff
path: root/pkg/utilities/nttools/stxtools/grmimy.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/utilities/nttools/stxtools/grmimy.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/utilities/nttools/stxtools/grmimy.x')
-rw-r--r--pkg/utilities/nttools/stxtools/grmimy.x68
1 files changed, 68 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/stxtools/grmimy.x b/pkg/utilities/nttools/stxtools/grmimy.x
new file mode 100644
index 00000000..bd30f93e
--- /dev/null
+++ b/pkg/utilities/nttools/stxtools/grmimy.x
@@ -0,0 +1,68 @@
+include <imhdr.h>
+
+#---------------------------------------------------------------------------
+.help grm_imcopy Oct92 source
+.ih
+NAME
+grm_imcopy -- Copy images given their image descriptors.
+.endhelp
+#---------------------------------------------------------------------------
+procedure grm_imcopy (in, out)
+
+pointer in # I: Input image descriptor of image to copy.
+pointer out # I: Output image descriptor of resultant image.
+
+# Declarations.
+long v1[IM_MAXDIM], v2[IM_MAXDIM] # Line and section counters.
+
+int junk # Generic.
+int npix # Length of a line of data.
+
+pointer buf1, buf2 # Data buffers.
+
+# Function Prototypes.
+int imgnls(), imgnll(), imgnlr(), imgnld(), imgnlx()
+int impnls(), impnll(), impnlr(), impnld(), impnlx()
+
+begin
+
+ # Setup start vector for sequential reads and writes.
+ call amovkl (long(1), v1, IM_MAXDIM)
+ call amovkl (long(1), v2, IM_MAXDIM)
+
+ # Copy the image.
+ npix = IM_LEN(in, 1)
+ switch (IM_PIXTYPE(in)) {
+ case TY_SHORT:
+ while (imgnls (in, buf1, v1) != EOF) {
+ junk = impnls (out, buf2, v2)
+ call amovs (Mems[buf1], Mems[buf2], npix)
+ }
+ case TY_USHORT, TY_INT, TY_LONG:
+ while (imgnll (in, buf1, v1) != EOF) {
+ junk = impnll (out, buf2, v2)
+ call amovl (Meml[buf1], Meml[buf2], npix)
+ }
+ case TY_REAL:
+ while (imgnlr (in, buf1, v1) != EOF) {
+ junk = impnlr (out, buf2, v2)
+ call amovr (Memr[buf1], Memr[buf2], npix)
+ }
+ case TY_DOUBLE:
+ while (imgnld (in, buf1, v1) != EOF) {
+ junk = impnld (out, buf2, v2)
+ call amovd (Memd[buf1], Memd[buf2], npix)
+ }
+ case TY_COMPLEX:
+ while (imgnlx (in, buf1, v1) != EOF) {
+ junk = impnlx (out, buf2, v2)
+ call amovx (Memx[buf1], Memx[buf2], npix)
+ }
+ default:
+ call error (1, "unknown pixel datatype")
+ }
+
+end
+#---------------------------------------------------------------------------
+# End of grm_imcopy
+#---------------------------------------------------------------------------