ADC Home > Reference Library > Technical Notes > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Fixed CLUT Devices and the Single Techno Nerd

CONTENTS

Applications that need a given set of colors to look good or make use of color table animation can obtain undesired results in PowerBook 160, PowerBook 180, and PowerBook Duo Macintosh models. The reason for this is that these models sport Fixed Color Devices associated with the flat screen display. This Technote describes what a Fixed CLUT device is and presents some solutions to the challenges presented by this display type.

[Dec 01 1992]






Introduction

Since the introduction of the Macintosh II, Inside Macintosh Volume V defined three types of graphics devices:

Indexed CLUT devices ( gdType = 0 )

Fixed CLUT devices ( gdType = 1 )

Direct RGB devices ( gdType = 2 )

In the case of indexed devices, values that range from 0 to 2[n ]-1 (where n is the depth of the device under consideration) point to entries in a table of RGB triplets, thus determining the color associated with a given pixel value. In the case of direct RGB devices, the pixel value is in itself an RGB triplet, therefore defining the color associated with the pixel.

Up to recently, the only type of indexed CLUT devices known to humanity has been gdType = 0 or Indexed CLUT devices; these are the devices that drive most display boards when set to depths between 1 and 8 (2 colors to 256 colors). As far as color is concerned, the main feature of indexed devices is that the color table for a given device can be changed either directly by using SetEntries or indirectly when the Palette Manager establishes the color environment in response to a palette associated with the frontmost window (if it has one.)

Fixed CLUT devices enter with the introduction of the PowerBook Duo, PowerBook 160, and PowerBook 180 portables. All these machines support 16-color gray displays (depth = 4); the trick is that although the video does have a color table, it can not be changed at all. What this means is that no color table animation is possible and that the palette manager can not give you the colors you want or affect palette animation.

Checking for the type of device is really simple. Once you have the device handle all you have to write is something like:

DisplayInfo.gdType = (*currDev) -> gdType;

Naturally, once the application knows it has to deal with a Fixed CLUT device, it may want to do something based on this information.

Back to top

So What!

At this point the smart reader is probably starting to wonder what kind of help this Technote is going to provide as far as not having to stay alone at home this Friday evening: Sadly enough the answer is none. Nevertheless it can help avoid support calls from PowerBook users when their favorite application starts acting weird.

Now, the first thing to emphasize is that most developers don't have to worry about this--it is not as if your word processing application is going to start crashing. However, applications that by their nature have to modify the color environment to run properly have to take some precautions.

We will discuss some scenarios and the implications for each one. Other possibilities may exist, but these will help you understand the issues.

Non-Color-Intensive Applications Need Not to Worry

Applications that deal with text and black-and-white stuff should not be concerned. Even applications that provide limited color capabilities will have no problem.

Color-Enhanced Applications

Certain applications such as games and presentation packages require a given set of colors to look "cool." Probably the Palette Manager is used in order to assure that the minimal set of colors is present. Applications like these need to make sure there is a fallback similar to the one used when the application is running in a black-and-white environment. Note that prompting the user to change the depth won't do much good.

Color-Intensive Applications

Applications that require heavy manipulation of the color environment to do their stuff need to be ready to take the path taken when the machine the user is on has no color or can not be set to the optimum depth. Applications that call the video driver directly such as those that animate colors by calling the _Control routine especially need to make sure the device in question is capable of color table changing; the control call returns an error -17 (controlErr - Driver can not respond to Control call) if SetEntries or DirectSetEntries is tried.


Note 1:
The PowerBook Duo can be docked to a number of different docking stations, the currently available docking stations are:

  1. Duo Dock. In this case the flat display is not used at all and the main device becomes an Indexed CLUT device with depths depending on the monitor being used.
  2. Mini Dock. The main display is still in use and the monitor configuration for the machine becomes a two-display system with one Indexed CLUT device (external display) and a Fixed CLUT device (flat display).


Note 2:
PowerBook Duo, PowerBook 160, and PowerBook 180 Macintosh computers can be configured in a display mode called Mirroring using the PowerBook Display control panel. In this configuration the system sees two devices that share the same bounds. The result is that drawing to the main device results in drawing into both screens with QuickDraw taking care of the details such as different depths and color/black-and-white settings.


Back to top

In Conclusion

Fixed CLUT devices add a little twist to the things that an application developer has to be aware of. With the popularity of the PowerBook line, it becomes really important that applications know how to configure in this case in order to continue providing smooth performance under the varied conditions now existent in the Macintosh family of computers.

Back to top

References

Inside Macintosh, Volume VI, The Graphics Devices Manager

Macintosh Duo System Developer Note (Available on the Developer CD)

Macintosh PowerBook 160 and Macintosh PowerBook 180 Developer Note (Available on the Developer CD)

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (52K).

Download



Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.