/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P R O D U I T   D E   D E U X   I M A G E S   C O M P L E X E S  :                                                         */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xci/fft.02$K' :                                                                                                */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 1989??????????).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        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

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P A R A M E T R E S  :                                                                                                     */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
#define   X_TRANSLATION                                                                                                                 \
                    NEGA(MOIT(dimX))                                                                                                    \
                                        /* Translation horizontale du noyau de convolution,                                          */
#define   Y_TRANSLATION                                                                                                                 \
                    NEGA(MOIT(dimY))                                                                                                    \
                                        /* Translation verticale du noyau de convolution.                                            */

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        M A C R O S   U T I L E S  :                                                                                               */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        P R O D U I T   D E   D E U X   I M A G E S   C O M P L E X E S  :                                                         */
/*                                                                                                                                   */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
     Bblock
     DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE));
                                        /* Nom de l'image Resultat filtree.                                                          */
     DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE));
                                        /* Nom de l'image Argument a filtrer.                                                        */
     DEFV(CHAR,INIC(POINTERc(nom_du_noyau),NOM_PIPE));
                                        /* Nom du noyau de filtrage.                                                                 */
     DEFV(Float,INIT(translation_OX,FLOT__UNDEF));
     DEFV(Float,INIT(translation_OY,FLOT__UNDEF));
                                        /* Argument de translation du noyau initialise a priori a l'origine...                       */
     DEFV(deltaF_2D,translation);
                                        /* Translation du champ.                                                                     */
     DEFV(complexe,valeur_initiale);
                                        /* Valeur initiale de la transformee de Fourier.                                             */
     /*..............................................................................................................................*/
     Cinitialisation(valeur_initiale,R0_Complexe,I0_Complexe);
     GET_ARGUMENTSi(nombre_d_arguments
                   ,BLOC(GET_ARGUMENT_C("imageA=""imageA1=""A=""A1=",nom_imageA);
                         GET_ARGUMENT_C("imageN=""imageA2=""N=""A2=",nom_du_noyau);
                         GET_ARGUMENT_C("imageR=""R=",nom_imageR);
                         GIT_ARGUMENT_F("trx=""trX=",translation_OX,_____lNORMALISE_OX(X_TRANSLATION));
                         GIT_ARGUMENT_F("try=""trY=",translation_OY,_____lNORMALISE_OY(Y_TRANSLATION));
                         )
                    );

     INITIALISATION_ACCROISSEMENT_2D(translation,translation_OX,translation_OY);

     begin_nouveau_block
          Bblock
          BDEFV(imageJ,noyau_de_filtrage);
                                        /* Image complexe contenant le noyau de filtrage.                                            */
          BDEFV(imageJ,transformee_de_fourier_avant_filtrage);
                                        /* Image complexe contenant la transformee de Fourier complexe de l'image                    */
                                        /* Argument (avant filtrage).                                                                */
          BDEFV(imageJ,transformee_de_fourier_apres_filtrage);
                                        /* Image complexe contenant la transformee de Fourier complexe de l'image                    */
                                        /* Resultat (apres filtrage).                                                                */
          PUSH_ECHANTILLONNAGE;
          SET_ECHANTILLONNAGE(PasX,PasY);
          CALS(IJinitialisation(transformee_de_fourier_apres_filtrage,ADRESSE(valeur_initiale)));
                                        /* Initialisation de l'image Resultat...                                                     */
          PULL_ECHANTILLONNAGE;

          Test(PAS_D_ERREUR(CODE_ERROR(IloadJ_image(transformee_de_fourier_avant_filtrage,nom_imageA))))
               Bblock
                                        /* Recuperation de l'image complexe a filtrer,                                               */
               Test(PAS_D_ERREUR(CODE_ERROR(IloadJ_image(noyau_de_filtrage,nom_du_noyau))))
                    Bblock
                                        /* Recuperation du noyau de filtrage,                                                        */
                    CALS(IJproduit_complexe(transformee_de_fourier_apres_filtrage
                                           ,transformee_de_fourier_avant_filtrage
                                           ,noyau_de_filtrage,ADRESSE(translation)
                                            )
                         );
                                        /* Puis produit complexe...                                                                  */
                    CALi(IupdateJ_image(nom_imageR,transformee_de_fourier_apres_filtrage));
                    Eblock
               ATes
                    Bblock
                    Test__CODE_ERREUR__ERREUR07;
                    Eblock
               ETes
               Eblock
          ATes
               Bblock
               Test__CODE_ERREUR__ERREUR07;
               Eblock
          ETes

          EDEFV(imageJ,transformee_de_fourier_apres_filtrage);
                                        /* Image complexe contenant la transformee de Fourier complexe de l'image                    */
                                        /* Resultat (apres filtrage).                                                                */
          EDEFV(imageJ,transformee_de_fourier_avant_filtrage);
                                        /* Image complexe contenant la transformee de Fourier complexe de l'image                    */
                                        /* Argument (avant filtrage).                                                                */
          EDEFV(imageJ,noyau_de_filtrage);
                                        /* Image complexe contenant le noyau de filtrage.                                            */

          Eblock
     end_nouveau_block

     RETU_Commande;
     Eblock
ECommande



Copyright © Jean-François COLONNA, 2019-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2019-2024.