[fa.laser-lovers] PostScript example showing 1:1 pixel copying

laser-lovers@uw-beaver (07/27/85)

From: Brian Reid <reid@Glacier>

%!
% PostScript program to demonstrate how to put down a raster image in the
% device coordinate system, so as to guarantee that each bit of the raster
% image maps exactly into one bit of the laser marking engine. It works
% by cramming identity matrixes into all of the relevant transformations.

/zstr 300 8 div 1 add cvi string def	% define a 300-bit string buffer
/Imtx matrix def			% make an identity matrix

175 350 translate 0 0 moveto		% go to a random place on the page
/Courier findfont 15 scalefont setfont	% put down a label
(A 300-by-300 raster image: ) show
  currentpoint transform 		% see where we are in device coords
  Imtx setmatrix	 		% turn off all transformation
					% (i.e. switch to device coordinate
					% system)
  translate				% move origin to transformed currpt

/imageproc { zstr } def			% define a null imageproc
					% (it just puts 300 bits of zero on
					% the stack when it is called)
  300 300				% print a 1-inch square
  false					% make 0 bits be black
  Imtx					% don't transform anything
  imageproc				% our null imaging proc
  imagemask				% generate the image
showpage