Main Page   Data Structures   File List   Data Fields   Globals  

imgcopy.c

Go to the documentation of this file.
00001 #include "sadie.h"
00002 #include "proto.h"
00003 
00004 /*----------------------------------------------------------------------------*/
00005 /*-General Information--------------------------------------------------------*/
00006 /*                                                                            */
00007 /*   This function copies an image.                                           */
00008 /*                                                                            */
00009 /*----------------------------------------------------------------------------*/
00010 /*-Interface Information------------------------------------------------------*/
00011 void IMGCOPY (
00012 IMAGE  *in,      /*  I   Pointer to the input image.                           */
00013 IMAGE  **out     /*  O   Address of a pointer to the output image             */
00014 /*----------------------------------------------------------------------------*/
00015 ) { register short i, j, k;
00016     char msg[SLEN];
00017 
00018     /* if (TIMES) TIMING(T_IMGCOPY); */
00019     if (NAMES) {
00020         MESSAGE('I',"");
00021         MESSAGE('I',"IMGCOPY");
00022         MESSAGE('I',"");
00023         sprintf(msg," Input image:                       %s",in->text);
00024         MESSAGE('I',msg);
00025         MESSAGE('I'," ...............");
00026     }
00027 
00028     /* check input */
00029     if (!CHECKIMG(in)) {
00030         MESSAGE('E'," Can't identify image.");
00031         goto the_end;
00032     }
00033 
00034 
00035     /* create output image of appropriate size */
00036     if (!CHECKIMG(*out)) GETMEM(in->nbnd,in->nlin,in->npix,out);
00037     if (!*out) goto the_end;
00038 
00039     /* build copy image */
00040     for (i=0; i<in->nbnd; i++) {
00041         for (j=0; j<in->nlin; j++) {
00042             for (k=0; k<in->npix; k++) {
00043                 (*out)->data[i][j][k] = in->data[i][j][k];
00044             }
00045         }
00046     }
00047 
00048         
00049     the_end:
00050     /* if (TIMES) TIMING(T_EXIT); */
00051 }

Generated on Wed Apr 9 08:56:07 2003 for TREES by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002