online $ˆl–äY>” Jh¥6 \¸n ¥1hßÄ „m…ßÃÂÁ?÷% Copyright (C) 2001-2021 Artifex Software, Inc. % All Rights Reserved. % % This software is provided AS-IS with no warranty, either express or % implied. % % This software is distributed under license and may not be copied, % modified or distributed except as expressly authorized under the terms % of the license contained in the file LICENSE in this distribution. % % Refer to licensing information at http://www.artifex.com or contact % Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, % CA 94945, U.S.A., +1(415)492-9861, for further information. % % stcinfo.ps % Epson Stylus-Color Printer-Driver % The purpose of this file is to print & show Parameters of the % stcolor-driver. If not run on ghostscript/stcolor, it prints % something like a color-chart. % use either existing STCinfo-dictionary, retrieve new one or create dummy statusdict begin product end dup (Ghostscript) eq 1 index (Artifex Ghostscript) eq or exch (AFPL Ghostscript) eq or{ currentdevice getdeviceprops .dicttomark dup /Name get (stcolor) eq /STCi_onstc exch def /STCinfo where {/STCinfo get exch pop} if /STCinfo exch def }{ /STCinfo 10 dict def STCinfo begin /Name (unknown) def end /STCi_onstc false def }ifelse % Next Block are procedures to generate the color-triangles. % you may wish to separate them, just look ahead for the name % given in the next line to achieve that. % Begin: colortri_procedures % Plot the CIE-XY-triangle (or something like that) % /colortri_mat Conversion matrix RGB -> XYZ % /colortri_bg procedure, that takes X/Y-Values and delivers the % "background color" as RGB-Values, default is: % {pop pop 0.85 dup dup} % The default matrix was taken from: % Color spaces FAQ - David Bourgin % Date: 15/6/94 (items 5.3 and 6 updated) % Last update: 29/6/94 /colortri_mat [ % RGB -> CIE XYZitu601-1 (D65) 0.4306 0.3415 0.1784 0.2220 0.7067 0.0713 0.0202 0.1295 0.9394 ] def /colortri_bg {pop pop 0.85 dup dup} bind def % +---------------------------------------------------------------------+ % | Besides from fixing bugs, nothing should be changed below this line | % +---------------------------------------------------------------------+ % Arbitrary operation on a pair of vectors, *CHANGES* 1st. % invoke: Vaccu Vop op vop /vop { bind 0 1 3 index length 1 sub { 3 index 1 index get 3 index 2 index get 3 index exec 4 index 3 1 roll put } for pop pop } bind def /vsub { {sub} vop } bind def % subtract two vectors /vmul { {mul} vop } bind def % multiply two vectors % Compute sum of vectors elements /vsum {0.0 exch{add}forall} bind def % Sum up products of elements /veqn { [ 3 -1 roll {} forall ] exch vmul vsum } bind def % Find index of |maximum| in array /imax { dup 0 get abs 0 exch % array i v[i] 1 1 4 index length 1 sub { 3 index 1 index get abs dup 3 index gt {4 2 roll}if pop pop } for 3 -1 roll pop } bind def % Procedure to *CHANGE* RGB-Values into XYZ-Values /rgb2xyz { 0 3 6 { colortri_mat exch 3 getinterval 1 index veqn exch } for astore } bind def % Procedure to *CHANGE* transform rgb->xy /rgb2xy { rgb2xyz dup 0 get 1 index 1 get 2 index vsum % XYZ X Y sum dup 0 ne { exch 1 index div 3 1 roll div % XYZ y x 2 index exch 0 exch put % xYZ y 1 index exch 1 exch put % xyZ }{ pop pop pop dup 0 0 put dup 0 1 put } ifelse 0 2 getinterval } bind def % So here we go with our procedure /colortri { %Usage: box #pixels save 1 index type /arraytype eq {exch 8}{3 1 roll} ifelse % Default scale /colortri_scale exch def /colortri_box exch def % Prepare some useful constants for xy -> RGB conversion /colsum [ % Array with column-sums 0 1 2{0 exch 3 1 index 6 add{colortri_mat exch get add}for}for ] def