/*************************************************************************************************************************************/ /* */ /* N O R M A L I S A T I O N D ' U N E S E Q U E N C E D ' I M A G E S F L O T T A N T E S : */ /* */ /* */ /* Author of '$xci/normalise.02$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1994??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 : */ /* */ /*************************************************************************************************************************************/ #include xci/sequence.01.I" #define NORMALISATION_INDEPENDANTE \ FAUX \ /* Faut-il faire independemment la normalisation des differentes pages constituant */ \ /* l'album ? La valeur par defaut garantit la compatibilite anterieure (ceci fut introduit */ \ /* le 20100831212927). */ #define EXTRAIRE_LES_EXTREMA \ VRAI \ /* Faut-il extraire les extrema ('VRAI') ou bien prendre les arguments d'appel ('FAUX') ? */ #define VALEUR_MINIMALE \ COORDONNEE_BARYCENTRIQUE_MINIMALE #define VALEUR_MAXIMALE \ COORDONNEE_BARYCENTRIQUE_MAXIMALE /* Extrema a priori... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* N O R M A L I S A T I O N D ' U N E S E Q U E N C E D ' I M A G E S F L O T T A N T E S : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_postfixe),NOM_UNDEF_VIDE)); /* Nom d'un eventuel postfixe a placer derriere <nom_imageA><numero> (par exemple '$ROUGE'). */ DEFV(Int,INIT(premiere_image,PREMIERE_IMAGE)); /* Numero de la premiere image, */ DEFV(Int,INIT(derniere_image,DERNIERE_IMAGE)); /* Numero de la derniere image. */ DEFV(Int,INIT(pas_des_images,PAS_DES_IMAGES)); /* Pas de passage d'un numero d'image a une autre. */ DEFV(Int,INIT(nombre_de_chiffres,NOMBRE_DE_CHIFFRES)); /* Nombre de chiffres codant le numero des images de la serie... */ DEFV(Int,INIT(numero_d_image,UNDEF)); /* Numero de l'image courante. */ DEFV(CHAR,INIT(POINTERc(nom_image),NOM_UNDEF)); /* Nom courant des images. */ DEFV(Logical,INIT(normalisation_independante,NORMALISATION_INDEPENDANTE)); /* Faut-il faire independemment la normalisation des differentes pages constituant */ /* l'album ? La valeur par defaut garantit la compatibilite anterieure (ceci fut introduit */ /* le 20100831212927). */ DEFV(Logical,INIT(extraire_les_extrema,EXTRAIRE_LES_EXTREMA)); /* Faut-il extraire les extrema ('VRAI') ou bien prendre les arguments d'appel ('FAUX') ? */ DEFV(genere_Float,INIT(nivo_minimum,VALEUR_MINIMALE)); DEFV(genere_Float,INIT(nivo_maximum,VALEUR_MAXIMALE)); /* Niveau de NOIR de l'image Resultat. */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_L("IFnormalisation_____compatibilite_20120705=""compatibilite_20120705=" ,IFnormalisation_____compatibilite_20120705 ); /* Parametre introduit le 20120705170030... */ GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("standard=",les_images_sont_standards); GET_ARGUMENT_C("postfixe=",nom_postfixe); GET_ARGUMENT_I("premiere=",premiere_image); GET_ARGUMENT_I("derniere=",derniere_image); GET_ARGUMENT_I("pas=",pas_des_images); GET_ARGUMENT_I("chiffres=",nombre_de_chiffres); GET_ARGUMENT_L("independante=""automatique=",normalisation_independante); /* Parametre introduit le 20100831212927... */ GET_ARGUMENT_L("extrema=",extraire_les_extrema); GET_ARGUMENT_F("minimum=""min=",nivo_minimum); GET_ARGUMENT_F("maximum=""max=",nivo_maximum); GET_ARGUMENT_F("origine=""o=",IFnormalisation_____niveau_origine___de_normalisation); GET_ARGUMENT_F("extremite=""e=",IFnormalisation_____niveau_extremite_de_normalisation); GET_ARGUMENT_L("zero=",IFnormalisation_____conserver_le_zero); GET_ARGUMENT_L("utiliser_moyenne_uniforme=""umu=" ,IFnormalisation_____utiliser_la_moyenne_en_cas_d_uniformite ); GET_ARGUMENT_F("valeur_moyenne_forcee=""vmf=",IFnormalisation_____niveau_a_forcer_en_cas_d_uniformite); /* Parametres introduits le 20130626083117... */ ) ); begin_nouveau_block Bblock #include xrq/synapse.11.I" DONNEES_DE_RECHERCHE_DES_EXTREMA_GLOBAUX_D_UNE_SEQUENCE_D_IMAGES; /* Extrema globaux de l'ensemble de la sequence... */ Test(IL_FAUT(extraire_les_extrema)) Bblock Test(IL_NE_FAUT_PAS(normalisation_independante)) /* Test introduit le 20100831212927... */ Bblock DoIn(numero_d_image,premiere_image,derniere_image,pas_des_images) Bblock DONNEES_DE_RECHERCHE_DES_EXTREMA_LOCAUX_D_UNE_SEQUENCE_D_IMAGES; /* Extrema locaux de la sequence... */ EGAL(nom_image ,COND(IFEQ_chaine(nom_postfixe,NOM_UNDEF_VIDE) ,chain_Aconcaten2_sauf_nom_pipe(nom_imageA ,chain_numero_modulo(numero_d_image,nombre_de_chiffres) ) ,chain_Aconcaten3_sauf_nom_pipe(nom_imageA ,chain_numero_modulo(numero_d_image,nombre_de_chiffres) ,nom_postfixe ) ) ); /* Le 20221212115254, 'chain_numero_modulo(...)' a remplace 'chain_numero(...)'... */ Test(PAS_D_ERREUR(CODE_ERROR(IloadF_image(IFmageA,nom_image)))) Bblock RECHERCHE_DES_EXTREMA_D_UNE_SEQUENCE_D_IMAGES(IFmageA); /* Recherche des extrema locaux et globaux de l'ensemble de la sequence... */ Eblock ATes Bblock Eblock ETes Eblock EDoI Eblock ATes Bblock PRINT_ATTENTION("en mode 'normalisation independante' la recherche des extrema n'a pas de sens"); Eblock ETes Eblock ATes Bblock EGAL(niveau_minimum_de_la_sequence,nivo_minimum); EGAL(niveau_maximum_de_la_sequence,nivo_maximum); /* Dans ce cas, ce sont les extrema arguments qui vont etre utilises... */ Eblock ETes DoIn(numero_d_image,premiere_image,derniere_image,pas_des_images) Bblock EGAL(nom_image ,COND(IFEQ_chaine(nom_postfixe,NOM_UNDEF_VIDE) ,chain_Aconcaten2_sauf_nom_pipe(nom_imageA ,chain_numero_modulo(numero_d_image,nombre_de_chiffres) ) ,chain_Aconcaten3_sauf_nom_pipe(nom_imageA ,chain_numero_modulo(numero_d_image,nombre_de_chiffres) ,nom_postfixe ) ) ); /* Le 20221212115254, 'chain_numero_modulo(...)' a remplace 'chain_numero(...)'... */ Test(PAS_D_ERREUR(CODE_ERROR(IloadF_image(IFmageA,nom_image)))) Bblock EGAL(nom_image ,COND(IFEQ_chaine(nom_postfixe,NOM_UNDEF_VIDE) ,chain_Aconcaten2_sauf_nom_pipe(nom_imageR ,chain_numero(numero_d_image,nombre_de_chiffres) ) ,chain_Aconcaten3_sauf_nom_pipe(nom_imageR ,chain_numero(numero_d_image,nombre_de_chiffres) ,nom_postfixe ) ) ); Test(EST_VRAI(les_images_sont_standards)) Bblock /* Cas d'une image 'image' : */ CALi(Inoir(ImageR)); /* Initialisation de l'image Resultat. */ CALS(Ifloat_std(ImageR,IFmageA,niveau_minimum_de_la_sequence,niveau_maximum_de_la_sequence)); /* Renormalisation avec forcage des extrema... */ CALi(Iupdate_image(nom_image,ImageR)); Eblock ATes Bblock /* Cas d'une image 'imageF' : */ CALi(IFinitialisation(IFmageR,FZERO)); /* Initialisation de l'image Resultat. */ Test(IL_NE_FAUT_PAS(normalisation_independante)) /* Test introduit le 20100831212927... */ Bblock CALS(IFnormalisation(IFmageR,IFmageA,niveau_minimum_de_la_sequence,niveau_maximum_de_la_sequence)); /* Et renormalisation... */ Eblock ATes Bblock CALS(IFnormalisation_automatique(IFmageR,IFmageA)); /* Et renormalisation... */ Eblock ETes CALi(IupdateF_image(nom_image,IFmageR)); Eblock ETes Eblock ATes Bblock gTest__CODE_ERREUR__ERREUR07 (BLOC(Bblock PRINT_ATTENTION("la fin de flot a ete rencontree lors du chargement d'une 'image'"); Eblock ) ,BLOC(Bblock Test(IL_FAUT(files_____editer_les_messages_d_erreur_de_lecture_des_fichiers)) Bblock PRINT_ERREUR("le fichier demande n'existe pas ou n'est pas de type 'image'"); Eblock ATes Bblock Eblock ETes Eblock ) ); Eblock ETes Eblock EDoI Eblock end_nouveau_block RETU_Commande; Eblock ECommande