home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!spool.mu.edu!umn.edu!csus.edu!netcom.com!ray
- From: ray@netcom.com (Ray Fischer)
- Subject: Re: HELP: Speedup SetCPixel
- Message-ID: <1992Dec17.023831.5227@netcom.com>
- Organization: Netcom. San Jose, California
- References: <1992Dec16.081024.2403@aragorn.unibe.ch>
- Date: Thu, 17 Dec 1992 02:38:31 GMT
- Lines: 30
-
- KOHLER@IOC.unibe.ch writes ...
- >Hi there!
-
- Dude!
-
- >I'm writing a program that should be able to read a file of characters
- >and display for each of them a pixel in the corresponding color (8 bit).
- >
- >The problem is: IT'S VERY SLOW ....
-
- Yup. For each 8-bit pixel you put into the buffer, Quickdraw has to
- take the 48-bit color you gave it and use a reverse-index table to get
- the actual pixel value (which will be an index into the color lookup
- table). It also figures out where in the offscreen GWorld the pixel
- belongs and checks for any clipping.
-
- The trick to make this process go faster is to do as much of it as
- possible only once at the beginning. For example, if character 'X'
- turn into blue, then one way to do all this a lot faster would be to
- create a table at the beginning indexed by character and returning a
- pixel value. Then store this pixel value directly into the offscreen
- GWorld's pixmap.
-
- I'll leave the details as an exercise (I always hated that phrase when
- I was a student, but now's not the time to do the research myself.
- Look at the Color Quickdraw and Pallette Manager chapters in IM V)
-
- --
- Ray Fischer "Convictions are more dangerous enemies of truth
- ray@netcom.com than lies." -- Friedrich Nietszsche
-