summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def')
-rw-r--r--Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def109
1 files changed, 109 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def b/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def
new file mode 100644
index 00000000000..b45b779e003
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-dvips.def
@@ -0,0 +1,109 @@
+%--------------------------------------------
+% $Header: /cvsroot/pgfplots/pgfplots/generic/pgfplots/sys/pgflibrarysurfshading.pgfsys-dvips.def,v 1.1 2009/06/11 07:14:52 ludewich Exp $
+%
+% Package pgfplots
+%
+% Provides a user-friendly interface to create function plots (normal
+% plots, semi-logplots and double-logplots).
+%
+% It is based on Till Tantau's PGF package.
+%
+% Copyright 2007/2008 by Christian Feuersänger.
+%
+% This program is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+%--------------------------------------------
+
+
+\def\pgfplotslibrarysurf@initstream{%
+ \if\pgfplotslibrarysurf@bytespercoordinate4%
+ \pgfplots@warning{************** The generated postscript file may not be compatible with all viewers. Consider using \string\pgfplotsset{surf shading/precision=postscript} for improved compatibility. Or: convert it to pdf, that will work correctly. **************}%
+ \fi
+ % binary doesn't work due to limitations of DVI.
+ % We NEED an ASCII encoding.
+ %
+ \def\pgfplotslibrarysurf@filter@encode{ASCIIHexEncode}%
+ \def\pgfplotslibrarysurf@filter@decode{ASCIIHexDecode}%
+}%
+
+% The lowlevel call for surface shadings. It uses a pattern type 2
+% dictionary as fill color and has thus several things to do.
+%
+% It appears the dvips implementation is simpler than the pdftex
+% implementation - I did not need to adjust the matrix (don't know
+% why).
+\def\pgfplotslibrarysurfdraw{%
+ \pgfpicture
+ \pgfplotssys@do@surfshading@fillpaths\pgfplots@loc@TMPa%
+ \global\let\pgfplots@glob@TMPa=\pgfplots@loc@TMPa
+ \pgfpathrectanglecorners
+ {\pgfplotslibrarysurf@corner@sw}
+ {\pgfplotslibrarysurf@corner@ne}%
+ \pgfusepath{fill}%
+ \endpgfpicture
+ \leavevmode% ??
+}
+
+% To be used inside of a pgfpicture.
+%
+% #1: a macro name. The contents of this macro needs to be written
+% into the pdf pattern dictionary contained in the pdf resources of
+% the current context. The current context is either the current page
+% or an xform object.
+%
+%
+\def\pgfplotssys@do@surfshading@fillpaths#1{%
+%http://www.ghostscript.com/pipermail/gs-devel/2002-September/005763.html
+%http://www.tek-tips.com/viewthread.cfm?qid=1183719&page=4
+% \pgf@process{\pgfpointdiff{\pgfplotslibrarysurf@corner@sw}{\pgfkeysvalueof{/pgfplots/surf shading/anchor}}}%
+% \pgf@sys@bp@correct\pgf@x%
+% \pgf@sys@bp@correct\pgf@y%
+ \pgfsys@invoke{%
+ <<
+ %/Type /Pattern
+ /PatternType 2
+ /Shading
+ <<
+ /ShadingType 5
+ /BitsPerCoordinate \pgfplotslibrarysurf@bitspercoordinate\space
+ /BitsPerComponent 16 % Note: this here is the reason why I can't use ASCII85Decode
+ /VerticesPerRow \pgfkeysvalueof{/pgfplots/surf shading/cols}
+ /ColorSpace /DeviceRGB
+ /Decode [\pgfplotslibrarysurf@decode]
+ /Function \pgfkeysvalueof{/pgfplots/surf shading/colormap}
+ /DataSource
+ currentfile
+ % direct binary output not possible: DVI
+ % doesn't support it (?)
+ %<< /EODCount \pgfplotslibrarysurf@binarystream@len\space /EODString () >> /SubFileDecode filter
+ % not completely implemented :
+ %/ASCII85Decode filter
+ % works:
+ /ASCIIHexDecode filter
+ /ReusableStreamDecode filter
+ \pgfplotslibrarysurf@binarystream
+ %\csname pgfp@bin@126\endcsname% tilde ~> is end-of-input indicator for ASCII85Decode
+ > % end-of-input indicator for ASCIIHexDecode
+ >>
+ >> [ 1 0 0 1 0 0 ] makepattern setpattern
+ % I don't know why I don't need the shifts here !? But it
+ % appears to work, so never mind.
+% >> [ 1 0 0 1 \pgf@sys@tonumber\pgf@x\space \pgf@sys@tonumber\pgf@y ] makepattern setpattern
+ % 'setpattern' is a shortcut for changing the colorspace and
+ % the color to pattern.
+ }%
+}
+
+\endinput
+% vi: ft=tex