艺术的追求从编程开始

C/C++/UNIX/PYTHON/ALGORITHM

导航

07 2012 档案

c/c++ 图像RGB位存储,位操作
摘要:直接上代码: 1 #include <string.h> 2 #include <stdio.h> 3 #include <math.h> 4 5 6 typedef unsigned short UINT16; //store pixel rgb data 7 typedef unsigned char BYTE; //store r\g\b data 8 9 10 11 void main(){12 UINT16 pattern[640][480]; //16bit 640*480 rgb image.13 BYTE rgb[3];... 阅读全文

posted @ 2012-07-07 09:28 Rambo.Wang 阅读(2378) 评论(0) 推荐(0)

将char转成bit,文件读写
摘要:好久不写代码,一段将bmp写到mif的小程序花了我好几个小时。以后要多练习啊。 1 #include <string.h> 2 #include <stdio.h> 3 #include <math.h> 4 5 6 void main(){ 7 char str[3]; 8 char pos_str[5]; 9 10 FILE *fp_read;11 fp_read = fopen("pattern_mem.bmp","r");12 13 FILE *fp_write;14 fp_write = fopen(&quo 阅读全文

posted @ 2012-07-04 21:35 Rambo.Wang 阅读(1947) 评论(0) 推荐(0)