Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!mephisto!prism!sun13!gw.scri.fsu.edu!pepke From: pepke@gw.scri.fsu.edu (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: CLUT problem Message-ID: <615@sun13.scri.fsu.edu> Date: 4 Sep 90 21:32:25 GMT References: <20089@well.sf.ca.us> Sender: news@sun13.scri.fsu.edu Organization: Florida State University, but I don't speak for them Lines: 35 In article <20089@well.sf.ca.us> crunch@well.sf.ca.us (John Draper) writes: > We are having some problems in dealing with CLUT+s. We are developing software > (A TV Board) which has to fill in a CLUT by hand in order to meet our stringent > performance needs (Live Video). In page 145 in IM Vol 5, in the description of > the "RestoreEntries" call, the 3rd paragraph mentions "this may cause RGBForeColor > to act strangely". Is there a Tech note that describes this problem, and how > do I get around it, because it certainly does what the manual says > (IE: Act strangley). The reason RGBForeColor behaves strangely is that RestoreEntries does not reset the inverse table, which is used by RGBForeColor to get close to the correct color. You have to make a new inverse table using MakeITable, which is described on page 142. Of course, then you've got to stick it in the gDevice. I use an offscreen gDevice with offscreen 8-bit pixmaps, which are filled using Color2Index. I CopyBits the pixmaps onto the screen into a window with palettes the same as the desired color table, all tolerant colors with a tolerance of 0. It works fine. Apple's quantization scheme is OK but not perfect. If you want to, you can write your own search procedure. All the really good ones are slow. Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.