Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1456049
  • 博文数量: 267
  • 博客积分: 3010
  • 博客等级: 少校
  • 技术积分: 3089
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-05 17:09
个人简介

尊天命,尽人事

文章分类

全部博文(267)

文章存档

2017年(6)

2015年(4)

2014年(27)

2013年(52)

2012年(59)

2011年(120)

分类: LINUX

2013-10-26 12:47:10

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]; 
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;
One more note, the above is fine if each color component is 8-bits in size (RGB888, for instance), but for RGB555, you have to downscale. So the untested code below will work better:
     red_map[i/(1 << (8 - red_length))] = i;
     red_map[i/(1 << (8 - 5))] = i;
     red_map[i/8] = i;
阅读(932) | 评论(0) | 转发(0) |
0

上一篇:调色板原理

下一篇:关于Linux内核 ZONE_DMA

给主人留下些什么吧!~~