_______________________________________________________________________________________________________________________________________
/*************************************************************************************************************************************/
/* */
/* F O N C T I O N S D E B A S E D ' E D I T I O N D E S I M A G E S */
/* S U I V A N T L A B I B L I O T H E Q U E ' F R A M E - B U F F E R U l t r a N e t ' : */
/* */
/* */
/* Definition : */
/* */
/* Ce fichier contient toutes les fonctions */
/* de base d'edition graphique des images raster, */
/* suivant la bibliotheque d'acces au frame-buffer */
/* 'UltraNet' connecte aux CRAYs YMP. */
/* */
/* */
/* Nota important : */
/* */
/* Je me permets de rappeler le scandale */
/* du frame-buffer UltraNet : l'axe 'OY' */
/* descend, alors que partout ailleurs */
/* (sauf sous 'X-Window'), logiquement, */
/* il monte... */
/* */
/* */
/* Author of '$xiidU/fonction$FON' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 19910000000000). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* O P P O R T U N I T E D E C O M P I L E R C E M O D U L E : */
/* */
/*************************************************************************************************************************************/
#ifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : indicateur de VERSION. */
DEFV(Common,DEFV(Logical,_______VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER));
#Aifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : indicateur de VERSION. */
#Eifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : indicateur de VERSION. */
#ifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : compiler sur 'UltFB'. */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N S D E S " B U G S " P R E S E N T S : */
/* */
/*************************************************************************************************************************************/
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UNE_SEULE_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
DEFV(Common,DEFV(Logical,_____BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UNE_SEULE_IMAGE_1));
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UNE_SEULE_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UNE_SEULE_IMAGE_1 /* Common,DEFV(Fonction,) : bug... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* I N C L U D E S S P E C I F I Q U E S D E ' S I L I C O N - G R A P H I C S ' : */
/* */
/*************************************************************************************************************************************/
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
@ include <ultra/ugraf.h>
/* Dans ces fichier se trouvent la plupart des definitions de type '#define' ainsi que */
/* les references externes (actuellement inutilise...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N D E S T Y P E S N E C E S S A I R E S : */
/* */
/*************************************************************************************************************************************/
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
TypedefP(U_UG_PARAM,UG_PARAM)
/* Structure definissant les parametres generaux (actuellement inutilisee...). */
TypedefP(U_UG_TBLK,UG_TBLK)
/* Structure definissant le format de l'image a manipuler (actuellement inutilisee...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* R E F E R E N C E S E X T E R N E S : */
/* */
/*************************************************************************************************************************************/
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
DEFV(Extern,DEFV(vrai_Int_de_base,ugraf()));
/* Fonction unique d'acces au frame-buffer (actuellement inutilisee...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
DEFV(Extern,DEFV(Void,UINIT()));
/* Fonction d'initialisation des parametres generaux. */
DEFV(Extern,DEFV(Void,UOPEN()));
/* Fonction d'ouverture et d'allocation des buffers necessaires ; on peut se demander */
/* pourquoi 'UINIT(...)' et 'UOPEN(...)' ne sont pas regroupees en une seule et meme */
/* fonction... */
DEFV(Extern,DEFV(Void,UCLOSE()));
/* Fonction de fermeture, symetrique de 'UOPEN(...)'. */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
DEFV(Extern,DEFV(Void,UFLIP()));
/* Fonction definissant le mode de synchronisation des operations, deux possibilites etant */
/* offertes ; horizontale (plus rapide, mais avec effet de "rouleau"), et verticale. On */
/* verra a ce propos les definitions 'modes_de_synchronisation'. */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
DEFV(Extern,DEFV(Void,UZOOM()));
/* Fonction definissant le rapport de zoom entier. */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
DEFV(Extern,DEFV(Void,UPAN()));
/* Fonction definissant un "pan"... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
DEFV(Extern,DEFV(Void,USCWRT()));
/* Fonction d'ecriture des trois composantes d'une image dans le frame-buffer... */
DEFV(Extern,DEFV(Void,UFLUSH()));
/* Fonction d'affichage d'une image precedemment transmise par 'USCWRT(...)'. */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D E F I N I T I O N S L O C A L E S : */
/* */
/*************************************************************************************************************************************/
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
Denumer02(INIS(_SYNCHRONISATION_VERTICALE,ZERO)
,_SYNCHRONISATION_HORIZONTALE
,modes_de_synchronisation
);
# define SYNCHRONISATION_VERTICALE \
ENUM(_SYNCHRONISATION_VERTICALE)
# define SYNCHRONISATION_HORIZONTALE \
ENUM(_SYNCHRONISATION_HORIZONTALE)
/* Definition des differents mode de synchronisation des operations avec le frame-buffer. */
/* Voir a ce propos la fonction 'UFLIP(...)'. ATTENTION : on notera l'utilisation de */
/* 'Denumer02(...);' et non pas de 'DenumeT02(...)' a cause du 'INIS(...)' qu'il contient. */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
Denumer02(INIS(_ABSENCE_DE_COMPRESSION,ZERO)
,_PRESENCE_DE_COMPRESSION
,modes_de_compression
);
# define ABSENCE_DE_COMPRESSION \
ENUM(_ABSENCE_DE_COMPRESSION)
# define PRESENCE_DE_COMPRESSION \
ENUM(_PRESENCE_DE_COMPRESSION)
/* Definition des differents mode de compression des operations avec le frame-buffer. */
/* Voir a ce propos la fonction 'UOPEN(...)'. ATTENTION : on notera l'utilisation de */
/* 'Denumer02(...);' et non pas de 'DenumeT02(...)' a cause du 'INIS(...)' qu'il contient. */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
# define ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(fonction,action_si_OK,action_si_ERREUR) \
Bblock \
BLOC(CALS(fonction)); \
/* Execution de la fonction demandee... */ \
BLOC(action_si_OK); \
/* Execution systematique de la sequence de traitement des cas "normaux" puisque le code */ \
/* de compte-rendu 'compte_rendu_des_operations' n'est pas renvoye... */ \
Eblock \
/* Fonction generale d'acces au frame-buffer avec test des conditions de retour... */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
# define ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(fonction,action_si_OK,action_si_ERREUR) \
Bblock \
BLOC(CALS(fonction)); \
/* Execution de la fonction demandee... */ \
Test(PAS_D_ERREUR(compte_rendu_des_operations)) \
Bblock \
BLOC(action_si_OK); \
/* Execution de la sequence de traitement des cas "normaux"... */ \
Eblock \
ATes \
Bblock \
PRINT_ERREUR("l'acces au frame-buffer par 'fonction' s'est mal deroule"); \
CAL1(Prer1(" erreur=%d\n",compte_rendu_des_operations)); \
BLOC(action_si_ERREUR); \
/* Execution de la sequence de traitement des erreurs... */ \
Eblock \
ETes \
Eblock \
/* Fonction generale d'acces au frame-buffer avec test des conditions de retour... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* E T A T D E L A F E N E T R E : */
/* */
/*************************************************************************************************************************************/
DEFV(Local,DEFV(Logical,INIT(liaison_avec_le_frame_buffer,INACTIF)));
/* Indicateur logique precisant si la liaison est active (entre un 'open' et un 'close'), */
/* ou inactive (pas encore ouverte, ou fermee). */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
DEFV(Local,DEFV(U_UG_PARAM,parametres_d_acces_au_frame_buffer));
/* Parametres de la fonction 'ugraf(...)' (actuellement inutilises...). */
DEFV(Local,DEFV(U_UG_TBLK,definition_d_une_image_dans_le_frame_buffer));
/* Parametres necessaires a la description de l'image courante (actuellement inutilises...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_include_1
DEFV(Local,DEFV(vrai_Int_de_base,INIT(compte_rendu_des_operations,UNDEF)));
/* Donne en general le compte-rendu d'une operation relative au frame-buffer. ATTENTION : */
/* on notera le 'BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1' ; mais la variable */
/* 'compte_rendu_des_operations' etant utilise dans toutes les fonctions, il doit etre */
/* malgre tout etre defini bien qu'inutile. */
DEFV(Local,DEFV(vrai_Int_de_base,INIT(mode_de_compression,ABSENCE_DE_COMPRESSION)));
/* Precise le mode de compression demandee ; voir a ce propos les definitions donnees par */
/* la "structure" 'modes_de_compression'. */
/* ATTENTION : cet 'Int' n'est la que parce que les fonctions du type 'U...(...)' ne */
/* recoivent comme arguments que leurs adresses (afin d'assurer la compabilite avec le */
/* 'FORTRAN'...). */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
DEFV(Local,DEFV(vrai_Int_de_base,INIT(mode_de_synchronisation,SYNCHRONISATION_VERTICALE)));
/* Precise le type de synchronisation demandee ; voir a ce propos les definitions donnees */
/* par la "structure" 'modes_de_synchronisation'. */
/* ATTENTION : cet 'Int' n'est la que parce que les fonctions du type 'U...(...)' ne */
/* recoivent comme arguments que leurs adresses (afin d'assurer la compabilite avec le */
/* 'FORTRAN'...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
DEFV(Local,DEFV(vrai_Int_de_base,INIT(mot_inutile,UNDEF)));
/* Argument necessaire a certaines fonctions 'U...(...)' mais inutilise malgre tout... */
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* O U V E R T U R E D ' U N E F E N E T R E : */
/* */
/*************************************************************************************************************************************/
BFonctionI
# define MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION \
QUATRE
# define MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION \
HUIT
/* Suivant le mode de compression 'mode_de_compression', 'dimX' doit etre un multiple d'un */
/* certain entier... */
DEFV(Common,DEFV(FonctionI,IUopen(nom_de_la_fenetreA
,ARGUMENT_POINTERs(coin_bas_droite)
)
)
)
DEFV(Argument,DEFV(CHAR,DTb0(nom_de_la_fenetreA)));
/* Nom de la fenetre a ouvrir (inutilise en fait, mais present par compatibilite avec les */
/* autres drivers...). */
DEFV(Argument,DEFV(pointF_2D,POINTERs(coin_bas_droite)));
/* Abscisse du point de reference. ATTENTION : cet argument est inutilise, mais conserve */
/* par raison de compabilite avec d'autres drivers... */
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(vrai_Int_de_base,INIT(Xmin_d_UINIT,NEUT(XminU)));
DEFV(vrai_Int_de_base,INIT(Ymin_d_UINIT,NEUT(YminU)));
/* Origine de l'image pour la fonction 'UINIT(...)'. */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1
DEFV(vrai_Int_de_base,INIT(Xmax_d_UINIT,NEUT(ADD2(XminU,dimX))));
DEFV(vrai_Int_de_base,INIT(Ymax_d_UINIT,NEUT(ADD2(YminU,dimY))));
/* Extremite de l'image pour la fonction 'UINIT(...)'. */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1
DEFV(vrai_Int_de_base,INIT(Xmax_d_UINIT,TRMU(ADD2(XminU,dimX))));
DEFV(vrai_Int_de_base,INIT(Ymax_d_UINIT,TRMU(ADD2(YminU,dimY))));
/* Extremite de l'image pour la fonction 'UINIT(...)'. */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_DIMENSION_DE_L_IMAGE_1
INIT_ERROR;
/*..............................................................................................................................*/
Test(EST_INACTIF(liaison_avec_le_frame_buffer))
Bblock
Test(IFOU(IFET(IFEQ(mode_de_compression,ABSENCE_DE_COMPRESSION)
,I3ET(EST_VRAI(DIVISIBLE(XminU,MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION))
,EST_VRAI(DIVISIBLE(Xmin,MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION))
,EST_VRAI(DIVISIBLE(dimX,MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION))
)
)
,IFET(IFEQ(mode_de_compression,PRESENCE_DE_COMPRESSION)
,I3ET(EST_VRAI(DIVISIBLE(XminU,MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION))
,EST_VRAI(DIVISIBLE(Xmin,MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION))
,EST_VRAI(DIVISIBLE(dimX,MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION))
)
)
)
)
Bblock
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UINIT(ADRESSE(Xmin_d_UINIT),ADRESSE(Xmax_d_UINIT)
,ADRESSE(Ymin_d_UINIT),ADRESSE(Ymax_d_UINIT)
,ADRESSE(mode_de_compression)
,ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UOPEN(ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(EGAL(liaison_avec_le_frame_buffer,ACTIF);)
,BLOC(EGAL(liaison_avec_le_frame_buffer,INACTIF);)
);
/* Tentative d'ouverture de la fenetre avec memorisation de l'etat final... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UFLIP(ADRESSE(mode_de_synchronisation)
,ADRESSE(compte_rendu_des_operations)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Et enfin, choix du mode de synchronisation (actuellement 'SYNCHRONISATION_VERTICALE'). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
Eblock
ATes
Bblock
PRINT_ERREUR("la dimension horizontale est incompatible avec le mode de compression");
CAL1(Prer1(" dimX = %d\n",dimX));
CAL1(Prer1(" multiplicite = %d\n",COND(IFEQ(mode_de_compression,ABSENCE_DE_COMPRESSION)
,MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION
,COND(IFEQ(mode_de_compression,PRESENCE_DE_COMPRESSION)
,MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION
,UNDEF
)
)
)
);
Eblock
ETes
Eblock
ATes
Bblock
PRINT_ERREUR("la fenetre est deja ouverte");
Eblock
ETes
RETU_ERROR;
Eblock
EFonctionI
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# undef SYNCHRONISATION_HORIZONTALE
# undef SYNCHRONISATION_VERTICALE
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UFLIP_1
# undef PRESENCE_DE_COMPRESSION
# undef ABSENCE_DE_COMPRESSION
# undef MULTIPLICITE_DE_dimX_EN_PRESENCE_DE_COMPRESSION
# undef MULTIPLICITE_DE_dimX_EN_ABSENCE_DE_COMPRESSION
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* F E R M E T U R E D ' U N E F E N E T R E : */
/* */
/*************************************************************************************************************************************/
BFonctionI
DEFV(Common,DEFV(FonctionI,IUclose()))
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
INIT_ERROR;
/*..............................................................................................................................*/
Test(EST_ACTIF(liaison_avec_le_frame_buffer))
Bblock
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UCLOSE(ADRESSE(compte_rendu_des_operations)
)
,BLOC(VIDE;)
,BLOC(EGAL(liaison_avec_le_frame_buffer,INACTIF);)
);
/* Tentative de fermeture de la fenetre, et memorisation de l'etat final... */
Eblock
ATes
Bblock
PRINT_ERREUR("la fenetre n'est pas ouverte");
Eblock
ETes
RETU_ERROR;
Eblock
EFonctionI
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D I S P L A Y G R A P H I Q U E D ' U N E I M A G E " V R A I E S C O U L E U R S " : */
/* */
/*************************************************************************************************************************************/
BFonctionI
# define RAPPORT_MAXIMAL_DU_ZOOM \
HUIT \
/* Rapport maximal du zoom entier... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
# define U_TRANSLATION_HORIZONTALE_DE_L_IMAGE \
ZERO \
/* Translation horizontale de l'image dans le plan de travail, */
# define U_TRANSLATION_VERTICALE_DE_L_IMAGE \
ZERO \
/* Translation verticale de l'image dans le plan de travail. */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
# define U_TRANSLATION_HORIZONTALE_DE_L_IMAGE \
COND(IL_FAUT(centrer_l_image_dans_la_fenetre) \
,MOYS(dimXU \
MUL2(facteur_de_zoom_effectif,dimX) \
) \
,_lDENORMALISE_OXU(ASI1(translation_de_l_image_dans_la_fenetre,dx)) \
) \
/* Translation horizontale de l'image dans le plan de travail, */
# define U_TRANSLATION_VERTICALE_DE_L_IMAGE \
COND(IL_FAUT(centrer_l_image_dans_la_fenetre) \
,MOYS(dimYU \
MUL2(facteur_de_zoom_effectif,dimY) \
) \
,_lDENORMALISE_OYU(ASI1(translation_de_l_image_dans_la_fenetre,dy)) \
) \
/* Translation verticale de l'image dans le plan de travail. */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
DEFV(Common,DEFV(FonctionI,IUdisplay(imageA_ROUGE,imageA_VERTE,imageA_BLEUE
,facteur_de_zoom
,centrer_l_image_dans_la_fenetre
,ARGUMENT_POINTERs(translation_de_l_image_dans_la_fenetre)
)
)
)
DEFV(Argument,DEFV(image,imageA_ROUGE));
/* Premiere image Argument (representant la composante ROUGE), */
DEFV(Argument,DEFV(image,imageA_VERTE));
/* Premiere image Argument (representant la composante VERTE), */
DEFV(Argument,DEFV(image,imageA_BLEUE));
/* Premiere image Argument (representant la composante BLEUE). */
DEFV(Argument,DEFV(Int,facteur_de_zoom));
/* Facteur de zoom horizontal et vertical de l'image... */
DEFV(Argument,DEFV(Logical,centrer_l_image_dans_la_fenetre));
/* Indicateur precisant s'il faut un centrage automatique de l'image dans la fenetre */
/* ('VRAI') ou si la translation est definie en tant que l'argument suivant ('FAUX'). */
/* ATTENTION : suivant la valeur de 'BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1' */
/* cette demande de centrage peut etre en fait ineffective... */
DEFV(Argument,DEFV(deltaF_2D,POINTERs(translation_de_l_image_dans_la_fenetre)));
/* Translation explicite de l'image dans la fenetre lorsque le centrage automatique n'est */
/* pas demande ('centrer_l_image_dans_la_fenetre'='FAUX'). Dans le cas ou le centrage */
/* automatique est demande, cet argument (qui doit etre present a cause de la validation */
/* du nombre des arguments) n'est pas utilise. ATTENTION : suivant la valeur du symbole */
/* 'BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1', cette translation peut etre en */
/* fait ineffective... */
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
INIT_ERROR;
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
DEFV(imageI,IimageA_ROUGE);
DEFV(imageI,IimageA_VERTE);
DEFV(imageI,IimageA_BLEUE);
/* Ces trois images intermediaires sont destinees a "compenser" le fait que la fonction */
/* 'USCWRT(...)' travaille en entiers et non pas en caracteres... */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
# define IimageA_ROUGE \
imageA_ROUGE
# define IimageA_VERTE \
imageA_VERTE
# define IimageA_BLEUE \
imageA_BLEUE
/* Ca y est, la fonction 'USCWRT(...)' travaille en caracteres... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
DEFV(vrai_Int_de_base,INIT(facteur_de_zoom_effectif,RAPPORT_DE_ZOOM_STANDARD_DU_FRAME_BUFFER_ULTRANET));
/* Facteur de zoom horizontal et vertical de l'image effectivement utilise... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
DEFV(vrai_Int_de_base,INIT(abscisse_du_PAN,XminU));
DEFV(vrai_Int_de_base,INIT(ordonnee_du_PAN,YminU));
/* Coordonnees de la fonction 'UPAN(...)'. */
/* ATTENTION : ces 'Int's n'est la que parce que les fonctions du type 'U...(...)' ne */
/* recoivent comme arguments que leurs adresses (afin d'assurer la compabilite avec le */
/* 'FORTRAN'...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
DEFV(vrai_Int_de_base,INIT(abscisse_en_bas_a_gauche,ADD2(Xmin,U_TRANSLATION_HORIZONTALE_DE_L_IMAGE)));
DEFV(vrai_Int_de_base,INIT(ordonnee_en_bas_a_gauche,ADD2(Ymin,U_TRANSLATION_VERTICALE_DE_L_IMAGE)));
DEFV(vrai_Int_de_base,INIT(abscisse_en_haut_a_droite,ADD2(Xmax,U_TRANSLATION_HORIZONTALE_DE_L_IMAGE)));
DEFV(vrai_Int_de_base,INIT(ordonnee_en_haut_a_droite,ADD2(Ymax,U_TRANSLATION_VERTICALE_DE_L_IMAGE)));
/* Definition de l'emplacement de l'image. Mais ATTENTION : cette initialisation est */
/* eventuellement mauvaise, car en effet 'facteur_de_zoom_effectif' n'est pas encore */
/* connu... */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
DEFV(vrai_Int_de_base,INIT(longueur_des_lignes_de_chaque_imageA,dimX));
/* Longueur des lignes de chacune des trois composantes de l'image a transmettre au */
/* frame-buffer. */
/* ATTENTION : cet 'Int' n'est la que parce que les fonctions du type 'U...(...)' ne */
/* recoivent comme arguments que leurs adresses (afin d'assurer la compabilite avec le */
/* 'FORTRAN'...). */
DEFV(vrai_Int_de_base,INIT(ordonnee_de_la_ligne_courante,UNDEF));
/* Ordonnee de la ligne courante lorsque l'on transmet ligne a ligne afin de renverser */
/* l'axe des 'OY'... */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
DEFV(vrai_Int_de_base,INIT(longueur_de_chaque_imageA,dimXY));
/* Longueur de chacune des trois composantes de l'image a transmettre au frame-buffer. */
/* ATTENTION : cet 'Int' n'est la que parce que les fonctions du type 'U...(...)' ne */
/* recoivent comme arguments que leurs adresses (afin d'assurer la compabilite avec le */
/* 'FORTRAN'...). */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
/*..............................................................................................................................*/
Test(EST_ACTIF(liaison_avec_le_frame_buffer))
Bblock
Test(IFGT(facteur_de_zoom,RAPPORT_MAXIMAL_DU_ZOOM))
Bblock
PRINT_ATTENTION("le rapport de zoom ne peut etre superieur a 4, la valeur standard est conservee");
Eblock
ATes
Bblock
Test(IZLE(facteur_de_zoom))
Bblock
PRINT_ATTENTION("le rapport de zoom ne peut etre negatif ou nul, la valeur standard est conservee");
Eblock
ATes
Bblock
EGAL(facteur_de_zoom_effectif,facteur_de_zoom);
/* Mise en place du facteur de zoom effectif (c'est-a-dire inchange au cas ou l'argument */
/* serait errone). */
Eblock
ETes
Eblock
ETes
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
CALS(Istd_int(IimageA_ROUGE,Istd_int_____LAISSER_INTACT_LES_NIVEAUX,imageA_ROUGE));
CALS(Istd_int(IimageA_VERTE,Istd_int_____LAISSER_INTACT_LES_NIVEAUX,imageA_VERTE));
CALS(Istd_int(IimageA_BLEUE,Istd_int_____LAISSER_INTACT_LES_NIVEAUX,imageA_BLEUE));
/* Conversion des images Arguments en un format compatible avec ce qu'attend la fonction */
/* 'USCWRT(...)' qui travaille en entiers et non pas en caracteres... */
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
EGAL(abscisse_en_bas_a_gauche,ADD2(Xmin,U_TRANSLATION_HORIZONTALE_DE_L_IMAGE));
EGAL(ordonnee_en_bas_a_gauche,ADD2(Ymin,U_TRANSLATION_VERTICALE_DE_L_IMAGE));
EGAL(abscisse_en_haut_a_droite,ADD2(Xmax,U_TRANSLATION_HORIZONTALE_DE_L_IMAGE));
EGAL(ordonnee_en_haut_a_droite,ADD2(Ymax,U_TRANSLATION_VERTICALE_DE_L_IMAGE));
/* Definition de l'emplacement de l'image lorsque 'facteur_de_zoom_effectif' est connu... */
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UZOOM(ADRESSE(facteur_de_zoom_effectif),ADRESSE(facteur_de_zoom_effectif)
,ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Selection du rapport de zoom (identique sur les deux axes...). */
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UPAN(ADRESSE(abscisse_du_PAN),ADRESSE(ordonnee_du_PAN)
,ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Selection de la position de l'image dans le frame-buffer. On notera l'utilisation du */
/* coin en bas a gauche (alors que le frame-buffer attend le coin en haut a gauche) due */
/* au fait que l'axe des 'OY' descend... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_UPAN_1
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
EGAL(ordonnee_de_la_ligne_courante,ADD2(XminU,U_TRANSLATION_HORIZONTALE_DE_L_IMAGE));
/* Ordonnee sur l'ecran de la premiere ligne a transmettre... */
begin_colonne_back
Bblock
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(USCWRT(ADRESSE(IMAGE(IimageA_ROUGE,Xmin,Y))
,ADRESSE(IMAGE(IimageA_VERTE,Xmin,Y))
,ADRESSE(IMAGE(IimageA_BLEUE,Xmin,Y))
,ADRESSE(longueur_des_lignes_de_chaque_imageA)
,ADRESSE(abscisse_en_bas_a_gauche),ADRESSE(ordonnee_de_la_ligne_courante)
,ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Transmission de l'image au frame-buffer. On notera deux choses : d'une part, on fait */
/* l'hypothese que les images sont rangees ligne apres ligne (et non pas en colonne), ce */
/* qui permet d'extraire une ligne avec le calcul de l'adresse de son premier element (soit */
/* 'ADRESSE(IMAGE(...,Xmin,Y)') et non pas en deplacant les points les uns apres les autres. */
/* D'autre part, on aurait pu faire 'Iy_symetrie(...)' pour renverser successivement chacune */
/* des trois composantes, nous ramenant ainsi au cas "normal", mais une fois n'est pas */
/* coutume, je pense aux performances... */
INCR(ordonnee_de_la_ligne_courante,pasY);
/* Ordonnee sur l'ecran de la prochaine ligne a transmettre... */
Eblock
end_colonne_back
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(USCWRT(IimageA_ROUGE
,IimageA_VERTE
,IimageA_BLEUE
,ADRESSE(longueur_de_chaque_imageA)
,ADRESSE(abscisse_en_bas_a_gauche),ADRESSE(ordonnee_en_bas_a_gauche)
,ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Transmission de l'image au frame-buffer... */
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_IMAGE_1
ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER(UFLUSH(ADRESSE(compte_rendu_des_operations)
,ADRESSE(mot_inutile)
)
,BLOC(VIDE;)
,BLOC(VIDE;)
);
/* Et enfin, visualisation... */
Eblock
ATes
Bblock
PRINT_ERREUR("la fenetre n'est pas ouverte");
Eblock
ETes
RETU_ERROR;
Eblock
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
# undef IimageA_BLEUE
# undef IimageA_VERTE
# undef IimageA_ROUGE
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_FORMAT_DES_NIVEAUX_1
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
# undef U_TRANSLATION_VERTICALE_DE_L_IMAGE
# undef U_TRANSLATION_HORIZONTALE_DE_L_IMAGE
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
# undef U_TRANSLATION_VERTICALE_DE_L_IMAGE
# undef U_TRANSLATION_HORIZONTALE_DE_L_IMAGE
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_ORIGINE_DES_LIGNES_1
# undef RAPPORT_MAXIMAL_DU_ZOOM
EFonctionI
# ifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
# undef ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER
# Aifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
# undef ENVOI_D_UNE_FONCTION_AU_FRAME_BUFFER
# Eifdef BUG_SYSTEME_ULTRANET_FRAME_BUFFER_status_1
#Aifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : compiler sur 'UltFB'. */
#Eifdef __VERSION__COMPILER_LE_GRAPHIQUE_ULTRANET_FRAME_BUFFER /* Common,DEFV(Fonction,) : compiler sur 'UltFB'. */
_______________________________________________________________________________________________________________________________________
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.