/*************************************************************************************************************************************/ /* */ /* D I V I S I O N A R I T H M E T I Q U E D E D E U X 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 : */ /* */ /* */ /* Definition : */ /* */ /* Cette commande genere une image */ /* dont le nom est le premier argument */ /* d'appel ; elle est le resultat du */ /* quotient des deux images Arguments, */ /* avec renormalisation eventuelle du resultat. */ /* */ /* */ /* Author of '$xci/division.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 20190927180307). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define LES_IMAGES_STANDARDS_SONT_A_RENORMALISER \ VRAI \ /* Indique s'il faut ('VRAI') ou pas ('FAUX') renormaliser les images standard... */ #define AVERTIR_EN_CAS_DE_DIVISION_PAR_ZERO \ FAUX \ /* Indique s'il faut ('VRAI') ou pas ('FAUX') avretir lors d'une divison par zero... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I V I S I O N A R I T H M E T I Q U E D E D E U X 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(Logical,INIT(les_images_standards_sont_a_renormaliser,LES_IMAGES_STANDARDS_SONT_A_RENORMALISER)); /* Indique s'il faut ('VRAI') ou pas ('FAUX') renormaliser les images standard... */ DEFV(Logical,INIT(avertir_en_cas_de_division_par_zero,AVERTIR_EN_CAS_DE_DIVISION_PAR_ZERO)); /* Indique s'il faut ('VRAI') ou pas ('FAUX') avretir lors d'une divison par zero... */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageA1=""A1=",nom_imageA1); GET_ARGUMENT_C("imageA2=""A2=",nom_imageA2); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("standard=",les_images_sont_standards); GET_ARGUMENT_L("rn=""renormaliser=""r=",les_images_standards_sont_a_renormaliser); GET_ARGUMENT_L("message_division_par_0=""md0=",avertir_en_cas_de_division_par_zero); ) ); CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR)); /* Initialisation de l'image Resultat. */ Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA1,IFmageA1,nom_imageA1)))) Bblock /* Chargement de la premiere image Argument. */ Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA2,IFmageA2,nom_imageA2)))) Bblock /* Chargement de la deuxieme image Argument. */ CALS(gIdivision(les_images_sont_standards ,les_images_standards_sont_a_renormaliser ,ImageR,IFmageR ,ImageA1,IFmageA1 ,ImageA2,IFmageA2 ,avertir_en_cas_de_division_par_zero ) ); /* Et quotient des deux images arguments 'ImageA1' et 'ImageA2'. */ CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR)); Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande