summaryrefslogtreecommitdiff
path: root/src/Fl_PostScript.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-03-01 12:11:52 +0000
committerManolo Gouy <Manolo>2015-03-01 12:11:52 +0000
commit966ca9faa3ea0ae97a081e933852cb6839bfd38c (patch)
treeebcb34e82849e241fa4b268e31c79796ba9aec84 /src/Fl_PostScript.cxx
parent00a7e2d576cb744614989050995ab6c371753d7b (diff)
PostScript output of images: use now RunLengthEncode followed by ASCII85Encode filters.
This is what Mac OS X does for its PostScript output, so there must be some good in that. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10597 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_PostScript.cxx')
-rw-r--r--src/Fl_PostScript.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Fl_PostScript.cxx b/src/Fl_PostScript.cxx
index da805bd84..7262d7dd2 100644
--- a/src/Fl_PostScript.cxx
+++ b/src/Fl_PostScript.cxx
@@ -236,13 +236,15 @@ static const char * prolog =
"/GL { setgray } bind def\n"
"/SRGB { setrgbcolor } bind def\n"
+"/A85RLE { /ASCII85Decode filter /RunLengthDecode filter } bind def\n" // ASCII85Decode followed by RunLengthDecode filters
+
// color images
"/CI { GS /py exch def /px exch def /sy exch def /sx exch def\n"
"translate \n"
"sx sy scale px py 8 \n"
"[ px 0 0 py neg 0 py ]\n"
-"currentfile /ASCII85Decode filter\n false 3"
+"currentfile A85RLE\n false 3"
" colorimage GR\n"
"} bind def\n"
@@ -254,7 +256,7 @@ static const char * prolog =
"[ px 0 0 py neg 0 py ]\n"
-"currentfile /ASCII85Decode filter\n"
+"currentfile A85RLE\n"
"image GR\n"
"} bind def\n"
@@ -264,7 +266,7 @@ static const char * prolog =
"translate \n"
"sx sy scale px py true \n"
"[ px 0 0 py neg 0 py ]\n"
-"currentfile filtername filter\n"
+"currentfile filtername\n"
"imagemask GR\n"
"} bind def\n"
@@ -315,7 +317,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCII85Decode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
"/Decode [ 0 1 0 1 0 1 ] def\n"
@@ -335,7 +337,7 @@ static const char * prolog_2 = // prolog relevant only if lang_level >1
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCII85Decode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
"/Decode [ 0 1 ] def\n"
@@ -440,7 +442,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level ==
"pixmap_w pixmap_h scale "
"pixmap_sx pixmap_sy 8 "
"pixmap_mat "
-"currentfile /ASCII85Decode filter "
+"currentfile A85RLE "
"false 3 "
"colorimage "
"end "
@@ -458,7 +460,7 @@ static const char * prolog_2_pixmap = // prolog relevant only if lang_level ==
"pixmap_sx pixmap_sy\n"
"true\n"
"pixmap_mat\n"
-"currentfile /ASCII85Decode filter\n"
+"currentfile A85RLE\n"
"imagemask\n"
"GR\n"
"} bind def\n"
@@ -480,7 +482,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCII85Decode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
@@ -521,7 +523,7 @@ static const char * prolog_3 = // prolog relevant only if lang_level >2
"/Height py def\n"
"/BitsPerComponent 8 def\n"
"/Interpolate inter def\n"
-"/DataSource currentfile /ASCII85Decode filter def\n"
+"/DataSource currentfile A85RLE def\n"
"/MultipleDataSources false def\n"
"/ImageMatrix [ px 0 0 py neg 0 py ] def\n"
@@ -1106,7 +1108,7 @@ static void transformed_draw_extra(const char* str, int n, double x, double y, i
delete[] img;
// write the string image to PostScript as a scaled bitmask
scale = w2 / float(w);
- driver->clocale_printf("%g %g %g %g %d %d /ASCIIHexDecode MI\n", x, y - h*0.77/scale, w2/scale, h/scale, w2, h);
+ driver->clocale_printf("%g %g %g %g %d %d {/ASCIIHexDecode filter} MI\n", x, y - h*0.77/scale, w2/scale, h/scale, w2, h);
uchar *di;
int wmask = (w2+7)/8;
for (int j = h - 1; j >= 0; j--){