/*************************************************************************************************************************************/
/* */
/* R E C H E R C H E D E S C O O R D O N N E E S E X T R E M A L E S */
/* D E S P O I N T N ' A P P A R T E N A N T P A S A U F O N D : */
/* */
/* */
/* Definition : */
/* */
/* Cette commande recherche les extrema */
/* des coordonnees 'X' et 'Y par rapport a */
/* un fond arbitraire... */
/* */
/* */
/* Author of '$xci/extremaXY$K' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20190112131557). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* 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 : */
/* */
/*************************************************************************************************************************************/
#define EDITER_LES_TRANSLATIONS_NORMALISEES_DE_CENTRAGE \
VRAI \
/* Faut-il editer les translations normalisees permettant de centrer l'image. */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
#define EDITION_D_UN_EXTREMUM(editer,coordonnee,message) \
Bblock \
Test(IFET(IL_FAUT(editer),IL_NE_FAUT_PAS(editer_les_translations_normalisees_de_centrage))) \
Bblock \
CAL3(Prme2("%s = %d\n",message,coordonnee)); \
Eblock \
ATes \
Bblock \
Eblock \
ETes \
Eblock
#define EDITION_D_UNE_TRANSLATION(editer,on_a_trouve_le_minimum,on_a_trouve_le_maximum,translation,message) \
Bblock \
Test(IL_FAUT(editer)) \
Bblock \
Test(IFET(EST_VRAI(on_a_trouve_le_minimum),EST_VRAI(on_a_trouve_le_maximum))) \
Bblock \
CAL3(Prme2("%s=%+.^^^\n",message,translation)); \
/* Cette edition est compatible avec 'v $xci/scroll$K GET_ARGUMENT_F..tr.=.'... */ \
Eblock \
ATes \
Bblock \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
Eblock \
ETes \
Eblock
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* R E C H E R C H E D E S C O O R D O N N E E S E X T R E M A L E S */
/* D E S P O I N T N ' A P P A R T E N A N T P A S A U F O N D : */
/* */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE));
DEFV(Logical,INIT(editer_les_translations_normalisees_de_centrage,EDITER_LES_TRANSLATIONS_NORMALISEES_DE_CENTRAGE));
/* Faut-il editer les translations normalisees permettant de centrer l'image. */
/*..............................................................................................................................*/
GET_ARGUMENTSi(nombre_d_arguments
,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA);
GET_ARGUMENT_P("fond=""f=",Icoordonnees_extremales_____niveau_du_fond);
GET_ARGUMENT_L("editer_centrage=""centrage=""ec=",editer_les_translations_normalisees_de_centrage);
)
);
Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA,nom_imageA))))
Bblock
/* Chargement de l'image Argument. */
CALS(Icoordonnees_extremales(ImageA));
EDITION_D_UN_EXTREMUM(Icoordonnees_extremales_____on_a_trouve__Xminimum,Icoordonnees_extremales_____Xminimum,"minimumX");
EDITION_D_UN_EXTREMUM(Icoordonnees_extremales_____on_a_trouve__Xmaximum,Icoordonnees_extremales_____Xmaximum,"maximumX");
EDITION_D_UN_EXTREMUM(Icoordonnees_extremales_____on_a_trouve__Yminimum,Icoordonnees_extremales_____Yminimum,"minimumY");
EDITION_D_UN_EXTREMUM(Icoordonnees_extremales_____on_a_trouve__Ymaximum,Icoordonnees_extremales_____Ymaximum,"maximumY");
EDITION_D_UNE_TRANSLATION(editer_les_translations_normalisees_de_centrage
,Icoordonnees_extremales_____on_a_trouve__Xminimum
,Icoordonnees_extremales_____on_a_trouve__Xmaximum
,_____lNORMALISE_OX(SOUS(COXR(Xcentre)
,MOYE(COXR(Icoordonnees_extremales_____Xminimum)
,COXR(Icoordonnees_extremales_____Xmaximum)
)
)
)
,"trX"
);
/* Cette edition est compatible avec 'v $xci/scroll$K GET_ARGUMENT_F..trx=..trX=.'... */
EDITION_D_UNE_TRANSLATION(editer_les_translations_normalisees_de_centrage
,Icoordonnees_extremales_____on_a_trouve__Yminimum
,Icoordonnees_extremales_____on_a_trouve__Ymaximum
,_____lNORMALISE_OY(SOUS(COYR(Ycentre)
,MOYE(COYR(Icoordonnees_extremales_____Yminimum)
,COYR(Icoordonnees_extremales_____Ymaximum)
)
)
)
,"trY"
);
/* Cette edition est compatible avec 'v $xci/scroll$K GET_ARGUMENT_F..try=..trY=.'... */
Eblock
ATes
Bblock
Test__CODE_ERREUR__ERREUR07;
Eblock
ETes
RETU_Commande;
Eblock
ECommande