home *** CD-ROM | disk | FTP | other *** search
- %!
- %%Title: (1VISION (R) Separation Operators)
- %%Version: 1.2
- %%Copyright: ((C) OneVision GmbH, Regensburg All Rights Reserved)
-
- currentpacking true setpacking
- /_TMSVars where {pop userdict /undoSaveToken save put} {} ifelse
-
- /_ProcessColorNames 4 dict def
- _ProcessColorNames begin
- /Cyan 0 def
- /Magenta 1 def
- /Yellow 2 def
- /Black 3 def
- end
-
- /_TMSVars 40 dict def
-
- /currentseparationcolorspace {_TMSVars /CurrentSeparationColorSpace get} hardbind def
- /currentseparation {_TMSVars /CurrentSeparation get} hardbind def
- /setseparationcolorspace % [/Separation name base tinttransform] setseparationcolorspace
- { _TMSVars /CurrentSeparationColorSpace 3 -1 roll put
- _TMSVars /CurrentSeparation currentseparationcolorspace 1 get cvn put
- _ProcessColorNames currentseparation known
- {_ProcessColorNames currentseparation get} {4} ifelse
- _TMSVars exch /channel exch put
- mark {systemdict /currentwindow get exec} stopped
- {_TMSVars /CurrentSeparationColorSpace [/Separation /Dummy /DeviceGray {1 exch sub}] put} if
- cleartomark
- } hardbind def
-
- _TMSVars begin
-
- %%%%% color emulation
- /setcomponent {currentseparationcolorspace setcolorspace setcolor} hardbind def
- /channel 0 def
- /RenderTable 4 array def
- /_rendervalueforRGB %% assumes context of _TMSVars
- { channel 3 le
- { 3
- { 3 -1 roll 25 mul dup cvi
- exch 1 index 25 lt {1 index sub} {pop 1 sub 1} ifelse exch
- 4 1 roll
- }
- repeat
- 6 -1 roll 26 mul 6 -1 roll add 26 mul 5 -1 roll add
- RenderTable channel get
- /mat0 1 index 3 index get def
- /mat1 1 index 3 index 676 add get def
- /mat2 1 index 3 index 26 add get def
- /mat3 1 index 3 index 1 add get def
- /mat4 1 index 3 index 702 add get def
- /mat5 1 index 3 index 677 add get def
- /mat6 1 index 3 index 27 add get def
- /mat7 1 index 3 index 703 add get def
- pop pop
- /mat1 mat1 mat0 sub def
- /mat4 mat4 mat2 sub mat1 sub def
- /mat7 mat7 mat6 sub mat5 sub mat3 add mat4 sub def
- /mat5 mat5 mat3 sub mat1 sub def
- /mat2 mat2 mat0 sub def
- /mat6 mat6 mat3 sub mat2 sub def
- /mat3 mat3 mat0 sub def
- /z exch def
- /y exch def
- /x exch def
- mat0 mat1 x mul add mat2 mat4 x mul add y mul add mat3 mat5 x mul add z mul add
- mat6 mat7 x mul add y mul z mul add 255 div
- }
- {pop pop pop 0}
- ifelse
- } bind def
-
- %%%%% colorimage emulation
- systemdict /languagelevel known {languagelevel 2 ge} {false} ifelse not
- { /sepimage
- { [1 /exch cvx /sub cvx currenttransfer /exec cvx] cvx settransfer
- /DeviceGray setcolorspace
- image
- } hardbind def
- /grayimage
- { /DeviceGray setcolorspace
- image
- } hardbind def
- }
- { /sharedimagedict 8 dict def
- /sepimage
- { dup type /dicttype ne
- { sharedimagedict begin [0 1] false 1
- {/ImageType /MultipleDataSources /Decode /DataSource /ImageMatrix /BitsPerComponent
- /Height /Width} {exch def} forall currentdict end
- } if
- image
- } hardbind def
- /grayimage
- { dup type /dicttype ne
- { sharedimagedict begin [1 0] false 1
- {/ImageType /MultipleDataSources /Decode /DataSource /ImageMatrix /BitsPerComponent
- /Height /Width} {exch def} forall currentdict end
- } if
- image
- } hardbind def
- }
- ifelse
- /_proc1 {} def
- /_proc2 {} def
- /_proc3 {} def
- /_proc4 {} def
- /_multisrc 4 array def
- /_TmpString 65535 string def
- /_rgbimage
- { 4 index 8 eq
- { _TMSVars begin
- /_proc3 exch def
- /_proc2 exch def
- /_proc1 exch def
- { _proc1 _multisrc 0 3 -1 roll put
- _proc2 _multisrc 1 3 -1 roll put
- _proc3 _multisrc 2 3 -1 roll put
- _multisrc aload pop pop
- 0 1 2 index length 1 sub
- { /_idx exch def 3 {2 index _idx get 255 div} repeat
- _rendervalueforRGB 1 exch sub 255 mul round cvi _TmpString exch _idx exch put
- } for
- _TmpString 0 2 index length getinterval 4 1 roll
- 3 {pop} repeat
- } grayimage
- end
- }
- {true 3 _NXDoImageOp} ifelse
- } bind def
- /_cmykimage
- { _TMSVars begin
- /_proc4 exch def
- /_proc3 exch def
- /_proc2 exch def
- /_proc1 exch def
- channel 3 le
- { { _proc1 _multisrc 0 3 -1 roll put
- _proc2 _multisrc 1 3 -1 roll put
- _proc3 _multisrc 2 3 -1 roll put
- _proc4 _multisrc 3 3 -1 roll put
- _multisrc channel get
- }
- }
- { {pop 1} settransfer
- { _proc1 _proc2 _proc3 _proc4
- 3 {pop} repeat
- }
- } ifelse
- hardbind
- /sepimage load end exec
- } bind def
- /_rgbimageM
- { 2 index 8 eq
- { _TMSVars begin
- /_proc1 exch def
- /_currentcomp 0 def
- { _proc1
- /_idx 0 def
- _currentcomp 0 gt {_red exch _currentcomp 1 gt {_green exch} if} if
- {255 div _currentcomp 2 eq
- {_rendervalueforRGB 1 exch sub 255 mul round cvi _TmpString exch _idx exch put
- /_idx _idx 1 add def /_currentcomp 0 def
- }
- {/_currentcomp _currentcomp 1 add def} ifelse
- } forall
- _currentcomp 0 gt {_currentcomp 1 gt {/_green exch def} if /_red exch def} if
- _TmpString 0 _idx getinterval
- } grayimage
- end
- }
- {false 3 _NXDoImageOp} ifelse
- } bind def
- /_cmykimageM
- { 2 index 8 eq
- { _TMSVars begin
- /_proc1 exch def
- /_currentcomp 0 def
- channel 3 le {/_red channel def} {{pop 1} settransfer /_red 0 def} ifelse
- { _proc1
- /_idx 0 def
- {_currentcomp _red eq
- {_TmpString exch _idx exch put /_idx _idx 1 add def} {pop} ifelse
- _currentcomp 3 eq {0} {_currentcomp 1 add} ifelse /_currentcomp exch def
- } forall
- _TmpString 0 _idx getinterval
- } sepimage
- end
- }
- {false 4 _NXDoImageOp} ifelse
- } bind def
- /imageops [/grayimage load null /_rgbimage load /_cmykimage load] def
- /imageopsM [/grayimage load null /_rgbimageM load /_cmykimageM load] def
- end
-
- /currentcolorspaceNoPattern
- { currentcolorspace dup 0 get /Pattern eq {1 get} if
- } hardbind def
- /_MayPaint
- { currentoverprint
- { currentseparation
- currentcolorspaceNoPattern dup type /arraytype eq {0 get} if /Separation eq
- { currentcolorspaceNoPattern 1 get dup /All eq
- {pop pop true}
- {eq}
- ifelse
- }
- {_ProcessColorNames exch known}
- ifelse
- }
- {true}
- ifelse
- } hardbind def
- /_sepdict 8 dict def
- _sepdict begin
- /DeviceGray
- { _TMSVars begin channel 3 ne {{pop 1} settransfer} if
- 1 exch sub setcomponent end
- } bind def
- /DeviceRGB
- { _TMSVars begin channel 3 gt {{pop 1} settransfer} if
- _rendervalueforRGB setcomponent end
- } bind def
- /DeviceCMYK
- { _TMSVars begin
- channel 3 le
- {4 channel neg roll 3 {pop} repeat} {4 {pop} repeat 0 {pop 1} settransfer} ifelse
- setcomponent
- end
- } bind def
- /CIEBasedABC
- { _TMSVars begin channel 3 gt {{pop 1} settransfer} if
- _rendervalueforRGB setcomponent end
- } bind def
- /CIEBasedA
- { _TMSVars begin channel 3 ne {{pop 1} settransfer} if
- 1 exch sub setcomponent end
- } bind def
- /Pattern
- { dup /PaintType get 2 eq
- { count 1 roll
- _sepdict currentcolorspace 1 get dup type /arraytype eq {0 get} if get exec
- currentcolor count -1 roll setpattern
- }
- {pop}
- ifelse
- } hardbind def
- /Indexed
- { currentcolorspaceNoPattern 3 get dup xcheck {exec}
- {exch numcolorspaceComponents currentcolorspace 1 get dup type /arraytype eq {0 get} if get
- exch 1 index mul exch getinterval {255 div} forall} ifelse
- _sepdict currentcolorspaceNoPattern 1 get dup type /arraytype eq {0 get} if
- get exec
- } hardbind def
- /Separation
- { _TMSVars begin
- currentcolorspaceNoPattern 1 get /All ne
- { currentseparation currentcolorspaceNoPattern 1 get ne
- {{pop 1} settransfer} if
- } if
- setcomponent
- end
- } bind def
- end
- /separate
- { currentcolor _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 12 dict def
- colorimageDict begin
- /DeviceGray {_TMSVars /grayimage get} hardbind def
- /DeviceRGB {loadimageparams _TMSVars exch {/imageops} {/imageopsM} ifelse get 2 get} hardbind def
- /DeviceCMYK {loadimageparams _TMSVars exch {/imageops} {/imageopsM} ifelse get 3 get} hardbind def
- /CIEBasedABC {loadimageparams 3 {_NXDoImageOp}} hardbind def
- /CIEBasedA {loadimageparams 1 {_NXDoImageOp}} hardbind def
- /Pattern {/image errordict /undefined get exec} def
- /imageprocedures
- [
- { laststringarr 0 get dup length 0 eq {pop datasrc} if
- dup length 4 mul dup 65535 gt
- { pop 65535 4 idiv 2 copy 0 exch getinterval 3 1 roll
- 1 index length 1 index sub getinterval laststringarr 0 3 -1 roll put
- dup length 4 mul
- }
- {laststringarr 0 () put}
- ifelse
- indexedimageworkstring 0 3 -1 roll getinterval 0 3 -1 roll
- { 3 1 roll
- 4
- { 2 index 192 and -6 bitshift
- lookupstring exch get 3 copy put pop 1 add
- 3 -1 roll 2 bitshift 3 1 roll
- } repeat
- 3 -1 roll pop
- } forall pop
- }
- { laststringarr 0 get dup length 0 eq {pop datasrc} if
- dup length 2 mul dup 65535 gt
- { pop 65535 2 idiv 2 copy 0 exch getinterval 3 1 roll
- 1 index length 1 index sub getinterval laststringarr 0 3 -1 roll put
- dup length 2 mul
- }
- {laststringarr 0 () put}
- ifelse
- indexedimageworkstring 0 3 -1 roll getinterval 0 3 -1 roll
- { 3 1 roll 2 index -4 bitshift
- lookupstring exch get 3 copy put pop 1 add
- 3 -1 roll 15 and
- lookupstring exch get 3 copy put pop 1 add
- } forall pop
- }
- null
- { datasrc dup length string 0 3 -1 roll {lookupstring exch get 3 copy put pop 1 add} forall pop
- }
- ] def
- /fillLookupString
- { lookupstring 0
- 0 1 maximgval {decodescale mul decodemin add gsave setcolor separate currentcolor grestore
- 255 mul round cvi 3 copy put pop 1 add} for pop pop
- } def
- /identityLookupStrings [4 string 0 1 3 {dup 85 mul 3 copy put pop pop} for
- 16 string 0 1 15 {dup 17 mul 3 copy put pop pop} for
- null
- 256 string 0 1 255 {dup 3 copy put pop pop} for] def
- /indexedimagelocalvars 8 dict def
- indexedimagelocalvars begin
- /lookupstring 256 string def
- /laststringarr 1 array def
- /indexedimageworkstring 65535 string def
- end
- /Indexed
- { gsave begin currentdict loadimageparams pop
- 2 index 1 eq
- { 3 -1 roll pop false 3 1 roll
- /Decode load 0 get setcolor separate pop {( )} dup 0 get 0 0 put imagemask
- currentdict loadimageparams pop 3 -1 roll pop true 3 1 roll
- /Decode load 1 get grestore gsave setcolor {imagemask grestore}
- }
- { indexedimagelocalvars begin
- /maximgval 2 /BitsPerComponent load exp 1 sub cvi def
- /datasrc exch def
- /decodescale /Decode load aload pop exch sub maximgval div def
- /decodemin /Decode load 0 get def
- /lookup currentcolorspace 3 get def
- colorimageDict /fillLookupString get hardbind exec
- /lookupstring load 0 /maximgval load 1 add getinterval
- identityLookupStrings /BitsPerComponent load 2 idiv 1 sub get eq
- {/datasrc load}
- { /laststringarr load 0 () put exch pop 8 exch
- imageprocedures /BitsPerComponent load 2 idiv 1 sub get hardbind
- /BitsPerComponent load 8 ne
- { matrix currentmatrix 2 index concat
- newpath 0 0 moveto 5 index 0 rlineto 0 5 index rlineto 5 index neg 0 rlineto clip
- setmatrix
- 5 -1 roll /BitsPerComponent load 2 eq {3 add 4 idiv 4 mul} {1 add 2 idiv 2 mul} ifelse
- 5 1 roll
- } if
- }
- ifelse
- end {_TMSVars /sepimage get exec grestore}
- }
- ifelse
- end
- } hardbind def
- /Separation {_TMSVars /sepimage get} def
- end
- /image
- { gsave
- dup type /dicttype ne {/DeviceGray setcolorspace} if
- colorimageDict currentcolorspace 0 get get exec PaintExecute
- grestore
- } hardbind def
- /colorimage
- { gsave {/DeviceGray null /DeviceRGB /DeviceCMYK} 1 index 1 sub get setcolorspace
- 1 sub exch _TMSVars exch {/imageops} {/imageopsM} ifelse get exch get
- PaintExecute
- grestore
- } hardbind def
- /imagemask {{imagemask} PaintExecute} hardbind def
-
- /sethalftone
- { begin
- { {/Frequency load /Angle load /SpotFunction load setscreen
- currentdict /TransferFunction known {/TransferFunction load settransfer} if}
- {/GrayFrequency load /GrayAngle load /GraySpotFunction load setscreen
- currentdict /GrayTransferFunction known
- {/GrayTransferFunction load settransfer} if
- }
- {}
- {}
- {currentseparation currentdict 1 index known
- {load} {pop /Default load} ifelse /sethalftone cvx exec}
- }
- /HalftoneType load 1 sub get exec
- end
- } hardbind def
- /setcolorscreen {setscreen 9 {pop} repeat} hardbind def
- /setcolortransfer {settransfer 3 {pop} repeat} hardbind def
-
- /_NXLevel2 true def
- /NXCalibratedRGBColorSpace /DeviceRGB def
- /nxsetgray /setgray load def
- /nxsetrgbcolor /setrgbcolor load 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
-
- userdict /undoSaveToken known {userdict /undoSaveToken get restore} if
- setpacking
-