/*************************************************************************************************************************************/ /* */ /* S O M M E A R I T H M E T I Q U E D E T R O I S I M A G E S A V E C P O N D E R A T I O N : */ /* */ /* */ /* Definition : */ /* */ /* Cette commande genere une image */ /* dont le nom est le premier argument */ /* d'appel ; elle est le resultat de la */ /* somme ponderee des trois images Arguments, */ /* avec ou sans renormalisation du resultat. */ /* */ /* */ /* Author of '$xci/somme_13$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1995??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R F A C E ' listG ' : */ /* */ /* */ /* :Debut_listG: */ /* :Fin_listG: */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* F I C H I E R S D ' I N C L U D E S : */ /* */ /*************************************************************************************************************************************/ #include INCLUDES_BASE #include image_image_IMAGESF_EXT #include image_image_QUAD_IMAGE_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define IL_FAUT_CONVERTIR_LES_IMAGES_STANDARDS \ FAUX \ /* Faut-il convertir les images 'Standard's en flottant ? */ #define IL_FAUT_RENORMALISER \ FAUX \ /* Faut-il renormaliser l'image ? */ #define UTILISER_LA_LOGIQUE_FLOUE \ FAUX \ /* Faut-il utiliser la logique floue ? */ #define ALPHA \ FRA3(FU) #define BETA_ \ FRA3(FU) #define GAMMA \ FRA3(FU) /* Coefficients de ponderation. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* S O M M E A R I T H M E T I Q U E D E T R O I S I M A G E S A V E C R E N O R M A L I S A T I O N : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA1),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA2),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA3),NOM_PIPE)); DEFV(Logical,INIT(il_faut_convertir_les_images_standards,IL_FAUT_CONVERTIR_LES_IMAGES_STANDARDS)); /* Faut-il convertir les images 'Standard's en flottant ? */ DEFV(Logical,INIT(utiliser_la_logique_floue,UTILISER_LA_LOGIQUE_FLOUE)); /* Faut-il utiliser la logique floue ? */ DEFV(Float,INIT(alpha,ALPHA)); DEFV(Float,INIT(beta_,BETA_)); DEFV(Float,INIT(gamma,GAMMA)); /* Coefficients de ponderation. */ /*..............................................................................................................................*/ EGAL(les_images_standards_sont_a_renormaliser,IL_FAUT_RENORMALISER); /* Faut-il renormaliser l'image ? */ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageA1=""A1=",nom_imageA1); GET_ARGUMENT_C("imageA2=""A2=",nom_imageA2); GET_ARGUMENT_C("imageA3=""A3=",nom_imageA3); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("convertir=",il_faut_convertir_les_images_standards); GET_ARGUMENT_L("flou=",utiliser_la_logique_floue); GET_ARGUMENT_F("alpha=""a=",alpha); GET_ARGUMENT_F("beta=""b=",beta_); GET_ARGUMENT_F("gamma=""c=",gamma); GET_ARGUMENT_L("rn=""renormaliser=""r=",les_images_standards_sont_a_renormaliser); ) ); CALi(Inoir(ImageR)); /* Initialisation de l'image Resultat. */ Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA1,nom_imageA1)))) Bblock /* Chargement de la premiere image Argument. */ Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA2,nom_imageA2)))) Bblock /* Chargement de la deuxieme image Argument. */ Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA3,nom_imageA3)))) Bblock /* Chargement de la troisieme image Argument. */ Test(IL_FAUT(utiliser_la_logique_floue)) Bblock CALS(IFaddition3_ponderee_floue(IFmageR,alpha,ImageA1,beta_,ImageA2,gamma,ImageA3)); /* Et somme ponderee "floue" des trois images arguments 'ImageA1', 'ImageA2' et 'ImageA3'. */ Eblock ATes Bblock CALS(IFaddition3_ponderee(IFmageR,alpha,ImageA1,beta_,ImageA2,gamma,ImageA3)); /* Et somme ponderee des trois images arguments 'ImageA1', 'ImageA2' et 'ImageA3'. */ Eblock ETes Test(EST_VRAI(il_faut_convertir_les_images_standards)) Bblock CALi(IupdateF_image(nom_imageR,IFmageR)); Eblock ATes Bblock Test(IL_FAUT(les_images_standards_sont_a_renormaliser)) Bblock CALS(Ifloat_std_avec_renormalisation(ImageR,IFmageR)); /* Conversion en une image standard avec renormalisation. */ Eblock ATes Bblock CALS(Ifloat_std(ImageR,IFmageR,FLOT__NOIR,FLOT__BLANC)); /* Conversion en une image standard sans renormalisation. */ Eblock ETes CALi(Iupdate_image(nom_imageR,ImageR)); Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande