rgb565 image data transform to OLED data
来源:互联网 发布:淘宝超级店长好用吗 编辑:程序博客网 时间:2024/05/26 02:55
{
//input : uint32 *image_addr
uint16 row,col,image_data_temp;
uint16 *image_addr_temp=NULL;
static uint16 dst_image[4][96] = {0x00};
//one pixel is 16bit
image_addr_temp = (uint16 *)image_addr;
//clear dst_image buffers
for(row=0;row<32;row++)
{
for(col=0;col<96;col++)
{
dst_image[row/8][col] = 0x00;
}
}
//fill dst_image buffers
for(col=0;col<96;col++)
{
for(row=0;row<32;row++)
{
image_addr_temp = (uint16 *)image_addr;
image_data_temp = *(image_addr_temp+96*row+col);
if((((image_data_temp&0xf800)>>11) + /
((image_data_temp&0x07e0)>>5) + /
(image_data_temp&0x001f))/3 > 20)//transform rgb565 to black-white image
{
dst_image[row/8][col] |= 1<<(row%8);
}
else
{
dst_image[row/8][col] |= 0<<(row%8);
}
}
}
//then the dst_image buffer is the OLED data that it needed
image_addr = (uint32 *)&dst_image[0][0];
}
OLED data example as following:
(Start Column)--> (End Col)
--------------------------------|-------------------------------------------------------------|-----
| | | | | | |0| | <- LSB D0 | | | | | | | |
| | | | | | |1| | | | | | | | | |
PAGE(n) | | | | | | |1| | | | | | | | | |
(Start page) | | | | | | |0| | | | | | | | | |
| | | | | | |0| | .................... | | | | | | | |
| | | | | | |1| | | | | | | | | |
| | | | | | |0| | | | | | | | | |
| | | | | | |1| | <- MSB D7 | | | | | | | |
-----------------------------------------------------------------------------------------------------
- rgb565 image data transform to OLED data
- How to do take snapshot image as binary data?
- Camera raw data directly to image using CxImage
- How to access pixel data of an image
- Unable to create unsliced image from csi bitmap data
- 关于image.data
- data:image/png;base64
- data:image/png;base64
- data:image/png;base64
- ionic2 svg格式icon不显示,报错: Refused to load the image 'data:image/svg
- 从pixbuf获取image data
- data:image/png;base64是什么
- data:image/png;base64是什么
- data:image/gif;base64 用法
- data:image/png;base64是什么
- "Unable to get image data from canvas because the canvas has been tainted by cross-origin data"问题产生原
- Failed to write image data for the launch image set from "LaunchImage.launchimage/1242_2208.png" to
- data
- 智乐软件的笔试题
- [sql server] 问题总结3 - 获取最大值,最小值的 not exists
- 访问Drawable 资源的宽高----ContextMenu Bitmap
- Firefox 的 JavaScript 问题两则
- vi分屏
- rgb565 image data transform to OLED data
- 存储过程
- 从腾讯上弄下来的 设置首页
- 脚本式参数化建模
- C#SerailPort串口通信Demo
- [iphone] Hardware->Simulate Memory Warning
- Linux runlevel
- 两种方法清空memcache缓存(转)
- lazarus - 跨平台的delphi5