/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N D E S O P E R A T I O N S D ' A C C E S : */
/* */
/* */
/* Author of '$xci/acces.02$I' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20001224094035). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
#define ACCES_A_UNE_IMAGE_ET_CONVERSIONS_EVENTUELLES(nom_d_une_imageR,nom_d_une_imageA) \
Bblock \
Test(IL_NE_FAUT_PAS(detruire_l_image)) \
Bblock \
Test(IFET(EST_VRAI(les_images_sont_standards),EST_VRAI(il_faut_convertir_les_images_standards))) \
Bblock \
/* Cas d'une image 'image' a convertir en 'imageF' : */ \
CALi(IFinitialisation(IFmageR,FZERO)); \
/* Initialisation de l'image Resultat. */ \
Eblock \
ATes \
Bblock \
/* Autres cas : */ \
CALi(Inoir(ImageR)); \
/* Initialisation de l'image Resultat. */ \
Eblock \
ETes \
\
Test(EST_VRAI(les_images_sont_standards)) \
Bblock \
/* Cas d'une image 'image' : */ \
Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageA,nom_d_une_imageA)))) \
Bblock \
Test(EST_VRAI(il_faut_convertir_les_images_standards)) \
Bblock \
Test(IL_NE_FAUT_PAS(convertir_brutalement)) \
/* Test introduit le 20090525190958... */ \
/* */ \
/* On notera que l'indicateur 'convertir_brutalement' controle aussi bien les conversions */ \
/* des images "standard=VRAI" que des images "standard=FAUX", mais cela n'a aucune */ \
/* importance, puisque l'on ne peut pas etre dans ces deux situations simultanement... */ \
Bblock \
Test(EST_FAUX(il_faut_interpoler_apres_conversion_les_images_standards)) \
Bblock \
Test(EST_FAUX(il_faut_normaliser_apres_conversion_les_images_standards)) \
Bblock \
CALS(Istd_float(IFmageR \
,minimum_force,maximum_force \
,ImageA \
) \
); \
Eblock \
ATes \
Bblock \
CALS(Istd_float_avec_normalisation(IFmageR \
,ImageA \
) \
); \
/* Possibilite introduite le 20090318141617... */ \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
CALS(Istd_float_avec_interpolation(IFmageR \
,minimum_force,maximum_force \
,ImageA \
,il_faut_interpoler_lineairement \
) \
); \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
CALS(Istd_float_brutal(IFmageR,ImageA)); \
/* Conversion "brutale", c'est-a-dire sans verifier les niveaux par rapport aux formats... */ \
Eblock \
ETes \
\
CALi(IupdateF_image(nom_d_une_imageR,IFmageR)); \
Eblock \
ATes \
Bblock \
Test(EST_VRAI(les_images_standards_sont_a_renormaliser)) \
Bblock \
CALS(Irenormalisation(ImageR,ImageA)); \
/* Mis sous cette forme le 20220123144059... */ \
Eblock \
ATes \
Bblock \
CALS(Imove(ImageR,ImageA)); \
/* Lorsqu'il ne faut pas renormaliser, on prend l'image Argument telle quel... */ \
Eblock \
ETes \
\
REMONTEE_DU_NIVEAU_DE_NOIR(ImageR,ImageR,niveau_de_NOIR_remonte); \
/* Remontee eventuelle du niveau de NOIR... */ \
\
CALi(Iupdate_image(nom_d_une_imageR,ImageR)); \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
Test__CODE_ERREUR__ERREUR07; \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
/* Cas d'une image 'imageF' : */ \
Test(PAS_D_ERREUR(CODE_ERROR(IloadF_image(IFmageA,nom_d_une_imageA)))) \
Bblock \
Test(EST_VRAI(il_faut_convertir_les_images_non_standards)) \
Bblock \
Test(IL_NE_FAUT_PAS(convertir_brutalement)) \
/* Test introduit le 20080902110449... */ \
Bblock \
Test(EST_VRAI(il_faut_calculer_les_extrema_des_images_non_standards)) \
Bblock \
Test(EST_FAUX(l_image_non_standard_est_un_Z_Buffer)) \
/* Ce test a ete introduit le 20050418094015... */ \
Bblock \
Test(IL_FAUT(conserver_le_zero)) \
Bblock \
CALS(Ifloat_std_avec_le_vrai_zero_et_renormalisation(ImageR,IFmageA)); \
/* Renormalisation obligatoire lorsque l'image Argument est deja 'Float' en conservant le */ \
/* zero. */ \
Eblock \
ATes \
Bblock \
CALS(Ifloat_std_avec_renormalisation(ImageR,IFmageA)); \
/* Renormalisation obligatoire lorsque l'image Argument est deja 'Float' en deplacant le */ \
/* zero. */ \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
CALS(IFmove(Z_Buffer,IFmageA)); \
CALS(Ifloat_std_du_Z_Buffer(ImageR)); \
/* Ceci a donc ete introduit le 20050418094015 afin de permettre de faciliter la generation */ \
/* des effets de "depth-cueing"... */ \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
Test(IL_FAUT(tronquer_les_niveaux)) \
Bblock \
CALS(Ifloat_std_avec_troncation(ImageR,IFmageA,FLOT__NOIR,FLOT__BLANC)); \
/* Renormalisation avec forcage des extrema... */ \
Eblock \
ATes \
Bblock \
CALS(Ifloat_std(ImageR,IFmageA,minimum_force,maximum_force)); \
/* Renormalisation avec forcage des extrema... */ \
Eblock \
ETes \
Eblock \
ETes \
\
REMONTEE_DU_NIVEAU_DE_NOIR(ImageR,ImageR,niveau_de_NOIR_remonte) \
/* Remontee eventuelle du niveau de NOIR... */ \
Eblock \
ATes \
Bblock \
CALS(Ifloat_std_brutal(ImageR,IFmageA)); \
/* Renormalisation "brutale", c'est-a-dire sans verifier les niveaux par rapport aux */ \
/* formats... */ \
Eblock \
ETes \
\
CALi(Iupdate_image(nom_d_une_imageR,ImageR)); \
Eblock \
ATes \
Bblock \
CALS(IFmove(IFmageR,IFmageA)); \
CALi(IupdateF_image(nom_d_une_imageR,IFmageR)); \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
Test__CODE_ERREUR__ERREUR07; \
Eblock \
ETes \
Eblock \
ETes \
Eblock \
ATes \
Bblock \
CALS(Idelete_image(nom_d_une_imageA)); \
/* Cas ou seule une destruction est demandee... */ \
Eblock \
ETes \
Eblock \
/* Procedure d'acces a une image avec conversions eventuelles. */