/*************************************************************************************************************************************/
/* */
/* C O M P T A G E M A S Q U E D U N O M B R E D E P O I N T S A P P A R T E N A N T */
/* A U N C E R T A I N I N T E R V A L L E D A N S U N E I M A G E : */
/* */
/* */
/* Author of '$xci/comptage$K' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20011202085855). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* 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 NIVEAU_ORIGINE_STANDARD \
NOIR
#define NIVEAU_EXTREMITE_STANDARD \
BLANC
/* Definition de l'intervalle "standard". */
#define NIVEAU_ORIGINE_NON_STANDARD \
FZERO
#define NIVEAU_EXTREMITE_NON_STANDARD \
FU
/* Definition de l'intervalle "non standard". */
#define EDITER_LA_PROPORTION \
FAUX \
/* Faut-il editer le nombre de points ('VRAI') ou leur proportion ('FAUX') ? Ce parametre */ \
/* fut introduit le 20110118081836 en assurant la compatibilite anterieure... */
#define TERMINER_LES_SORTIES_PAR_UN_K_LF \
VRAI \
/* Faut-il editer un 'K_LF' en dernier ('VRAI') ou pas ('FAUX') ? Ce parametre fut */ \
/* introduit le 20081119140122 en assurant la compatibilite anterieure... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* C O M P T A G E M A S Q U E D U N O M B R E D E P O I N T S A P P A R T E N A N T */
/* A U N C E R T A I N I N T E R V A L L E D A N S U N E I M A G E : */
/* */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE));
DEFV(genere_p,INIT(niveau_origine,NIVEAU_ORIGINE_STANDARD));
DEFV(genere_p,INIT(niveau_extremite,NIVEAU_EXTREMITE_STANDARD));
/* Definition de l'intervalle "standard". */
DEFV(genere_Float,INIT(Fniveau_origine,NIVEAU_ORIGINE_NON_STANDARD));
DEFV(genere_Float,INIT(Fniveau_extremite,NIVEAU_EXTREMITE_NON_STANDARD));
/* Definition de l'intervalle "non standard". */
DEFV(Logical,INIT(editer_la_proportion,EDITER_LA_PROPORTION));
/* Faut-il editer le nombre de points ('VRAI') ou leur proportion ('FAUX') ? Ce parametre */
/* fut introduit le 20110118081836 en assurant la compatibilite anterieure... */
DEFV(Logical,INIT(terminer_les_sorties_par_un_K_LF,TERMINER_LES_SORTIES_PAR_UN_K_LF));
/* Faut-il editer un 'K_LF' en dernier ('VRAI') ou pas ('FAUX') ? Ce parametre fut */
/* introduit le 20081119140122 en assurant la compatibilite anterieure... */
/*..............................................................................................................................*/
GET_ARGUMENTSi(nombre_d_arguments
,BLOC(GET_ARGUMENT_C("imageA=""A=",nom_imageA);
GET_ARGUMENT_L("standard=",les_images_sont_standards);
GET_ARGUMENT_P("origine=""o=",niveau_origine);
GET_ARGUMENT_P("extremite=""e=",niveau_extremite);
GET_ARGUMENT_F("Forigine=""Fo=",Fniveau_origine);
GET_ARGUMENT_F("Fextremite=""Fe=",Fniveau_extremite);
GET_ARGUMENT_L("proportion=",editer_la_proportion);
GET_ARGUMENT_N("nombre=",editer_la_proportion);
/* Parametres introduits le 20110118081836... */
GET_ARGUMENT_L("ligne=""NL=""LF=",terminer_les_sorties_par_un_K_LF);
/* Parametre introduit le 20081119140122... */
)
);
Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA,IFmageA,nom_imageA))))
Bblock
/* Chargement de la premiere image Argument. */
DEFV(Positive,INIT(nombre_de_points
,gIcomptage_des_points_dans_un_intervalle(les_images_sont_standards
,ImageA,IFmageA
,niveau_origine,Fniveau_origine
,niveau_extremite,Fniveau_extremite
)
)
);
/* Mis sous cette forme le 20110118081836... */
Test(IL_FAUT(editer_la_proportion))
/* Test introduit le 20110118081836... */
Bblock
CAL3(Prme1(chain_Aconcaten2("%.^^^",COND(IL_FAUT(terminer_les_sorties_par_un_K_LF),"\n",C_VIDE))
,DIVI(FLOT(nombre_de_points),FLOT(dimXY))
)
);
/* Et edition de la proportion de points appartenant a un intervalle donne (bornes incluses, */
/* ce qui permet de reduire l'intervalle a un point par : niveau_origine=niveau_extremite). */
Eblock
ATes
Bblock
CAL3(Prme1(chain_Aconcaten2("%d",COND(IL_FAUT(terminer_les_sorties_par_un_K_LF),"\n",C_VIDE))
,nombre_de_points
)
);
/* Et edition du nombre de points appartenant a un intervalle donne (bornes incluses, */
/* ce qui permet de reduire l'intervalle a un point par : niveau_origine=niveau_extremite). */
Eblock
ETes
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.