🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.laser-lovers
Article #985

PostScript example showing 1:1 pixel copying

#985
From: laser-lovers
Date: Fri, 26 Jul 1985 23:29
29 lines
1747 bytes
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
Technical Details
Message-ID: <1448@uw-beaver>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ucbvax!decvax!tektronix!uw-beaver!laser-lovers

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site uw-beaver
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ucbvax!decvax!tektronix!uw-beaver!laser-lovers
From: laser-lovers@uw-beaver
Newsgroups: fa.laser-lovers
Subject: PostScript example showing 1:1 pixel copying
Message-ID: <1448@uw-beaver>
Date: Fri, 26-Jul-85 19:29:22 EDT
Article-I.D.: uw-beave.1448
Posted: Fri Jul 26 19:29:22 1985
Date-Received: Wed, 31-Jul-85 01:25:55 EDT
Sender: daemon@uw-beaver
Organization: U of Washington Computer Science
Lines: 29