=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/plot/smoothing.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -p -r1.7 -r1.8 --- OpenXM_contrib2/asir2000/plot/smoothing.c 2002/07/11 12:35:03 1.7 +++ OpenXM_contrib2/asir2000/plot/smoothing.c 2002/07/20 02:28:08 1.8 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/plot/smoothing.c,v 1.6 2002/07/11 03:34:34 takayama Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/plot/smoothing.c,v 1.7 2002/07/11 12:35:03 takayama Exp $ */ #include "ca.h" #include "parse.h" #include "ox.h" @@ -12,7 +12,7 @@ static FILE *Fp = NULL; -static void polyLine_outputProlog(int xmin, int ymin, int xmax, int ymax); +static void polyLine_outputProlog(int xmin, int ymin, int xmax, int ymax, int upsidedown); static void polyLine_outputEpilog(void); static void polyLine_error(char *s); #define translateX(x) (x*MAG+PRINT_XOFFSET) @@ -31,7 +31,7 @@ static int polyLine_pline(struct canvas *can); static int Strategy_generate_PS = 0; -static void polyLine_outputProlog(int xmin, int ymin,int xmax, int ymax) { +static void polyLine_outputProlog(int xmin, int ymin,int xmax, int ymax, int upsidedown) { fprintf(Fp,"%%!PS-Adobe-1.0\n"); fprintf(Fp,"%%%%BoundingBox: %d %d %d %d \n", PRINT_XOFFSET+xmin*MAG,PRINT_YOFFSET+ymin*MAG, @@ -39,6 +39,8 @@ static void polyLine_outputProlog(int xmin, int ymin,i fprintf(Fp,"%%%%Creator: This is generated by ifplot\n"); fprintf(Fp,"%%%%Title: ifplot\n"); fprintf(Fp,"%%%%EndComments: \n"); + if ( upsidedown ) + fprintf(Fp,"[1 0 0 -1 0 %d] concat \n",2*PRINT_YOFFSET+(ymin+ymax)*MAG); fprintf(Fp,"0.1 setlinewidth \n"); fprintf(Fp,"2 setlinecap \n"); fprintf(Fp,"2 setlinejoin \n"); @@ -120,18 +122,18 @@ struct canvas *can; generatePS_from_image(FILE *fp,XImage *image,int xsize, int ysize, int color[],int colorSize, - struct canvas *can,struct xcolorForPS *tableOfxcolorForPS) { + struct canvas *can,struct xcolorForPS *tableOfxcolorForPS, + int upsidedown) { struct polyLine **pl; int plSize = 0; int *prev; int *curr; int i,x,y,c; extern int Strategy_generate_PS; - Xsize = xsize; Ysize = ysize; Fp = fp; - polyLine_outputProlog(0,0,Xsize,Ysize); + polyLine_outputProlog(0,0,Xsize,Ysize,upsidedown); switch(Strategy_generate_PS) { default: fprintf(Fp,"%% debug info : colorSize=%d\n",colorSize); @@ -151,6 +153,8 @@ generatePS_from_image(FILE *fp,XImage *image,int xsize } break; } + /* XXX : reset the color to black */ + fprintf(Fp,"0 0 0 setrgbcolor \n"); polyLine_pline(can); polyLine_outputEpilog(); }