Rev 8076 | Rev 8134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8076 | Rev 8102 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | /* This file is a temporary patch to tex eps files with extra borders. |
18 | /* This file is a temporary patch to tex eps files with extra borders. |
19 | * It cuts the borders in the resulting gif file, so that the font |
19 | * It cuts the borders in the resulting gif file, so that the font |
20 | * fits tightly in the cadre. libgd is required. */ |
20 | * fits tightly in the cadre. libgd is required. */ |
21 | 21 | ||
22 | #include "flydraw.h" |
22 | #include "flydraw.h" |
23 | #include "../Lib/libwims.h" |
- | |
24 | 23 | ||
25 | char imagefilename[1024]; |
24 | char imagefilename[1024]; |
26 | char vimgfilename[1024]; |
25 | char vimgfilename[1024]; |
27 | int sizex, sizey, saved; |
26 | int sizex, sizey, saved; |
28 | gdImagePtr image=NULL, brushimg=NULL, tileimg=NULL, wimg=NULL; |
27 | gdImagePtr image=NULL, brushimg=NULL, tileimg=NULL, wimg=NULL; |
Line 46... | Line 45... | ||
46 | FILE *vimgf=NULL; |
45 | FILE *vimgf=NULL; |
47 | double scale_buf[MAX_PARMS]; |
46 | double scale_buf[MAX_PARMS]; |
48 | /***** Les modifs a JC Fev 06 *****/ |
47 | /***** Les modifs a JC Fev 06 *****/ |
49 | /** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */ |
48 | /** les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 */ |
50 | /** elles sont remises a l'unite par resetmatrix nummatrix */ |
49 | /** elles sont remises a l'unite par resetmatrix nummatrix */ |
51 | typedef double matrice[4]; |
- | |
52 | #define JC_NB_MATRICES 19 |
- | |
- | 50 | ||
53 | /* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */ |
51 | /* la matrice fixant le systeme de coordonnees "mathematiques" dans l'image */ |
54 | matrice matrices_pavage[JC_NB_MATRICES+1]; |
52 | matrice matrices_pavage[JC_NB_MATRICES+1]; |
55 | #define matrix matrices_pavage[0] |
- | |
56 | typedef double vecteur[2]; |
- | |
57 | vecteur vecteurs_pavage[JC_NB_MATRICES+1]; |
53 | vecteur vecteurs_pavage[JC_NB_MATRICES+1]; |
58 | #define vector vecteurs_pavage[0] |
- | |
59 | /** les vecteurs suivants sont initialises par la commande setvector numvector,u_1,u_2 */ |
- | |
60 | /** ils sont remis a zero par resetvector numvector */ |
- | |
61 | 54 | ||
62 | - | ||
63 | /** les coordonnees du parallelograme de pavage = coordonnees "mathematiques" du parallelogramme contenant l'image a recopier **/ |
55 | /** les coordonnees du parallelograme de pavage = coordonnees "mathematiques" du parallelogramme contenant l'image a recopier **/ |
64 | /** on place ces coorodonnes avec setparallelogram xs,ys,xu,yu,xv,yu **/ |
56 | /** on place ces coorodonnes avec setparallelogram xs,ys,xu,yu,xv,yu **/ |
65 | /* xs,ys=coordonnees math du point 0,0, |
57 | /* xs,ys=coordonnees math du point 0,0, |
66 | * xu,yu coordonnees math de l'horizontale |
58 | * xu,yu coordonnees math de l'horizontale |
67 | * xv,yv coordonnees math de la verticale |
59 | * xv,yv coordonnees math de la verticale |
Line 69... | Line 61... | ||
69 | */ |
61 | */ |
70 | /** TODO serait-ce un moyen de definir la brush ?? **/ |
62 | /** TODO serait-ce un moyen de definir la brush ?? **/ |
71 | double parallogram_fonda[]={0,0,100,0,0,100}; |
63 | double parallogram_fonda[]={0,0,100,0,0,100}; |
72 | 64 | ||
73 | /**** Fin modifs JC Fev 06 ******/ |
65 | /**** Fin modifs JC Fev 06 ******/ |
74 | 66 | ||
75 | /* Write the image */ |
67 | /* Write the image */ |
76 | void output(void) |
68 | void output(void) |
77 | { |
69 | { |
78 | FILE *out; |
70 | FILE *out; |
79 | 71 | ||
80 | if(!image) return; |
72 | if(!image) return; |
81 | if(imagefilename[0]) { |
73 | if(imagefilename[0]) { |
82 | out=fopen(imagefilename,"wb"); |
74 | out=fopen(imagefilename,"wb"); |
83 | if(out!=NULL) {gdImageGif(image,out); fclose(out); } |
75 | if(out!=NULL) {gdImageGif(image,out); fclose(out); } |
84 | } |
76 | } |
85 | else gdImageGif(image,stdout); |
77 | else gdImageGif(image,stdout); |
86 | saved=1; |
78 | saved=1; |
87 | } |
79 | } |
88 | 80 | ||
89 |
|
81 | /*#include "flylines.c"*/ |
90 |
|
82 | /*#include "nametab.c"*/ |
91 | 83 | ||
92 | /* substitute variable names by their environment strings |
84 | /* substitute variable names by their environment strings |
93 | * The buffer pointed to by p must have enough space |
85 | * The buffer pointed to by p must have enough space |
94 | * (defined by MAX_LINELEN). |
86 | * (defined by MAX_LINELEN). |
- | 87 | */ |
|
95 | char *substit(char *p) |
88 | char *substit(char *p) |
96 | { |
89 | { |
97 | char *pp, *pe; |
90 | char *pp, *pe; |
98 | char namebuf[MAX_NAMELEN+1]; |
91 | char namebuf[MAX_NAMELEN+1]; |
99 | int i, l; |
92 | int i, l; |
Line 113... | Line 106... | ||
113 | string_modify(p,pp,pe,colortab[nametab[i].serial].def); |
106 | string_modify(p,pp,pe,colortab[nametab[i].serial].def); |
114 | } |
107 | } |
115 | return p; |
108 | return p; |
116 | } |
109 | } |
117 | 110 | ||
118 |
|
111 | /*#include "vimg.c"*/ |
119 |
|
112 | /*#include "objects.c"*/ |
120 | 113 | ||
121 | void process(void) |
114 | void process(void) |
122 | { |
115 | { |
123 | char buf[MAX_LINELEN+1]; |
116 | char buf[MAX_LINELEN+1]; |
124 | int c; |
117 | int c; |