diff options
author | Karl Berry <karl@freefriends.org> | 2007-07-28 00:35:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-07-28 00:35:14 +0000 |
commit | 11a36dc12d07d6957138e35f89401eee4bd9b4ba (patch) | |
tree | 20de6f425223f7722667fe1d83f5150fd8e2a1b5 /Master/texmf-dist/dvips | |
parent | 57814cd1a4f5be3ec8cb4211a58e34537f6b573c (diff) |
pst-grad 1.06 (11jul07)
git-svn-id: svn://tug.org/texlive/trunk@4677 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r-- | Master/texmf-dist/dvips/pst-grad/pst-grad.pro | 179 |
1 files changed, 116 insertions, 63 deletions
diff --git a/Master/texmf-dist/dvips/pst-grad/pst-grad.pro b/Master/texmf-dist/dvips/pst-grad/pst-grad.pro index e3d87c1bfd0..a988521c5d5 100644 --- a/Master/texmf-dist/dvips/pst-grad/pst-grad.pro +++ b/Master/texmf-dist/dvips/pst-grad/pst-grad.pro @@ -15,75 +15,106 @@ /tx@GradientDict 40 dict def tx@GradientDict begin /GradientFill { + /ifCMYK exch def % do we have rgb or cmyk? hv 1.06 rotate /MidPoint ED /NumLines ED - /LastBlue ED - /LastGreen ED - /LastRed ED - /FirstBlue ED - /FirstGreen ED -/FirstRed ED -% D.G. modification begin - Apr. 9, 1998 -/GradientPosY ED -/GradientPosX ED - /GradientScale ED - /ifGradientCircle ED -% D.G. modification end - % This avoids gaps due to rounding errors: - clip - pathbbox %leave llx,lly,urx,ury on stack -% D.G. modification begin - Apr. 10, 1998 - 4 copy /ury ED /urx ED /lly ED /llx ED -% D.G. modification end - /y ED /x ED -% D.G. modification begin - Apr. 10, 1998 -ifGradientCircle - {0 GradientPosX eq - {0 GradientPosX eq {2 copy translate} if} if} + ifCMYK { + /LastBlack ED % 1.06 + /LastYellow ED % 1.06 + /LastMagenta ED % 1.06 + /LastCyan ED % 1.06 + /FirstBlack ED % 1.06 + /FirstYellow ED % 1.06 + /FirstMagenta ED % 1.06 + /FirstCyan ED % 1.06 + }{ /LastBlue ED + /LastGreen ED + /LastRed ED + /FirstBlue ED + /FirstGreen ED + /FirstRed ED + } ifelse + /GradientPosY ED + /GradientPosX ED + /GradientScale ED + /ifGradientCircle ED + % This avoids gaps due to rounding errors: + clip + pathbbox %leave llx,lly,urx,ury on stack + 4 copy /ury ED /urx ED /lly ED /llx ED + /y ED /x ED + ifGradientCircle + { 0 GradientPosX eq { 0 GradientPosX eq {2 copy translate} if } if } {2 copy translate} ifelse -% D.G. modification end - y sub neg /y ED - x sub neg /x ED % This avoids gaps due to rounding errors: - LastRed FirstRed add 2 div - LastGreen FirstGreen add 2 div - LastBlue FirstBlue add 2 div + y sub neg /y ED + x sub neg /x ED % This avoids gaps due to rounding errors: + ifCMYK { % 1.06 + LastCyan FirstCyan add 2 div % 1.06 + LastMagenta FirstMagenta add 2 div % 1.06 + LastYellow FirstYellow add 2 div % 1.06 + LastBlack FirstBlack add 2 div % 1.06 + setcmykcolor % 1.06 + }{ + LastRed FirstRed add 2 div + LastGreen FirstGreen add 2 div + LastBlue FirstBlue add 2 div setrgbcolor -% D.G. modification begin - Jul. 23, 1997 / Apr. 9, 1998 - ifGradientCircle - {/YSizePerLine y NumLines div def - /CurrentY y 2 div def - /MidLine NumLines 2 div 1 MidPoint sub mul abs cvi def} - {fill - /YSizePerLine y NumLines div def - /CurrentY 0 def - /MidLine NumLines 1 MidPoint sub mul abs cvi def} ifelse -% DG modification end - MidLine NumLines 2 sub gt - { /MidLine NumLines def } - { MidLine 2 lt { /MidLine 0 def } if } - ifelse - MidLine 0 gt - { + } ifelse + ifGradientCircle + { /YSizePerLine y NumLines div def + /CurrentY y 2 div def + /MidLine NumLines 2 div 1 MidPoint sub mul abs cvi def + }{ + fill + /YSizePerLine y NumLines div def + /CurrentY 0 def + /MidLine NumLines 1 MidPoint sub mul abs cvi def + } ifelse + MidLine NumLines 2 sub gt + { /MidLine NumLines def } + { MidLine 2 lt { /MidLine 0 def } if } ifelse + MidLine 0 gt { + ifCMYK { + /Cyan FirstCyan def + /Magenta FirstMagenta def + /Yellow FirstYellow def + /Black FirstBlack def + /CyanIncrement LastCyan FirstCyan sub MidLine 1 sub div def + /MagentaIncrement LastMagenta FirstMagenta sub MidLine 1 sub div def + /YellowIncrement LastYellow FirstYellow sub MidLine 1 sub div def + /BlackIncrement LastBlack FirstBlack sub MidLine 1 sub div def + }{ /Red FirstRed def - /Green FirstGreen def - /Blue FirstBlue def + /Green FirstGreen def + /Blue FirstBlue def /RedIncrement LastRed FirstRed sub MidLine 1 sub div def /GreenIncrement LastGreen FirstGreen sub MidLine 1 sub div def /BlueIncrement LastBlue FirstBlue sub MidLine 1 sub div def - MidLine { GradientLoop } repeat - } if - MidLine NumLines lt - { + } ifelse + MidLine { GradientLoop } repeat + } if + MidLine NumLines lt { + ifCMYK { + /Cyan LastCyan def + /Magenta LastMagenta def + /Yellow LastYellow def + /Black LastBlack def + /CyanIncrement FirstCyan LastCyan sub NumLines MidLine sub 1 sub div def + /MagentaIncrement FirstMagenta LastMagenta sub NumLines MidLine sub 1 sub div def + /YellowIncrement FirstYellow LastYellow sub NumLines MidLine sub 1 sub div def + /BlackIncrement FirstBlack LastBlack sub NumLines MidLine sub 1 sub div def + }{ /Red LastRed def - /Green LastGreen def - /Blue LastBlue def + /Green LastGreen def + /Blue LastBlue def /RedIncrement FirstRed LastRed sub NumLines MidLine sub 1 sub div def /GreenIncrement FirstGreen LastGreen sub NumLines MidLine sub 1 sub div def /BlueIncrement FirstBlue LastBlue sub NumLines MidLine sub 1 sub div def - NumLines MidLine sub { GradientLoop } repeat } - if - } def/GradientLoop { + } ifelse + NumLines MidLine sub { GradientLoop } repeat + } if +} def/GradientLoop { % D.G. modification begin - Jul. 23, 1997 / Apr. 9, 1998 ifGradientCircle {CurrentY 0 gt { @@ -92,15 +123,37 @@ ifGradientCircle {/GradientPosX urx llx sub 2 div def /GradientPosY ury lly sub 2 div def} if} if GradientPosX GradientPosY CurrentY GradientScale mul 0 360 arc - Red Green Blue setrgbcolor fill + ifCMYK { Cyan Magenta Yellow Black setcmykcolor } + { Red Green Blue setrgbcolor } ifelse + fill /CurrentY CurrentY YSizePerLine sub def - /Blue Blue BlueIncrement add def - /Green Green GreenIncrement add def - /Red Red RedIncrement add def} if} {0 CurrentY moveto x 0 rlineto + ifCMYK { + /Cyan Cyan CyanIncrement add def + /Magenta Magenta MagentaIncrement add def + /Yellow Yellow YellowIncrement add def + /Black Black BlackIncrement add def + }{ + /Blue Blue BlueIncrement add def + /Green Green GreenIncrement add def + /Red Red RedIncrement add def + } ifelse + } if } { 0 CurrentY moveto x 0 rlineto 0 YSizePerLine rlineto x neg 0 rlineto closepath - Red Green Blue setrgbcolor fill /CurrentY CurrentY YSizePerLine add def - /Blue Blue BlueIncrement add def /Green Green GreenIncrement add def - /Red Red RedIncrement add def} ifelse% D.G. modification end + ifCMYK { Cyan Magenta Yellow Black setcmykcolor } + { Red Green Blue setrgbcolor } ifelse + fill + /CurrentY CurrentY YSizePerLine add def + ifCMYK { + /Cyan Cyan CyanIncrement add def + /Magenta Magenta MagentaIncrement add def + /Yellow Yellow YellowIncrement add def + /Black Black BlackIncrement add def + }{ + /Blue Blue BlueIncrement add def + /Green Green GreenIncrement add def + /Red Red RedIncrement add def + } ifelse + } ifelse% D.G. modification end }def % /GradientFillHSB { % hv 2006-11-04 |