From: Antonino A. D. <ad...@gm...> - 2006-08-05 23:48:51
|
James Lehman wrote: > Can someone please explain the difference between these two display types? > > FB_VISUAL_TRUECOLOR > FB_VISUAL_DIRECTCOLOR > > My frame buffer API, ezfb, works well with cards that are > FB_VISUAL_TRUECOLOR, but not so well with cards that are > FB_VISUAL_DIRECTCOLOR. > > http://www.akrobiz.com/ezfb/ Truecolor: pixel = red << offset | green << offset | blue << offset | alpha << offset; where red, green, blue, alpha are the actual values of each pixel component Directcolor: pixel = red_index << offset | green_index << offset | blue_index << offset | alpha_index << offset; where *_index's are the index to the Hardware LUT, ie: red = red_map[red_index]; Thusly: In Directcolor, you have to initialize the LUT first, by sending an FBIOPUTCMAP ioctl. If you want Directcolor to behave like Truecolor, then send a linear colormap where: {red|green|blue|alpha}_map[i] = i; In Truecolor, the color map need not be initialized. Tony Note: Each color component in struct fb_cmap are u16 in size, so the contents of the cmap must be duplicated in both bytes, ie: i = red; red <<= 8; red_map[i] = red; |