/*************************************************************************************************************************************/ /* */ /* T R A N S F O R M A T I O N I T E R A T I V E D ' U N E I M A G E */ /* P A R L A D Y N A M I Q U E D E V E R H U L S T L O C A L I S E E E T G E N E R A L I S E E : */ /* */ /* */ /* Author of '$xci/Verhulst.02$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 20040922101419). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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_GOOF_IMAGE_EXT /* Introduit le 20051128161139... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #include xci/sequence.01.I" /* ATTENTION, on definit ainsi le symbole 'DERNIERE_IMAGE' qui ne sert a rien ici, puisque */ /* c'est en effet 'Zmax' qui joue ce role... */ #define NOMBRE_D_ITERATIONS \ SEIZE \ /* Nombre d'iterations 'N'. */ #define PONDERATION_X \ FZERO #define PONDERATION_Y \ FZERO #define PONDERATION_N \ FU #define TRANSLATION__ \ FZERO /* Ponderations de {X,Y} et du niveau, et translation pour le mode "localise"... */ #define MINIMUM_FORCE_POUR_LES_NIVEAUX \ FZERO #define MAXIMUM_FORCE_POUR_LES_NIVEAUX \ FU /* Extrema forces pour les niveaux. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #include xci/Verhulst.01.I" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* T R A N S F O R M A T I O N I T E R A T I V E D ' U N E I M A G E */ /* P A R L A D Y N A M I Q U E D E V E R H U L S T L O C A L I S E E E T G E N E R A L I S E E : */ /* */ /*************************************************************************************************************************************/ 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_imagePX),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imagePY),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imagePN),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageTR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageP),NOM_PIPE)); /* Nom de l'album definissant le polynome... */ DEFV(CHAR,INIC(POINTERc(nom_postfixe),NOM_UNDEF_VIDE)); /* Nom d'un eventuel postfixe a placer derriere <nom_imageP><numero> (par exemple '$ROUGE'). */ DEFV(Int,INIT(premiere_image_de_l_album,PREMIERE_IMAGE)); /* Numero de la premiere image, */ DEFV(Int,INIT(pas_des_images_de_l_album,PAS_DES_IMAGES)); /* Pas de passage d'un numero d'image a une autre. */ DEFV(Int,INIT(nombre_de_chiffres_de_l_album,NOMBRE_DE_CHIFFRES)); /* Nombre de chiffres codant le numero des images de la serie... */ DEFV(Positive,INIT(nombre_d_iterations,NOMBRE_D_ITERATIONS)); /* Nombre d'iterations 'N'. */ DEFV(Float,INIT(ponderation_X,PONDERATION_X)); DEFV(Float,INIT(ponderation_Y,PONDERATION_Y)); DEFV(Float,INIT(ponderation_N,PONDERATION_N)); DEFV(Float,INIT(translation__,TRANSLATION__)); /* Ponderations de {X,Y} et du niveau, et translation pour le mode "localise"... */ DEFV(Float,INIT(minimum_force_pour_les_niveaux,MINIMUM_FORCE_POUR_LES_NIVEAUX)); DEFV(Float,INIT(maximum_force_pour_les_niveaux,MAXIMUM_FORCE_POUR_LES_NIVEAUX)); /* Extrema forces pour les niveaux. */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("imagePX=""PX=",nom_imagePX); GET_ARGUMENT_C("imagePY=""PY=",nom_imagePY); GET_ARGUMENT_C("imagePN=""PN=",nom_imagePN); GET_ARGUMENT_C("imageTR=""TR=",nom_imageTR); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("standard=",les_images_sont_standards); GET_ARGUMENT_C("imageP=""P=",nom_imageP); GET_ARGUMENT_C("postfixeP=",nom_postfixe); GET_ARGUMENT_I("premiereP=",premiere_image_de_l_album); GET_ARGUMENT_I("pasP=",pas_des_images_de_l_album); GET_ARGUMENT_I("chiffresP=",nombre_de_chiffres_de_l_album); GET_ARGUMENT_I("nombre=""iterations=",nombre_d_iterations); GET_ARGUMENT_F("ponderationX=",ponderation_X); GET_ARGUMENT_F("ponderationY=",ponderation_Y); GET_ARGUMENT_F("ponderationN=",ponderation_N); GET_ARGUMENT_F("translation=",translation__); GET_ARGUMENT_F("minimum=",minimum_force_pour_les_niveaux); GET_ARGUMENT_F("maximum=",maximum_force_pour_les_niveaux); ) ); CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR)); /* Initialisation de l'image Resultat. */ begin_nouveau_block Bblock BDEFV(albumF,definition_du_polynome); /* Definition de l'album Argument definissant le polynome... */ CALi(dAloadF_album(definition_du_polynome ,nom_imageP ,nom_postfixe ,premiere_image_de_l_album ,pas_des_images_de_l_album ,nombre_de_chiffres_de_l_album ,FAUX ,UNDEF ,FAUX ) ); /* Chargement de l'album Argument... */ /* */ /* L'argument 'Inv' (='FAUX') a ete introduit le 20091125134028... */ Test(PAS_D_ERREUR(CODE_ERREUR)) Bblock Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA,IFmageA,nom_imageA)))) Bblock Test(EST_VRAI(les_images_sont_standards)) Bblock CALS(Istd_float(IFmageA,minimum_force_pour_les_niveaux,maximum_force_pour_les_niveaux,ImageA)); /* Conversion flottante si necessaire. */ Eblock ATes Bblock Eblock ETes begin_nouveau_block Bblock BDEFV(imageF,image_ponderation_X); BDEFV(imageF,image_ponderation_Y); BDEFV(imageF,image_ponderation_N); BDEFV(imageF,image_translation__); /* Images ponderations de {X,Y} et du niveau, et translation... */ LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_X ,nom_imagePX ,ponderation_X ,"ponderation de 'X'" ); LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_Y ,nom_imagePY ,ponderation_Y ,"ponderation de 'Y'" ); LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_ponderation_N ,nom_imagePN ,ponderation_N ,"ponderation du niveau" ); LOAD_D_UNE_IMAGE_FLOTTANTE_DE_PARAMETRAGE(image_translation__ ,nom_imageTR ,translation__ ,"translation" ); /* Chargement des images ponderations de {X,Y} et du niveau, et translation... */ CALS(IFdynamique_de_Verhulst_localisee_generalisee(IFmageR ,definition_du_polynome ,nombre_d_iterations ,IFmageA ,image_ponderation_X ,image_ponderation_Y ,image_ponderation_N ,image_translation__ ) ); /* Iteration par la dynamique de Verhulst "localisee" et generalisee. Dans ce mode {X,Y} */ /* sont conserves (d'ou le "local") et seul le niveau est modifie ; ce qui est en fait */ /* itere est une sorte de niveau generalise 'NG' obtenu par une combinaison de {X,Y} et */ /* du niveau 'N' : */ /* */ /* NG = PX.X + PY.Y + PN.N + translation */ /* */ /* et iteration de 'NG' : */ /* */ /* NG = Verhulst(NG ) */ /* n n-1 */ /* */ /* les quatre parametres {PX,PY,PN,translation} etant introduits si besoin est sous forme */ /* d'images de type 'imageF'. Enfin, cette dynamique est generalisee car, en effet, la */ /* definition de 'Verhulst(...)' est faite a l'aide d'un polynome de degre quelconque... */ EDEFV(imageF,image_translation__); EDEFV(imageF,image_ponderation_N); EDEFV(imageF,image_ponderation_Y); EDEFV(imageF,image_ponderation_X); /* Images ponderations de {X,Y} et du niveau, et translation... */ Eblock end_nouveau_block Test(EST_VRAI(les_images_sont_standards)) Bblock CALS(Ifloat_std_avec_renormalisation(ImageR,IFmageR)); /* Conversion "standard" si necessaire. */ Eblock ATes Bblock Eblock ETes CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR)); /* Et enfin, sortie... */ Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Eblock ETes EDEFV(albumF,definition_du_polynome); /* Definition de l'album Argument definissant le polynome... */ Eblock end_nouveau_block RETU_Commande; Eblock ECommande