% prints Matlab image on 0..254 with myNaN=255
%
% displays in xv; waits for user to select PostScript options, then prints, assuming file
% of same name but ending in .ps

function steve(variable,filename) % returns nothing

if nargin==1
  filename='deleteme_deleteme.pgm';
end%if

if nargin==2
  disp('printxv.m: haven''t dealt with filename problem yet: deleteme.pgm saves deleteme.ps')
  disp('printxv.m: but deleteme saves deleteme.ps; still to get rid of .pgm if there, etc')
  error('printxv.m exiting for now')
end%if

eval(sprintf('savepnm(''%s'',chnan255(variable))',filename))
disp('printxv.m: spawning xv; will print and return prompt when xv exits')
disp('         : save as PostScript with no change to filename (default xv convention)')
eval(sprintf('!xv %s',filename))
L=length(filename);
filenameps='deleteme_deleteme.ps';  % fix later
eval(sprintf('!lpr -Pvision-plain %s',filenameps))

