PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Byte Swapping and Frame Buffers

Another example of byte swapping is what happens to multibyte pixels in a frame buffer. Macintosh software is compatible with several multibyte pixel formats, of which 16-bit pixels provide a good example of the effects of byte swapping. The Macintosh 16-bit RGB format interprets a half word as consisting of a 1-bit alpha value followed by three 5-bit red, green, and blue color components. The diagram in Figure A-7 shows how these pixels are packed into a word in big-endian memory.

Figure A-7 Big-endian RGB 16-bit pixel format

When this data is moved across the little-endian PCI bus, data swapping makes the data appear as shown in Figure A-8.

Figure A-8 Little-endian RGB 16-bit pixel format

Notice two effects of the byte swapping process:


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)