summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-10-14 00:08:06 +0000
committerKarl Berry <karl@freefriends.org>2008-10-14 00:08:06 +0000
commitdd666ba9d1d0d19c4331d45a0b0c99919f8acbc4 (patch)
tree56ccc6d435e5687e5c14bc455294529064edc91f /Master/texmf-dist/dvips
parentbbf57f78a6acd818c39f6459e64afca17e9962f4 (diff)
pstricks-add 0.21/3.11 (13oct08)
git-svn-id: svn://tug.org/texlive/trunk@10962 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro46
1 files changed, 39 insertions, 7 deletions
diff --git a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
index 43bce4de57c..4bdeba0acad 100644
--- a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
+++ b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
@@ -1,6 +1,6 @@
-%% $Id: pstricks-add.pro 23 2008-05-15 21:51:18Z herbert $
+%% $Id: pstricks-add.pro 49 2008-10-13 10:59:27Z herbert $
% PostScript prologue for pstricks-add.tex.
-% Version 0.20, 2008/01/01
+% Version 0.21, 2008/10/15
% For distribution, see pstricks.tex.
%
% HISTORY -> see file Changes
@@ -27,13 +27,13 @@
/ShadingType 4 % single Gouraud
/ColorSpace [ /DeviceRGB ]
/DataSource ds
- >>
+ >>
shfill
closepath
mtrx
setmatrix grestore} def
%
-/RGBtoCMYK { % on stack r g b
+/RGBtoCMYK { % on stack r g b -> C M Y K
3 dict begin
/Blue ED /Green ED /Red ED
1 Red sub % Cyan
@@ -43,7 +43,7 @@
end
} def
%
-/CMYKtoGRAY { % c m y k on stack
+/CMYKtoGRAY { % on stack c m y k -> gray
exch 0.11 mul add
exch 0.59 mul add
exch 0.3 mul add
@@ -51,7 +51,7 @@
neg 1 add
} def
%
-/RGBtoGRAY {
+/RGBtoGRAY { % on stack r g b -> gray
0.11 mul
exch 0.59 mul add
exch 0.3 mul add
@@ -164,8 +164,40 @@
end
} bind def
%
+%%%%% ### bubblesort ###
+%% syntax : array bubblesort --> array2 trie par ordre croissant
+%% code de Bill Casselman
+%% http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/
+/bubblesort {
+4 dict begin
+ /a exch def
+ /n a length 1 sub def
+ n 0 gt {
+ % at this point only the n+1 items in the bottom of a remain to
+ % the sorted largest item in that blocks is to be moved up into
+ % position n
+ n {
+ 0 1 n 1 sub {
+ /i exch def
+ a i get a i 1 add get gt {
+ % if a[i] > a[i+1] swap a[i] and a[i+1]
+ a i 1 add
+ a i get
+ a i a i 1 add get
+ % set new a[i] = old a[i+1]
+ put
+ % set new a[i+1] = old a[i]
+ put
+ } if
+ } for
+ /n n 1 sub def
+ } repeat
+ } if
+ a
+end
+} def
+%
end
%
% END pstricks-add.pro
-