/* FILE: /mxtools/src/psfstar/ip_image_s_copy_i2 * PURPOSE: Copy a mxip_image_s structure * AUTHOR: Kenneth J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001NOV07 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. * * USAGE EXAMPLE: * * struct mxip_image_s *old=NULL; * struct mxip_image_s *new=NULL; * int status; * * ! N.B. old must be open and *old!=NULL * * status = mxip_image_s_copy_i2 (old, &new); * */ #include "mx.h" int ip_image_s_copy_i2( struct mxip_image_s *in, struct mxip_image_s **out ) { char mxfunc[] = "ip_image_s_copy_i2"; int status; struct mxip_image_s *image=NULL; int j0; status = 0; /* * Open the new mxip_image_s structure */ status = mxip_image_s_open_f7( &image, in->nxi, in->nyi, in->llx0i, in->lly0i, in->mpxi, in->comment ); if (status) { status = 1; goto error; } /* * The image->vectord was initialized to zero. * Now copy the pixel data. */ for (j0=0; j0<(in->npxi); ++j0) { image->vectord[j0] = in->vectord[j0]; } ok: status = 0; goto bye; error: mxp_errmsg_append_f3 (mxfunc, status, ""); goto bye; bye: *out = &*image; return (status); } /* end-of-file */