/*************************************************************************************************************************************/ /* */ /* C A L C U L D E L A L U M I N A N C E D ' U N E I M A G E : */ /* */ /* */ /* Definition : */ /* */ /* Cette commande calcule une image */ /* Noir et Blanc correspondant a la luminance */ /* d'une image en vraies couleurs define par ses */ /* trois composantes 'RVB'. */ /* */ /* */ /* Author of '$xci/luminance.01$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1993??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 #include image_image_QUAD_IMAGE_EXT /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* M A C R O S U T I L E S : */ /* */ /*************************************************************************************************************************************/ #include xci/luminance.01.I" /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* C A L C U L D E L A L U M I N A N C E D ' U N E I M A G E : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); /* Nom de l'image a generer. */ DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_UNDEF)); /* Nom de l'image {ROUGE,VERTE,BLEUE} a utiliser (ce mode "RVB" implicite a ete introduit */ /* le 20050919155122). */ DEFV(CHAR,INIC(POINTERc(nom_imageAR),NOM_PIPE)); /* Nom de l'image ROUGE a utiliser, */ DEFV(CHAR,INIC(POINTERc(nom_imageAV),NOM_PIPE)); /* Nom de l'image VERTE a utiliser, */ DEFV(CHAR,INIC(POINTERc(nom_imageAB),NOM_PIPE)); /* Nom de l'image BLEUE a utiliser. */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("Rouge=""ROUGE=""AR=",nom_imageAR); GET_ARGUMENT_C("Verte=""VERTE=""AV=",nom_imageAV); GET_ARGUMENT_C("Bleue=""BLEUE=""AB=",nom_imageAB); GET_ARGUMENT_L("standard=",les_images_sont_standards); /* ATTENTION : on notera le 20130820100031 l'absence de l'option "RVB=". Le fait de */ /* savoir que l'on est alors en "RVB=VRAI" se fait en testant que l'option "A=" n'est pas */ /* vide. Or il est impossible d'introduire cette option "RVB=" sous peine de perdre la */ /* compatibilite anterieure de la commande 'v $xci/luminance.01$K'... Cela a ete decouvert */ /* grace a 'v $xrCD/Transfere.01$vv$Y .xci.luminance.01.X'. */ GET_ARGUMENT_L("eviter_apparition_NOIR=""eviter_NOIR=""NOIR=",Iluminance_____eviter_l_apparition_du_NOIR); /* Argument introduit le 20090529132347... */ ) ); CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR)); /* Initialisation de l'image Resultat. */ GENERER_LE_NOM_DE_TROIS_COMPOSANTES_CHROMATIQUES_RVB(nom_imageA,nom_imageAR,nom_imageAV,nom_imageAB) /* Introduit sous cette forme le 20050920151442... */ Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,Image_ROUGE,IFmage_ROUGE,nom_imageAR)))) Bblock Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,Image_VERTE,IFmage_VERTE,nom_imageAV)))) Bblock Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,Image_BLEUE,IFmage_BLEUE,nom_imageAB)))) Bblock CALS(gIluminance(les_images_sont_standards ,ImageR,IFmageR ,Image_ROUGE,IFmage_ROUGE ,Image_VERTE,IFmage_VERTE ,Image_BLEUE,IFmage_BLEUE ) ); /* Calcul de la luminance de l'image en vraies couleurs... */ CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR)); Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande