mconv16to8.c

00001 /*
00002 *    Copyright (c) 2007. The BATI team. All right reserved.
00003 *
00004 *    This file is part of BATI library.
00005 *
00006 *    BATI library is free software: you can redistribute it and/or modify
00007 *    it under the terms of the GNU General Public License as published by
00008 *    the Free Software Foundation, either version 3 of the License, or
00009 *    (at your option) any later version.
00010 *
00011 *    BATI library  is distributed in the hope that it will be useful,
00012 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 *    GNU General Public License for more details.
00015 *
00016 *    You should have received a copy of the GNU General Public License
00017 *    along with BATI library.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00037 #include "image.h"    /* types des donnees manipulees dans ima2D */
00038 #include "proto2D.h"  /* descripteurs et prototypes des fonctions de ima2D */
00039 #include "radar.h" 
00040 #include <stdlib.h>
00041 #include <limits.h> /* pour  USHRT_MAX ... */
00042 
00043 int main(int argc, char *argv[]){
00044 
00045 /* DECLARATIONS */
00046 
00047   /* images */ 
00048   imau1 imres;
00049   imau2 im0;
00050 
00051   /* operateurs */
00052   read_ima_t rea;
00053   conv16to8_t conv;
00054   write_ima_t wri;   
00055 
00056   /* main : variables et parametres propres au main*/
00057   param par0, *ptp;      /* tete et pointeur pour la chaine de parametres */ 
00058   
00059 
00060   
00061 /* LECTURE PARAMETRES */
00062 
00063   /* debut: OBLIGATOIRE pour compatibilite avec les 3 modes de lecture de param */
00064   param_debut(argc, argv, &par0); 
00065   ptp = &par0;      /* regle : ptp pointe sur la structure du parametre suivant */
00066 
00067   /* operateurs: ptp est passe en argument, return fournit la nouvelle position */
00068   ptp = read_ima_lect(&rea, ptp, ">> image initiale 16 bits (.imw) :");
00069   ptp = conv16to8_lect(&conv, ptp, "");
00070   ptp = write_ima_lect(&wri, ptp, ">> image resultat 8 bits (.ima|.ras) :");
00071 
00072   /* param du main */
00073 
00074   /* fin: sauvegarde des parametres utilises en mode MANUEL ou FICHIER */
00075   param_fin(argc, argv, &par0);
00076 
00077 
00078 /* INITIALISATION  */
00079 
00080   /* operateur */
00081   read_imau2_init(&rea, &im0);
00082   conv16to8_init(&conv, im0, &imres); 
00083   write_ima_init(&wri);
00084 
00085    
00086 /* CALCUL */
00087   conv16to8_calc(&conv, im0, &imres); 
00088 
00089 
00090 /* FREMETURE */
00091   write_imau1_ferm(&wri, imres);
00092 }
00093 

Generated on Tue Apr 22 13:31:04 2008 for ima2D by  doxygen 1.5.3