/*************************************************************************************************************************************/ /* */ /* F O N C T I O N S D E B A S E A T R O I S I M A G E S : */ /* */ /* */ /* Definition : */ /* */ /* Ce fichier contient toutes les fonctions */ /* de base de gestion et de manipulation de */ /* trois images raster, quelle que soit la definition. */ /* Ainsi, on pourra avec elles combiner deux */ /* images entre elles,... */ /* */ /* */ /* Author of '$xiii/tri_image$DEF' : */ /* */ /* Jean-Francois Colonna (LACTAMME, 19890000000000). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* A D D I T I O N D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIaddition(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,COND(EST_VRAI(les_images_standards_sont_a_renormaliser) \ ,Iaddition_avec_renormalisation(imaR,imaA1,imaA2) \ ,Iaddition(imaR,imaA1,imaA2) \ ) \ ,IFaddition(FimaR,FimaA1,FimaA2) \ ) \ /* Addition de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I F F E R E N C E D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIsoustraction(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,COND(EST_VRAI(les_images_standards_sont_a_renormaliser) \ ,Isoustraction_avec_renormalisation(imaR,imaA1,imaA2) \ ,Isoustraction(imaR,imaA1,imaA2) \ ) \ ,IFsoustraction(FimaR,FimaA1,FimaA2) \ ) \ /* Soustraction de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* I N T E R P O L A T I O N D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIinterpolation(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,a,imaA1,FimaA1,b,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,COND(EST_VRAI(les_images_standards_sont_a_renormaliser) \ ,Iinterpolation_avec_renormalisation(imaR,a,imaA1,b,imaA2) \ ,Iinterpolation(imaR,a,imaA1,b,imaA2) \ ) \ ,IFinterpolation(FimaR,a,FimaA1,b,FimaA2) \ ) \ /* Interpolation entre deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M U L T I P L I C A T I O N D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gImultiplication(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,COND(EST_VRAI(les_images_standards_sont_a_renormaliser) \ ,Imultiplication_avec_renormalisation(imaR,imaA1,imaA2) \ ,Imultiplication(imaR,imaA1,imaA2) \ ) \ ,IFmultiplication(FimaR,FimaA1,FimaA2) \ ) \ /* Multiplication de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* C O M B I N A I S O N U N I V E R S E L L E D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIcombinaison_universelle(les_images_sont_standards,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Icombinaison_universelle(imaR,imaA1,imaA2) \ ,IFcombinaison_universelle(FimaR,FimaA1,FimaA2) \ ) \ /* Combinaison universelle de deux images quelconques ("standards" ou "flottantes"). Cette */ \ /* procedure a ete introduite le 20181009154311... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P R O D U I T M A T R I C I E L D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIproduit_matriciel(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Iproduit_matriciel(imaR,imaA1,imaA2,les_images_standards_sont_a_renormaliser) \ ,IFproduit_matriciel(FimaR,FimaA1,FimaA2) \ ) \ /* Produit matriciel de deux images quelconques ("standards" ou "flottantes") introduit */ \ /* le 20110920155105... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* D I V I S I O N D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIdivision(les_images_sont_standards,les_images_standards_sont_a_renormaliser,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2,avertir) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,COND(EST_VRAI(les_images_standards_sont_a_renormaliser) \ ,Idivision_avec_renormalisation(imaR,imaA1,imaA2,avertir) \ ,Idivision(imaR,imaA1,imaA2,avertir) \ ) \ ,IFdivision(FimaR,FimaA1,FimaA2,avertir) \ ) \ /* Division de deux images quelconques ("standards" ou "flottantes") introduite */ /* le 20190927174855... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A X I M U M D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gImaximum(les_images_sont_standards,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Imaximum(imaR,imaA1,imaA2) \ ,IFmaximum(FimaR,FimaA1,FimaA2) \ ) \ /* Maximum de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M I N I M U M D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIminimum(les_images_sont_standards,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Iminimum(imaR,imaA1,imaA2) \ ,IFminimum(FimaR,FimaA1,FimaA2) \ ) \ /* Minimum de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* " O U " E X C L U S I F F L O U D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIminmax(les_images_sont_standards,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Iminmax(imaR,imaA1,imaA2) \ ,IFminmax(FimaR,FimaA1,FimaA2) \ ) \ /* "OU" exclusif flou de deux images quelconques ("standards" ou "flottantes"). */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P R O D U I T G E N E R A L I S E D E D E U X I M A G E S Q U E L C O N Q U E S : */ /* */ /*************************************************************************************************************************************/ #define gIproduit_generalise(les_images_sont_standards,imaR,FimaR,imaA1,FimaA1,imaA2,FimaA2,imaTM,FimaTM) \ gCALC(EST_VRAI(les_images_sont_standards) \ ,Iproduit_generalise(imaR,imaA1,imaA2,imaTM) \ ,IFproduit_generalise(FimaR,FimaA1,FimaA2,FimaTM) \ ) \ /* Produit generalise de deux images quelconques ("standards" ou "flottantes"). Ceci a */ \ /* ete introduit le 20040127142136... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* C U M U L D E D E U X I M A G E S P O U R L E C A L C U L I T E R A T I F D E T R A I N E E S : */ /* */ /*************************************************************************************************************************************/ #ifdef SYSTEME_DPX5000_SPIX_CC # ifdef LACT11 # TestADef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 \ /* Sur 'SYSTEME_DPX5000_SPIX_CC', le compilateur 'cc' a besoin d'une zone de swap enorme */ \ /* pour compiler le calcul des trainees ; etant superieure a celle qui est disponible on */ \ /* ne peut plus compiler. Ceci est vrai pour la machine 'LACT11'... */ # Aifdef LACT11 # Eifdef LACT11 #Aifdef SYSTEME_DPX5000_SPIX_CC #Eifdef SYSTEME_DPX5000_SPIX_CC #ifdef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 /* Sur 'SYSTEME_DPX5000_SPIX_CC', le calcul des trainees n'est pas compile afin d'eviter un */ /* "debordement" de la zone de swap lors de la compilation... */ #Aifdef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 DenumeT07(CALCUL_STANDARD_DES_TRAINEES ,CALCUL_SIMPLIFIE_DES_TRAINEES ,CALCUL_PAR__TRANSPARENCE__01_DES_TRAINEES ,CALCUL_PAR__TRANSPARENCE__02_DES_TRAINEES ,CALCUL_PAR__TRANSPARENCE__03_DES_TRAINEES ,CALCUL_PAR__TRANSPARENCE__04_DES_TRAINEES ,CALCUL_PAR__TRANSPARENCE__05_DES_TRAINEES ,types_de_calcul_de_trainees ) /* Les deux modes principaux sont donc : */ /* */ /* 0 : CALCUL_STANDARD_DES_TRAINEES 'ADD2(...)', */ /* 1 : CALCUL_SIMPLIFIE_DES_TRAINEES 'MAX2(...)', */ /* */ #Eifdef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 #define RENORMALISER_LES_TRAINEES_CALCULEES_ITERATIVEMENT \ VRAI \ /* Afin de renormaliser les trainees automatiquement, */ #define NE_PAS_RENORMALISER_LES_TRAINEES_CALCULEES_ITERATIVEMENT \ NOTL(RENORMALISER_LES_TRAINEES_CALCULEES_ITERATIVEMENT) \ /* Afin de ne pas les renormaliser... */ #define PONDERATION_MAXIMALE_DES_TRAINEES \ FU \ /* A priori, la ponderation maximale est de 1.0... */ #ifndef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 # define ATTENUATION_DE_TRAINEES(ponderation,niveau) \ GENP(NIVA(MUL2(ponderation,FLOT(NIVR(niveau))))) \ /* Fonction d'attenuation d'un niveau. */ #Aifndef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 # define ATTENUATION_DE_TRAINEES(ponderation,niveau) \ NEUT(niveau) \ /* Fonction d'attenuation d'un niveau. */ #Eifndef BUG_SYSTEME_DPX5000_SPIX_CC_LACT11_ZONE_DE_SWAP_2 /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* A S S O C I A T I O N D E V O I S I N A G E D E D E U X I M A G E S : */ /* */ /*************************************************************************************************************************************/ #define Iassociation_de_voisinage_____X_association__ET__Y_association__SONT_INITIALISEES \ Bblock \ EGAL(Iassociation_de_voisinage_____X_association__et__Y_association__sont_initialisees,VRAI); \ Eblock \ /* Ainsi, on sait que {Iassociation_de_voisinage_____X,Iassociation_de_voisinage_____Y} */ \ /* sont initialisees... */