Subversion Repositories wimsdev

Rev

Rev 12473 | Rev 17633 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12473 Rev 17574
Line 19... Line 19...
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
 
22
 
23
#include "flydraw.h"
23
#include "flydraw.h"
-
 
24
 
-
 
25
FILE *tikz_file;
24
 
26
 
25
char imagefilename[1024];
27
char imagefilename[1024];
26
char vimgfilename[1024];
28
char vimgfilename[1024];
-
 
29
char tikzfilename[1024];
27
int sizex, sizey, saved;
30
int sizex, sizey, saved;
28
gdImagePtr image=NULL, brushimg=NULL, tileimg=NULL, wimg=NULL;
31
gdImagePtr image=NULL, brushimg=NULL, tileimg=NULL, wimg=NULL;
29
int brushed=0, tiled=0, styled=0, width=1, savew=1, wcolor=-1, width2=4;
32
int brushed=0, tiled=0, styled=0, width=1, savew=1, wcolor=-1, width2=4;
30
int color_white, color_black, color_bounder, color_frame;
33
int color_white, color_black, color_bounder, color_frame;
31
int linecnt=-100000;
34
int linecnt=-100000;
Line 62... Line 65...
62
 */
65
 */
63
double parallogram_fonda[]={0,0,100,0,0,100};
66
double parallogram_fonda[]={0,0,100,0,0,100};
64
 
67
 
65
/* Write the image */
68
/* Write the image */
66
void output(void)
69
void output(void)
67
{
70
{
68
  FILE *out;
71
  FILE *out;
69
 
72
 
70
  if(!image) return;
73
  if(!image) return;
71
  if(imagefilename[0]) {
74
  if(imagefilename[0]) {
72
    out=fopen(imagefilename,"wb");
75
    out=fopen(imagefilename,"wb");
Line 133... Line 136...
133
  varcnt=1;
136
  varcnt=1;
134
  if(argc>1) snprintf(imagefilename,sizeof(imagefilename),"%s",argv[1]);
137
  if(argc>1) snprintf(imagefilename,sizeof(imagefilename),"%s",argv[1]);
135
  else imagefilename[0]=0;
138
  else imagefilename[0]=0;
136
  fly_process();
139
  fly_process();
137
  if(!saved || imagefilename[0]!=0) output();
140
  if(!saved || imagefilename[0]!=0) output();
-
 
141
  if(tikz_file){
-
 
142
    fprintf(tikz_file,"\\end{tikzpicture}\n\\end{document}\n");
-
 
143
    fclose(tikz_file);
-
 
144
  }
138
  if(image) gdImageDestroy(image);
145
  if(image) gdImageDestroy(image);
139
  if(vimg_ready) vimg_close();
146
  if(vimg_ready) vimg_close();
140
  return 0;
147
  return 0;
141
}
148
}