Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: antialiased lineProc Message-ID: <23322@ucbvax.BERKELEY.EDU> Date: 18 Mar 88 05:17:56 GMT References: <470@stech.UUCP> <5678@cit-vax.Caltech.Edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 22 In article <5678@cit-vax.Caltech.Edu> sho@tybalt.caltech.edu.UUCP (Sho Kuwamoto) writes: >Has anyone written a lineProc that does a smidgen of anti-aliasing? Ya, I've done it. Here is the algorithm: 1.) draw the graph into an offscreen, black and white bitmap at double or triple resolution. 2.) Use a tuned assembly language routine to prowl the offscreen bitmap, converting square groups of bits into single, gray pixels, by counting the number of "on" bits in a square. Accumulate these in an offscreen pixmap. 3.) call CopyBits to display the offscreen pixmap. You will want to register the colors your offscreen pixmap uses in the pallette of the window you are displaying in, so no color table arbitratration will be necessary between the offscreen pixmap and the window's pixmap. Anybody willing to post a tutorial on doing a better algorithm? How about stereo on the Mac II? --- David Phillip Oster --A Sun 3/60 makes a poor Macintosh II. Arpa: oster@dewey.soe.berkeley.edu --A Macintosh II makes a poor Sun 3/60. Uucp: {uwvax,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu