summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/prosper/contrib/img/bouleverte-fondblanc.eps
blob: ee0937608e3630b3ed2fd0085f2bf60b36c44b28 (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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
%!PS-Adobe-2.0 EPSF-2.0
%%Creator: Fait main par Jean-Yves Burlett <jean-yves@burlett.org>
%%BoundingBox: 68 63 168 133
%%Pages: 1
%%EndComments
%%EndProlog

%%Page: 1 1

% on sauve tout
/origstate save def

% on fait nos conneries dans notre \_°< ,( coin )
42 dict begin

%% --------------------------------------------------
%%			C O N F I G 

  /rayonboule 30 def 
  % ^^^ penser à modifier la boundingbox après avoir modifié ça

  /brillantboule { .8 1 .8 } def
  /sombreboule { .2 .6 .2 } def
  /couleurfond { 
    1 1 1 
  } def
  /sombritudeombre { 
    0 0 0 
  } def

%% --------------------------------------------------

%%%%%% Fonctions qui servent

  /dup2 {
    dup 3 2 roll dup 4 1 roll exch
  } def

  % params i0 if maxiter numiter
  /onedstep {
    1 sub exch 1 sub
    4 2 roll exch dup 3 1 roll sub % ni-1 mi-1 i0 iD
    4 -1 roll mul 3 -1 roll % i0 ni-1*iD mi-1
    dup 0 eq { pop pop 0 } { div } ifelse 
    add % I
  } def

  % params x0 y0 xf yf maxiter numiter
  /twodstep {
    dup2 8 5 roll exch 8 -3 roll % mi ni x0 xf y0 yf mi ni
    onedstep 5 1 roll 4 2 roll % Y x0 xf mi ni
    onedstep exch
  } def

  % params r0 g0 b0 rf gf bf maxiter numiter
  /threedstep {
    dup2 10 2 roll 5 -1 roll 10 1 roll twodstep % rf mi ni r0 C2 C3
    6 2 roll 4 1 roll onedstep 3 1 roll % C1 C2 C3
  } def

  % params x0 y0 xf yf col0 colf t0 tf nbiter
  /disquegrad {
    43 dict begin % <- c'est un peu de l'abus mais bon ...
      gsave
	/nbiter exch def
	/tf exch def
	/t0 exch def
	/colfb exch def
	/colfg exch def
	/colfr exch def
	/col0b exch def
	/col0g exch def
	/col0r exch def
	/yf exch def
	/xf exch def
	/y0 exch def
	/x0 exch def

	1 1 nbiter {
	  gsave
	    newpath
	    dup dup
	    col0r col0g col0b colfr colfg colfb 
	    nbiter 8 -1 roll threedstep
	    setrgbcolor
	    x0 y0 xf yf nbiter 6 -1 roll twodstep
	    t0 tf nbiter 6 -1 roll onedstep 0 360 arc 
	    fill
	  grestore
	} for
      grestore
    end
  } def

%%%%%%%%% Zou !

  %   gsave
    %     1 0 0 setrgbcolor
    %     newpath
    %     68 63 moveto
    %     168 63 lineto
    %     168 133 lineto
    %     68 133 lineto
    %     68 63 lineto
    %     stroke
    %   grestore

    100 100 translate

    % -- fond
    %   gsave
      %     couleurfond setrgbcolor
      %     newpath
      %     -50 -50 moveto
      %     100 0 rlineto
      %     0 100 rlineto
      %     -100 0 rlineto
      %     0 -100 rlineto
      %     fill
      %   grestore

      % -- pseudo anti-alias
      gsave
	couleurfond 
	1 1 3 { pop .8 mul 3 1 roll } for
	setrgbcolor
	0 0 rayonboule 2 add 0 360 arc fill 
      grestore

      % -- ombre
      gsave
	rayonboule -3 div rayonboule neg translate
	1 .1 scale
	rayonboule 0 rayonboule 0
	couleurfond
	1 1 3 { pop .8 mul 3 1 roll } for
	sombritudeombre
	rayonboule 1.84 mul
	rayonboule .84 mul
	5 disquegrad
      grestore

      % -- remplissage
      gsave 

	% -- masquage du remplissage dans la boule
	newpath
	0 0 rayonboule 0 360 arc 
	clip

	30 rotate

	% -- hop ! un dégradé !
	0 0 
	0 rayonboule 1.36 div 
	sombreboule
	brillantboule
	rayonboule 5 
	20 disquegrad

	1.2 1 scale
      grestore

      % -- bord noir autour
      gsave
	newpath
	0 setgray
	0 0 30 0 360 arc stroke
      grestore

    end

    origstate restore

%%Trailer