/*************************************************************************************************************************************/ /* */ /* 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 : */ /* */ /* */ /* Author of '$xci/move$K' : */ /* */ /* Jean-Francois COLONNA (LACTAMME, 1990??????????). */ /* */ /*************************************************************************************************************************************/ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 /* Introduit le 20140730105048... */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* P A R A M E T R E S : */ /* */ /*************************************************************************************************************************************/ #define METTRE_UN_FOND \ FAUX \ /* Faut-il mettre un fond au cas ou l'on ne charge pas toutes les images... */ #define DIMENSION_HORIZONTALE \ _____lNORMALISE_OX(dimX) \ /* Dimension horizontale du rectangle. */ #define DIMENSION_VERTICALE \ _____lNORMALISE_OY(dimY) \ /* Dimension verticale du rectangle. */ #define ABSCISSE_A \ FXorigine \ /* Abscisse du rectangle dans 'ImageA'. */ #define ORDONNEE_A \ FYorigine \ /* Ordonnee du rectangle dans 'ImageA'. */ #define TOREA_HORIZONTAL \ FAUX \ /* La direction horizontale ('X') est-elle repliee sur elle-meme ('VRAI') */ \ /* ou non ('FAUX') sur l'image Argument. */ #define TOREA_VERTICAL \ FAUX \ /* La direction verticale ('X') est-elle repliee sur elle-meme ('VRAI') */ \ /* ou non ('FAUX') sur l'image Argument. */ #define ABSCISSE_R \ FXorigine \ /* Abscisse du rectangle dans 'ImageR'. */ #define ORDONNEE_R \ FYorigine \ /* Ordonnee du rectangle dans 'ImageR'. */ #define TORER_HORIZONTAL \ FAUX \ /* La direction horizontale ('X') est-elle repliee sur elle-meme ('VRAI') */ \ /* ou non ('FAUX') sur l'image Resultat. */ #define TORER_VERTICAL \ FAUX \ /* La direction verticale ('X') est-elle repliee sur elle-meme ('VRAI') */ \ /* ou non ('FAUX') sur l'image Resultat. */ /*===================================================================================================================================*/ /*************************************************************************************************************************************/ /* */ /* 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 : */ /* */ /*************************************************************************************************************************************/ BCommande(nombre_d_arguments,arguments) /*-----------------------------------------------------------------------------------------------------------------------------------*/ Bblock DEFV(CHAR,INIC(POINTERc(nom_imageF),NOM_PIPE)); /* Nom du fond a utiliser au cas ou l'on ne charge pas toutes les images... */ DEFV(Logical,INIT(mettre_un_fond,METTRE_UN_FOND)); /* Indique s'il faut mettre ('VRAI') ou pas ('FAUX') un fond derriere... */ DEFV(CHAR,INIC(POINTERc(nom_imageR),NOM_PIPE)); DEFV(CHAR,INIC(POINTERc(nom_imageA),NOM_PIPE)); DEFV(Float,INIT(abscisse_A,ABSCISSE_A)); DEFV(Float,INIT(ordonnee_A,ORDONNEE_A)); DEFV(pointF_2D,pointA); /* Donne le coin "bas-gauche" dans l'image Argument ; ces donnees sont normalisees */ /* telles que l'unite represente la taille de l'image. */ DEFV(Logical,INIT(toreA_horizontal,TOREA_HORIZONTAL)); /* La direction horizontale ('X') est-elle repliee sur elle-meme ('VRAI') */ /* ou non ('FAUX') sur l'image Argument. */ DEFV(Logical,INIT(toreA_vertical,TOREA_VERTICAL)); /* La direction verticale ('X') est-elle repliee sur elle-meme ('VRAI') */ /* ou non ('FAUX') sur l'image Argument. */ DEFV(Float,INIT(abscisse_R,ABSCISSE_R)); DEFV(Float,INIT(ordonnee_R,ORDONNEE_R)); DEFV(pointF_2D,pointR); /* Donne le coin "bas-gauche" dans l'image Resultat ; ces donnees sont normalisees */ /* telle que l'unite represente la taille de l'image. */ DEFV(Logical,INIT(toreR_horizontal,TORER_HORIZONTAL)); /* La direction horizontale ('X') est-elle repliee sur elle-meme ('VRAI') */ /* ou non ('FAUX') sur l'image Resultat. */ DEFV(Logical,INIT(toreR_vertical,TORER_VERTICAL)); /* La direction verticale ('X') est-elle repliee sur elle-meme ('VRAI') */ /* ou non ('FAUX') sur l'image Resultat. */ DEFV(Float,INIT(dimension_horizontale,FLOT__UNDEF)); DEFV(Float,INIT(dimension_verticale,FLOT__UNDEF)); DEFV(deltaF_2D,dimensions); /* Dimensions horizontale et verticale du bloc de points ; ces donnees sont */ /* normalisee telles que l'unite represente la taille de l'image. On notera que cette */ /* operation ne peut etre effectuee que lorsque '$formatI' a ete definie et donc apres */ /* 'GET_ARGUMENTSi(...)', ce qui n'etait pas le cas avant le 20011209175852... */ /*..............................................................................................................................*/ GET_ARGUMENTSi(nombre_d_arguments ,BLOC(GET_ARGUMENT_C("imageF=""F=",nom_imageF); GET_ARGUMENT_L("fond=",mettre_un_fond); GET_ARGUMENT_C("imageA=""A=",nom_imageA); GET_ARGUMENT_C("imageR=""R=",nom_imageR); GET_ARGUMENT_L("standard=",les_images_sont_standards); GET_ARGUMENT_L("thA=",toreA_horizontal); GET_ARGUMENT_L("tvA=",toreA_vertical); GET_ARGUMENT_F("xA=""XA=",abscisse_A); GET_ARGUMENT_F("yA=""YA=",ordonnee_A); GET_ARGUMENT_L("thR=",toreR_horizontal); GET_ARGUMENT_L("tvR=",toreR_vertical); GET_ARGUMENT_F("xR=""XR=",abscisse_R); GET_ARGUMENT_F("yR=""YR=",ordonnee_R); GIT_ARGUMENT_F("dx=""dX=""h=",dimension_horizontale,DIMENSION_HORIZONTALE); GIT_ARGUMENT_F("dy=""dY=""v=",dimension_verticale,DIMENSION_VERTICALE); ) ); CALi(gInettoyage(les_images_sont_standards,ImageR,IFmageR)); /* Initialisation de l'image Resultat. */ Test(IL_FAUT(mettre_un_fond)) Bblock Test(EST_VRAI(les_images_sont_standards)) Bblock Test(PAS_D_ERREUR(CODE_ERROR(Iload_image(ImageR,nom_imageF)))) /* Un fond a ete demande, on le charge... */ Bblock Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes Eblock ATes Bblock PRINT_ATTENTION("en mode non 'standard', il n'est pas possible de mettre un fond"); Eblock ETes Eblock ATes Bblock Eblock ETes INITIALISATION_POINT_2D(pointA,abscisse_A,ordonnee_A); /* Donne le coin "bas-gauche" dans l'image Argument ; ces donnees sont normalisees */ /* telles que l'unite represente la taille de l'image. */ INITIALISATION_POINT_2D(pointR,abscisse_R,ordonnee_R); /* Donne le coin "bas-gauche" dans l'image Resultat ; ces donnees sont normalisees */ /* telle que l'unite represente la taille de l'image. */ INITIALISATION_ACCROISSEMENT_2D(dimensions,dimension_horizontale,dimension_verticale); /* Dimensions horizontale et verticale du bloc de points ; ces donnees sont */ /* normalisee telles que l'unite represente la taille de l'image. */ Test(PAS_D_ERREUR(CODE_ERROR(gIload_image(les_images_sont_standards,ImageA,IFmageA,nom_imageA)))) Bblock Test(EST_VRAI(les_images_sont_standards)) Bblock /* Cas d'une image 'image' : */ CALS(Imove_points(ImageR ,ADRESSE(pointR),toreR_horizontal,toreR_vertical ,ImageA ,ADRESSE(pointA),toreA_horizontal,toreA_vertical ,ADRESSE(dimensions) ) ); /* Deplacement d'un rectangle contenu dans 'ImageA' vers 'ImageR'... */ Eblock ATes Bblock /* Cas d'une image 'imageF' : */ DEFV(deltaF_2D,Rtranslation); INITIALISATION_ACCROISSEMENT_2D(Rtranslation ,SOUS(ASD1(pointR,x),ASD1(pointA,x)) ,SOUS(ASD1(pointR,y),ASD1(pointA,y)) ); CALS(IFtranslation(IFmageR ,IFmageA ,ADRESSE(Rtranslation) ,IFOU(toreA_horizontal,toreR_horizontal) ,IFOU(toreA_vertical,toreR_vertical) ) ); Eblock ETes CALi(gIupdate_image(les_images_sont_standards,nom_imageR,ImageR,IFmageR)); Eblock ATes Bblock Test__CODE_ERREUR__ERREUR07; Eblock ETes RETU_Commande; Eblock ECommande