summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-blur/pst-blur.tex
blob: 900ab6a7796820201bc520a1e84278a060b7e30b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
%%
%% This is file `pst-blur.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pst-blur.dtx  (with options: `texfile')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pst-blur.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pst-blur.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% $Id: pst-blur.dtx,v 2.0 2005/09/08 09:48:33 giese Exp $
%%
%% Copyright 1998-2007 Martin Giese, mgiese@risc.uni-linz.ac.at
%%                     Herbert Voss, voss@pstricks.de
%%
%% This file is under the LaTeX Project Public License
%% See CTAN archives in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-blur' is a PSTricks package for blurred shadows
%%
\csname PstBlurLoaded\endcsname
\let\PstBlurLoaded\endinput
\ifx\PSTricksLoaded\endinput\else
  \def\next{\input pstricks.tex }\expandafter\next
\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%%
\def\fileversion{2.0}
\def\filedate{2005/09/08}
\message{ v\fileversion, \filedate}
\edef\TheAtCode{\the\catcode`\@}
\catcode`\@=11
\pst@addfams{pst-blur}
\pstheader{pst-blur.pro}
\newif\ifpsblur
\define@key[psset]{pst-blur}{blur}[true]{\@nameuse{psblur#1}\pst@setrepeatarrowsflag}
\psset{blur=false}
%%
\define@key[psset]{pst-blur}{blurradius}{\pst@getlength{#1}\psx@blurradius}
\psset{blurradius=1.5pt}
%%
\define@key[psset]{pst-blur}{blursteps}{\pst@getint{#1}\psx@blursteps}
\psset{blursteps=20}
%%
\define@key[psset]{pst-blur}{blurbg}{\pst@getcolor{#1}\psx@blurbg}
\psset{blurbg=white}
\def\pst@closedshadow{%
\ifpsblur\pst@blurclosedshadow\else\pst@sharpclosedshadow\fi
}
\def\pst@sharpclosedshadow{%
  \addto@pscode{%
    gsave
    \psk@shadowsize \psk@shadowangle \tx@PtoC
    \tx@Shadow
    \pst@usecolor\psshadowcolor
    gsave fill grestore
    stroke
    grestore
    gsave
    \pst@usecolor\psfillcolor
    gsave fill grestore
    stroke
    grestore}}
\def\pst@blurclosedshadow{%
  \addto@pscode{%
    gsave
    gsave \pst@usecolor\psshadowcolor currentrgbcolor grestore
    gsave \pst@usecolor\psx@blurbg currentrgbcolor grestore
    \psx@blurradius\space
    \psx@blursteps\space
    \psk@shadowsize \psk@shadowangle \tx@PtoC
    tx@PstBlurDict begin BlurShadow end
    grestore
    gsave
    \pst@usecolor\psfillcolor
    gsave fill grestore
    stroke
    grestore}}
\def\psblurbox{%
\def\pst@par{}\pst@object{psblurbox}}
\def\psblurbox@i{\pst@makebox\psblurbox@ii}
\def\psblurbox@ii{%
  \begingroup
  \pst@useboxpar
  \psblurtrue
  \psshadowtrue
  \psboxseptrue
  \setbox\pst@hbox=\hbox{\psframebox@ii}%
  \pst@dimh=\psk@shadowsize\p@
  \pst@dimh=.7071\pst@dimh
  \advance\pst@dimh\psx@blurradius\p@
  \pst@dimg=\dp\pst@hbox
  \advance\pst@dimg\pst@dimh
  \dp\pst@hbox=\pst@dimg
  \pst@dimg=\wd\pst@hbox
  \advance\pst@dimg\pst@dimh
  \wd\pst@hbox=\pst@dimg
  \leavevmode
  \box\pst@hbox
\endgroup}
%%
\catcode`\@=\TheAtCode\relax
\endinput
%%
%% End of file `pst-blur.tex'.