/*************************************************************************************************************************************/
/* */
/* D E P L A C E M E N T D ' U N B L O C D E P O I N T S A V E C R E P L I E M E N T : */
/* */
/* */
/* Author of '$xci/RepliBloc.01$K' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20090226124757). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* 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 CENTRER_LE_BLOC_RECTANGULAIRE \
VRAI \
/* Le bloc rectangulaire doit-il etre centre ('VRAI') ou pas ('FAUX') ? Ce parametre */ \
/* fut introduit le 20080901150308... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E P L A C E M E N T D ' U N B L O C D E P O I N T S A V E C R E P L I E M E N T : */
/* */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE));
DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE));
DEFV(Logical,INIT(centrer_le_bloc_rectangulaire,CENTRER_LE_BLOC_RECTANGULAIRE));
/* Le bloc rectangulaire doit-il etre centre ('VRAI') ou pas ('FAUX') ? Ce parametre */
/* fut introduit le 20080901150308... */
DEFV(Int,INIT(XminR,UNDEF));
DEFV(Int,INIT(XmaxR,UNDEF));
DEFV(Int,INIT(YminR,UNDEF));
DEFV(Int,INIT(YmaxR,UNDEF));
/* Dimension du bloc rectangulaire resultat du repliement. */
/* */
/* On notera que cela est defini en coordonnees denormalisees afin d'etre utiliser en */
/* conjonction avec 'v $xci/format.01$K' (et non pas en coordonnees normalisees comme */
/* 'v $xci/move$K' par exemple...). */
/*..............................................................................................................................*/
GET_ARGUMENTSi(nombre_d_arguments
,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA);
GET_ARGUMENT_C("imageR=""R=",nom_imageR);
GET_ARGUMENT_L("centrer=",centrer_le_bloc_rectangulaire);
GIT_ARGUMENT_I("XminR=",XminR,Xmin);
GIT_ARGUMENT_I("XmaxR=",XmaxR,Xmax);
GIT_ARGUMENT_I("YminR=",YminR,Ymin);
GIT_ARGUMENT_I("YmaxR=",YmaxR,Ymax);
GET_ARGUMENT_L("maximum=",Imove_points_avec_repliement_____utiliser_le_maximum);
GET_ARGUMENT_N("masquage=",Imove_points_avec_repliement_____utiliser_le_maximum);
/* Parametres introduits le 20090226172543... */
)
);
CALi(Inoir(ImageR));
/* Initialisation de l'image Resultat. */
Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA,nom_imageA))))
Bblock
DEFV(Int,INIT(XminR_effectif,XminR));
DEFV(Int,INIT(XmaxR_effectif,XmaxR));
DEFV(Int,INIT(YminR_effectif,YminR));
DEFV(Int,INIT(YmaxR_effectif,YmaxR));
/* Definition effective du bloc rectangulaire. */
Test(IL_FAUT(centrer_le_bloc_rectangulaire))
Bblock
DEFV(Int,INIT(translation_X,SOUS(Xcentre,ADD2(XminR,MOIT(DIMENSION(XminR,XmaxR))))));
DEFV(Int,INIT(translation_Y,SOUS(Ycentre,ADD2(YminR,MOIT(DIMENSION(YminR,YmaxR))))));
/* Translation de centrage du bloc rectangulaire... */
EGAL(XminR_effectif,ADD2(XminR,translation_X));
EGAL(XmaxR_effectif,ADD2(XmaxR,translation_X));
EGAL(YminR_effectif,ADD2(YminR,translation_Y));
EGAL(YmaxR_effectif,ADD2(YmaxR,translation_Y));
Eblock
ATes
Bblock
Eblock
ETes
CALS(Imove_points_avec_repliement(ImageR
,XminR_effectif,XmaxR_effectif,YminR_effectif,YmaxR_effectif
,ImageA
,Xmin,Xmax,Ymin,Ymax
)
);
/* Deplacement d'un rectangle contenu dans 'ImageA' vers 'ImageR'... */
CALi(Iupdate_image(nom_imageR,ImageR));
Eblock
ATes
Bblock
Test__CODE_ERREUR__ERREUR07;
Eblock
ETes
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.