From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/imred/ccdred/src/ccdcopy.x | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 noao/imred/ccdred/src/ccdcopy.x (limited to 'noao/imred/ccdred/src/ccdcopy.x') diff --git a/noao/imred/ccdred/src/ccdcopy.x b/noao/imred/ccdred/src/ccdcopy.x new file mode 100644 index 00000000..a12b2123 --- /dev/null +++ b/noao/imred/ccdred/src/ccdcopy.x @@ -0,0 +1,31 @@ +include + +# CCDCOPY -- Copy an image. This should be done with an IMIO procedure +# but there isn't one yet. + +procedure ccdcopy (old, new) + +char old[ARB] # Image to be copied +char new[ARB] # New copy + +int i, nc, nl +pointer in, out, immap(), imgl2s(), impl2s(), imgl2r(), impl2r() + +begin + in = immap (old, READ_ONLY, 0) + out = immap (new, NEW_COPY, in) + + nc = IM_LEN(in,1) + nl = IM_LEN(in,2) + switch (IM_PIXTYPE(in)) { + case TY_SHORT: + do i = 1, nl + call amovs (Mems[imgl2s(in,i)], Mems[impl2s(out,i)], nc) + default: + do i = 1, nl + call amovr (Memr[imgl2r(in,i)], Memr[impl2r(out,i)], nc) + } + + call imunmap (in) + call imunmap (out) +end -- cgit