Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!hamblin.math.byu.edu!hellgate.utah.edu!dog.ee.lbl.gov!csa2.lbl.gov!eastman From: eastman@csa2.lbl.gov (JACK EASTMAN) Newsgroups: comp.sys.mac.programmer Subject: Re: color/gamma table animation (was Re: what I want to see in future Apple computers) Message-ID: <14562@dog.ee.lbl.gov> Date: 21 Jun 91 17:20:15 GMT References: <31504@hydra.gatech.EDU> <1991Jun18.135838.3444@potomac.ads.com> Reply-To: eastman@csa2.lbl.gov Organization: Lawrence Berkeley Laboratory - Berkeley, CA, USA Lines: 43 News-Software: VAX/VMS VNEWS 1.3-4 X-Local-Date: Fri, 21 Jun 91 09:22:17 PDT In article , evensen@husc9.harvard.edu (Erik Evensen) writes... > > OK! :-) > > I understand all mainline Apple video cards have a Gamma correction table, > and that it is at least theoretically possible to do color table animation > of sorts by modifying this table on the fly. I've never done so and hope > to never *have* to do so. > > [explanation of what a gamma table is deleted...] > >Thank you for the information... > >I looked up gamma table in IM VI and it is listed in the Control Panel >as part of an example for writing a control panel. The passage refers >to "Designing Cards and Drivers for the Macintosh Family". I get the >feeling that this is not something us lowly programmers are supposed >to muck with and is probably less portable than doing CLUT animation. >Am I missing some great programming technique here? > >--Erik (evensen@husc.harvard.edu) I've played with the gamma table and it ain't easy. Erik hit the nail on the head when he mentioned portability. If you're going to mess with the gamma table, you have to set it back to what it was, not just to some default values, or the color prepress people who care about precise color matching will march up your alley carrying torches. There's a documented video driver control call (GetGamma) for obtaining the gamma table the board is currently using, and another (SetGamma) for setting a new one. Unfortunately, the GetGamma call is documented in "Designing Cards and Drivers" second edition, but not in the first. Therefore many video cards do not support this call. Worse, some third party video drivers in early ROM versions (in about five cases that I know about, none of them no-name vendors) go so far as to crash when called with the GetGamma selector. Bad switch statements or something. Therefore making a GetGamma call to a video driver without first checking the board's hardware ID and (if you're really ambitious) ROM version is VERY VERY DANGEROUS in general and will zap you if your product has a wide audience. ------------------------------------------------------------------------ Jack Eastman Berkeley Systems, Inc. eastman@lbl.gov