From 0dc7b5edc58def3839f05e8692f060aa47b18e2c Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 3 Sep 2010 16:35:32 +0000 Subject: PostScript output of Fl_Pixmap objects: accept now arbitrarily large pixmaps git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7695 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/ps_image.cxx | 54 ++++++++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src/ps_image.cxx') diff --git a/src/ps_image.cxx b/src/ps_image.cxx index 51646efa6..e60797764 100644 --- a/src/ps_image.cxx +++ b/src/ps_image.cxx @@ -277,7 +277,7 @@ void Fl_PostScript_Graphics_Driver::draw_scaled_image(Fl_Draw_Image_Cb call, voi } else if (mask && lang_level_ == 2) { level2_mask = 1; // use method for drawing masked color image with PostScript level 2 - fprintf(output, "%d %d pixmap_size\n pixmap_loadmask\n", iw, ih); + fprintf(output, " %g %g %g %g %d %d pixmap_plot\n", x, y, w, h, iw, ih); } else { fprintf(output, "%g %g %g %g %i %i %s CII\n", x , y+h , w , -h , iw , ih, interpol); @@ -291,38 +291,36 @@ void Fl_PostScript_Graphics_Driver::draw_scaled_image(Fl_Draw_Image_Cb call, voi uchar *curmask=mask; if(level2_mask) { - for (j = ih - 1; j >= 0; j--) { - curmask = mask + j * my/ih * ((mx+7)/8); - for(k=0; k < my/ih; k++) { // output mask data - for (i=0; i < ((mx+7)/8); i++) { - fprintf(output, "%.2x",swap_byte(*curmask)); - curmask++; - } - fprintf(output,"\n"); - } - } - fprintf(output,"pop def\n\npixmap_loaddata\n"); for (j = ih - 1; j >= 0; j--) { // output full image data - call(data,0,j,iw,rgbdata); - uchar *curdata=rgbdata; - for(i=0 ; i\n", output); + for (j = ih - 1; j >= 0; j--) { // output mask data + curmask = mask + j * (my/ih) * ((mx+7)/8); + for (k=0; k < my/ih; k++) { + for (i=0; i < ((mx+7)/8); i++) { + if (!(i%40)) fputs("\n", output); + fprintf(output, "%.2x",swap_byte(*curmask)); + curmask++; + } + fputs("\n", output); } - fprintf(output,"pop def\n\n%g %g pixmap_plot\n", x, y); // draw the masked image } + fputs(">\n", output); + } else { for (j=0; j 2) { // InterleaveType 2 mask data - for(k=0; k\n"); + fputs(">\n", output); } fprintf(output,"restore\n"); -- cgit v1.2.3