home *** CD-ROM | disk | FTP | other *** search
- %!
- %%Title: (TMSLevel2Separation)
- %%Version: 1.0
- %%Copyright: ((C) OneVision GmbH, Regensburg All Rights Reserved)
-
- 100 dict begin
-
- currentpacking true setpacking
-
- %% there is a bug in the windowserver. It does not return the
- %% current pattern when the underlying colorspace is separation or indexed
- systemdict /nextimage known
- { /_CurPatGstate 3 dict def
- _CurPatGstate begin
- /gsavelevel 0 def
- /stack 10 array def
- end
- /currentcolor
- { currentcolor
- currentcolorspace 0 get /Pattern eq
- { dup type /dicttype ne
- {_CurPatGstate /stack get _CurPatGstate /gsavelevel get get}
- if
- } if
- } hardbind def
- /setcolor
- { currentcolorspace 0 get /Pattern eq
- {dup _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put}
- if
- setcolor
- } hardbind def
- /setpattern
- { currentcolorspace 0 get /Pattern ne {[/Pattern currentcolorspace] setcolorspace} if
- setcolor
- } hardbind def
- /gsave
- { gsave
- _CurPatGstate /stack get _CurPatGstate /gsavelevel get get
- _CurPatGstate /gsavelevel _CurPatGstate /gsavelevel get 1 add put
- _CurPatGstate /stack get length _CurPatGstate /gsavelevel get le
- { _CurPatGstate /stack get dup length 10 add array
- _CurPatGstate /stack 2 index put copy pop
- _CurPatGstate /stack get dup length 10 sub
- 10 {2 copy null put 1 add} repeat pop pop
- } if
- _CurPatGstate /stack get _CurPatGstate /gsavelevel get 3 -1 roll put
- } hardbind def
- /grestore
- { _CurPatGstate /gsavelevel _CurPatGstate /gsavelevel get 1 sub put
- grestore
- } hardbind def
- /nulldevice
- { 0 0 0 0 Nonretained window dup windowdeviceround termwindow
- } hardbind def
- } if
-
- /_ProcessColorNames 4 dict def
- _ProcessColorNames begin
- /Cyan 0 def
- /Magenta 1 def
- /Yellow 2 def
- /Black 3 def
- end
-
- /CurrentSeparation /None def
- /currentseparation {CurrentSeparation} def
- /setseparation
- { dup type /nametype ne {cvn} if
- TMSLevel2Separation /CurrentSeparation 3 -1 roll put
- } bind def
- /isprocessseparation
- { _ProcessColorNames currentseparation known
- currentseparation /_CMY eq or
- } bind def
- /isprocessblack {currentseparation /Black eq} bind def
-
- /currentcolorspaceNoPattern
- { currentcolorspace dup 0 get /Pattern eq {1 get} if
- } hardbind def
- /_MayPaint
- { currentcolorspaceNoPattern dup type /arraytype eq {0 get} if /Separation eq
- currentoverprint
- { {currentcolorspaceNoPattern 1 get dup /All eq {pop true} {currentseparation eq} ifelse}
- {isprocessseparation}
- ifelse
- }
- {{currentcolorspaceNoPattern 1 get /None ne} {true} ifelse}
- ifelse
- } hardbind def
- /_sepdict 8 dict def
- _sepdict begin
- /DeviceGray
- { isprocessblack not {{pop 1} settransfer} if
- } bind def
- /DeviceRGB
- { isprocessseparation
- {currentcolor NXCalibratedRGBColorSpace setcolorspace setcolor}
- {{pop 1} settransfer} ifelse
- } bind def
- /DeviceCMYK
- { isprocessseparation
- { currentcolor
- currentseparation /_CMY eq
- {pop 0}
- { 4 _ProcessColorNames currentseparation get neg roll
- 3 {pop} repeat 3 {0} repeat
- 4 _ProcessColorNames currentseparation get roll
- }
- ifelse
- setcolor
- }
- {{pop 1} settransfer} ifelse
- } bind def
- /CIEBasedABC
- { isprocessseparation not
- {{pop 1} settransfer} if
- } bind def
- /CIEBasedA
- { isprocessseparation not
- {{pop 1} settransfer} if
- } bind def
- /Pattern
- { mark currentcolor
- dup /PaintType get 2 eq
- { count 1 roll
- currentcolorspace 1 get setcolorspace setcolor separate
- currentcolor count -1 roll setpattern
- }
- {pop}
- ifelse
- cleartomark
- } hardbind def
- /_indexedActionDict 5 dict def
- _indexedActionDict begin
- /DeviceGray
- { isprocessblack not {{pop 1} settransfer} if
- } bind def
- /DeviceRGB
- { isprocessseparation
- { currentcolor
- [currentcolorspace aload pop 3 -1 roll pop NXCalibratedRGBColorSpace 3 1 roll]
- setcolorspace setcolor
- }
- {{pop 1} settransfer} ifelse
- } bind def
- /DeviceCMYK
- { isprocessseparation
- { currentcolor
- [currentcolorspace aload pop
- [exch dup xcheck
- {/exec cvx} {{exch 4 mul 4 getinterval {255 div} forall} /exec cvx} ifelse
- currentseparation /_CMY eq
- {/pop cvx 0}
- {4 _ProcessColorNames currentseparation get neg /roll cvx
- 3 {pop} /repeat cvx 3 {0} /repeat cvx
- 4 _ProcessColorNames currentseparation get /roll cvx
- }
- ifelse
- ] cvx bind
- ]
- setcolorspace setcolor
- }
- {{pop 1} settransfer} ifelse
- } bind def
- /CIEBasedABC
- { isprocessseparation not
- {{pop 1} settransfer} if
- } bind def
- /CIEBasedA
- { isprocessseparation not
- {{pop 1} settransfer} if
- } bind def
- end
- /Indexed
- { _indexedActionDict currentcolorspace 1 get dup type /arraytype eq {0 get} if get exec
- } hardbind def
- /_separationProcDict 1 dict def
- _separationProcDict begin
- /Cyan {{0 0 0}} bind def
- /Magenta {{0 0 0 4 1 roll}} bind def
- /Yellow {{0 0 0 4 2 roll}} bind def
- /Black {{0 0 0 4 3 roll}} bind def
- /All {currentseparation /_CMY eq {{dup dup 0}} {{0 0 0 4 3 roll}} ifelse} bind def
- end
- /Separation
- { currentcolorspace 1 get /All ne
- { currentseparation /_CMY eq
- {_ProcessColorNames currentcolorspace 1 get known currentcolorspace 1 get /Black ne and not}
- {currentseparation currentcolorspace 1 get ne}
- ifelse
- {{pop 1} settransfer} if
- } if
- currentcolor
- [ currentcolorspace aload pop pop pop
- /DeviceCMYK _separationProcDict 2 index known
- {_separationProcDict 2 index get exec}
- {{0 0 0 4 3 roll}}
- ifelse
- ]
- setcolorspace setcolor
- } hardbind def
- end
- /separate {_sepdict currentcolorspace 0 get get exec} hardbind def
- /PaintExecute
- { gsave mark {{} settransfer} stopped
- {cleartomark true} {cleartomark false} ifelse grestore
- {exec}
- { gsave
- _MayPaint not {nulldevice} if separate exec
- {currentpoint} stopped
- grestore {newpath} {moveto} ifelse
- }
- ifelse
- } hardbind def
-
- /defIfKnown {1 index where {pop hardbind def} {pop pop} ifelse} hardbind def
-
- /fill {{fill} PaintExecute} hardbind def
- /eofill {{eofill} PaintExecute} hardbind def
- /stroke {{stroke} PaintExecute} hardbind def
- /ufill {{ufill} PaintExecute} defIfKnown
- /ueofill {{ueofill} PaintExecute} defIfKnown
- /ustroke {{ustroke} PaintExecute} defIfKnown
- /rectfill {{rectfill} PaintExecute} defIfKnown
- /rectstroke {{rectstroke} PaintExecute} defIfKnown
-
- /show {{show} PaintExecute} hardbind def
- /ashow {{ashow} PaintExecute} hardbind def
- /widthshow {{widthshow} PaintExecute} hardbind def
- /awidthshow {{awidthshow} PaintExecute} hardbind def
- /kshow {{kshow} PaintExecute} hardbind def
- /glyphshow {{glyphshow} PaintExecute} defIfKnown
- /xshow {{xshow} PaintExecute} defIfKnown
- /yshow {{yshow} PaintExecute} defIfKnown
- /xyshow {{xyshow} PaintExecute} defIfKnown
-
- /colorimageDict 8 dict def
- colorimageDict begin
- /DeviceGray /image load def
- /DeviceRGB /image load def
- /DeviceCMYK
- { isprocessseparation
- { 1 dict copy begin
- [ /Decode load aload pop
- currentseparation /_CMY eq
- {pop pop 0 0}
- { 8 _ProcessColorNames currentseparation get 2 mul neg roll
- 6 {pop} repeat 6 {0} repeat
- 8 _ProcessColorNames currentseparation get 2 mul roll
- }
- ifelse
- ] /Decode exch def
- currentdict end
- } if
- image
- } hardbind def
- /CIEBasedABC /image load def
- /CIEBasedA /image load def
- /Pattern /image load def
- /Indexed /image load def
- /Separation /image load def
- end
- /image
- { gsave
- dup type /dicttype ne {/DeviceGray setcolorspace} if
- colorimageDict currentcolorspace 0 get get PaintExecute
- grestore
- } hardbind def
- /colorimage
- { gsave {/DeviceGray null /DeviceRGB /DeviceCMYK} 1 index 1 sub get setcolorspace
- exch {array astore dup length true} {false} ifelse exch [exch {0 1} repeat]
- 8 dict begin 1
- {/ImageType /Decode /MultipleDataSources /DataSource /ImageMatrix /BitsPerComponent
- /Height /Width} {exch def} forall
- currentdict end image
- grestore
- } hardbind def
- /imagemask {{imagemask} PaintExecute} hardbind def
- /nextimage {{nextimage} PaintExecute} hardbind def
-
-
- /nxsetgray {setgray} def
- /_NXSetCMYKOrRGB {pop pop pop setcmykcolor} hardbind def
- /_NXCalibratedImageDict 8 dict def
- /_NXCalibratedImage
- { exch {array astore dup length true} {false} ifelse
- 8 -1 roll {NXCalibratedRGBColorSpace setcolorspace} if
- exch currentcolorspace 0 get /Indexed eq
- {pop [0 currentcolorspace 2 get]} {[exch {0 1} repeat]} ifelse
- _NXCalibratedImageDict begin 1
- {/ImageType /Decode /MultipleDataSources /DataSource /ImageMatrix /BitsPerComponent
- /Height /Width} {exch def} forall
- currentdict end image
- } hardbind def
-
- /setcolorrendering
- { dup /RenderTable known
- { dup /RenderTable get 4 get 4 eq
- { isprocessseparation
- { 1 dict copy begin
- [ /RenderTable load aload pop
- currentseparation /_CMY eq
- {pop {pop 0}}
- { 4 _ProcessColorNames currentseparation get neg roll
- 3 {pop} repeat {pop 0} dup dup
- 4 _ProcessColorNames currentseparation get roll
- }
- ifelse
- ] /RenderTable exch def
- currentdict end
- } if
- setcolorrendering
- }
- {pop} ifelse
- }
- {pop} ifelse
- } hardbind def
-
- /windowdeviceround
- { windowdeviceround
- false setcmykadjust
- {} dup dup dup setcolortransfer
- /OVDefaultRendering load setcolorrendering
- } hardbind def
-
- /setgstate
- { setgstate
- false setcmykadjust
- {} dup dup dup setcolortransfer
- /OVDefaultRendering load setcolorrendering
- } hardbind def
-
- setpacking
-
- currentdict end /TMSLevel2Separation exch def
-