├── Day1 ├── Makefile ├── NineTable ├── NineTable.c ├── file │ ├── Ubuntu12.04shell命令练习(1).docx │ └── 《LINUX环境编程图文指南》.pdf ├── images │ ├── 开发板的讲解.bmp │ ├── 文件的分类.bmp │ └── 视频监控系统的讲解.bmp ├── note.txt ├── open └── open.c ├── Day2 ├── BMP_TO_LCD.c ├── TouchScreen.c ├── code │ ├── bmp.c │ ├── color.c │ ├── open.c │ └── read.c ├── color.c ├── images │ ├── main.bmp │ ├── 图片的显示.bmp │ └── 颜色的显示.bmp ├── note.txt └── read.c ├── Day3 ├── Login.c ├── TouchScreen.c ├── code │ ├── bmp.c │ ├── color.c │ ├── input.h │ ├── pthread_create.c │ ├── strcmp.c │ └── touch_screen.c ├── file │ └── ui │ │ ├── num0.bmp │ │ ├── num1.bmp │ │ ├── num10.bmp │ │ ├── num2.bmp │ │ ├── num3.bmp │ │ ├── num4.bmp │ │ ├── num5.bmp │ │ ├── num6.bmp │ │ ├── num7.bmp │ │ ├── num8.bmp │ │ ├── num9.bmp │ │ └── password.bmp ├── images │ └── 显示颜色的优化.bmp ├── input.h ├── note.txt └── pthread.c ├── Day4 ├── code │ ├── bmp.c │ ├── color.c │ ├── input.h │ ├── pthread_create.c │ ├── strcmp.c │ └── touch_screen.c ├── file │ └── ui │ │ ├── num0.bmp │ │ ├── num1.bmp │ │ ├── num10.bmp │ │ ├── num2.bmp │ │ ├── num3.bmp │ │ ├── num4.bmp │ │ ├── num5.bmp │ │ ├── num6.bmp │ │ ├── num7.bmp │ │ ├── num8.bmp │ │ ├── num9.bmp │ │ └── password.bmp ├── images │ └── 显示颜色的优化.bmp └── note.txt ├── Day5 ├── 视频监控项目源码 │ ├── 图片素材 │ │ ├── 10.bmp │ │ ├── fanhui.bmp │ │ ├── main.bmp │ │ ├── num0.bmp │ │ ├── num1.bmp │ │ ├── num10.bmp │ │ ├── num2.bmp │ │ ├── num3.bmp │ │ ├── num4.bmp │ │ ├── num5.bmp │ │ ├── num6.bmp │ │ ├── num7.bmp │ │ ├── num8.bmp │ │ ├── num9.bmp │ │ ├── password.bmp │ │ ├── q.bmp │ │ ├── q.png │ │ ├── welcome.bmp │ │ └── zhongjian.bmp │ └── 项目源码 │ │ ├── Makefile │ │ ├── camera.c │ │ ├── camera.h │ │ ├── font.h │ │ ├── jpeg │ │ ├── api_v4l2.h │ │ ├── jconfig.h │ │ ├── jerror.h │ │ ├── jmorecfg.h │ │ ├── jpeglib.h │ │ ├── kernel_list.h │ │ ├── libapi_v4l2_arm.so │ │ ├── libjpeg.so │ │ ├── libjpeg.so.8 │ │ ├── libjpeg.so.8.3.0 │ │ └── yuyv.h │ │ ├── libfont.a │ │ ├── main │ │ ├── main.c │ │ └── 编译命令.txt ├── 频监控系统源码.zip └── 频监控系统源码 │ ├── 图片素材 │ ├── 10.bmp │ ├── fanhui.bmp │ ├── main.bmp │ ├── num0.bmp │ ├── num1.bmp │ ├── num10.bmp │ ├── num2.bmp │ ├── num3.bmp │ ├── num4.bmp │ ├── num5.bmp │ ├── num6.bmp │ ├── num7.bmp │ ├── num8.bmp │ ├── num9.bmp │ ├── password.bmp │ ├── q.bmp │ ├── q.png │ ├── welcome.bmp │ └── zhongjian.bmp │ ├── 演示视频 │ └── 视频监控系统演示.mp4 │ └── 项目源码 │ ├── Makefile │ ├── camera.c │ ├── camera.h │ ├── font.h │ ├── jpeg │ ├── api_v4l2.h │ ├── jconfig.h │ ├── jerror.h │ ├── jmorecfg.h │ ├── jpeglib.h │ ├── kernel_list.h │ ├── libapi_v4l2_arm.so │ ├── libjpeg.so │ ├── libjpeg.so.8 │ ├── libjpeg.so.8.3.0 │ └── yuyv.h │ ├── libfont.a │ ├── main │ ├── main.c │ └── 编译命令.txt ├── README.md └── test.cpp /Day1/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/Makefile -------------------------------------------------------------------------------- /Day1/NineTable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/NineTable -------------------------------------------------------------------------------- /Day1/NineTable.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: NineTable.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年06月30日 星期日 23时41分46秒 6 | ************************************************************************/ 7 | 8 | #include 9 | 10 | int main() 11 | { 12 | int i,j; 13 | for(i=1;i<=9;i++) 14 | { 15 | for(j=1;j<=i;j++) 16 | { 17 | printf("%d*%d=%d ",i,j,i*j); 18 | } 19 | printf("\n"); 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /Day1/file/Ubuntu12.04shell命令练习(1).docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/file/Ubuntu12.04shell命令练习(1).docx -------------------------------------------------------------------------------- /Day1/file/《LINUX环境编程图文指南》.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/file/《LINUX环境编程图文指南》.pdf -------------------------------------------------------------------------------- /Day1/images/开发板的讲解.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/images/开发板的讲解.bmp -------------------------------------------------------------------------------- /Day1/images/文件的分类.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/images/文件的分类.bmp -------------------------------------------------------------------------------- /Day1/images/视频监控系统的讲解.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/images/视频监控系统的讲解.bmp -------------------------------------------------------------------------------- /Day1/note.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/note.txt -------------------------------------------------------------------------------- /Day1/open: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day1/open -------------------------------------------------------------------------------- /Day1/open.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: open.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月01日 星期一 02时56分27秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | int main() 17 | { 18 | int fd = open("./Hello.txt",O_CREAT | O_RDWR ,0777); 19 | if(fd < 0) 20 | { 21 | printf("CREAT is error\n"); 22 | } 23 | printf("this FileScrib is %d\n",fd); 24 | 25 | char p[]="Hello,Technology!!!\n"; 26 | write(fd,p,sizeof(p)); 27 | 28 | close(fd); 29 | 30 | int ffd = open("./Hello.txt", O_RDWR); 31 | char buf[1024]; 32 | bzero(buf,sizeof(buf)); 33 | ssize_t r = read(ffd,buf,sizeof(buf)); 34 | if(r<0) 35 | { 36 | printf("read is eeror\n"); 37 | } 38 | printf("The read is: %s\n",buf); 39 | 40 | close(ffd); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /Day2/BMP_TO_LCD.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | int main() 17 | { 18 | //1)打开LCD屏幕,打开图片。 19 | int fd_bmp = open("/root/project1/images/3.bmp",O_RDWR); 20 | int fd_lcd = open("/dev/fb0",O_RDWR); 21 | if(fd_bmp < 0 || fd_lcd <0) 22 | { 23 | printf("BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 24 | return -1; 25 | } 26 | 27 | printf("BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 28 | int ret = lseek(fd_bmp, 54, SEEK_SET); 29 | if (ret < 0) 30 | { 31 | printf("lseek error %d\n",ret); 32 | return -2; 33 | } 34 | 35 | //2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 36 | int *p_init = NULL; 37 | int *p_mmap = NULL; 38 | 39 | p_init = mmap(NULL,800 * 480 * 4,PROT_READ | PROT_WRITE,MAP_SHARED,fd_lcd,0); 40 | p_mmap = p_init; 41 | 42 | //2-1)800*480个BMP像素点变成800*480个LCD像素点 43 | 44 | char buf_bmp[800*480*3]; 45 | int buf_lcd[800*480]; 46 | bzero(buf_bmp, sizeof(buf_bmp)); 47 | bzero(buf_lcd, sizeof(buf_lcd)); 48 | 49 | ret = read(fd_bmp, buf_bmp, sizeof(buf_bmp)); 50 | if (ret < 0) 51 | { 52 | printf("read error\n"); 53 | return -3; 54 | } 55 | 56 | char A = 0x00; 57 | int i = 0; 58 | for (i = 0; i<800 * 480; i++) 59 | { 60 | buf_lcd[i] = buf_bmp[i * 3] << 0 | buf_bmp[i * 3 + 1] << 8 | buf_bmp[i * 3 + 2] << 16 | A << 24; 61 | } 62 | 63 | //2-2)颠倒图片 64 | int xx = 0; 65 | int y = 0; 66 | for (xx = 479; xx >= 0; xx--) 67 | { 68 | for (y = 0; y<800; y++) 69 | { 70 | *p_mmap= buf_lcd[xx*800+y]; 71 | p_mmap++; 72 | 73 | } 74 | } 75 | 76 | //3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 77 | 78 | munmap(p_init, 800*480*4); 79 | close(fd_bmp); 80 | close(fd_lcd); 81 | p_init = NULL; 82 | p_mmap=NULL; 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Day2/TouchScreen.c: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ***********************************************************************/ 7 | 8 | #include //printf 9 | #include //open 10 | #include //open 11 | #include //open 12 | #include //close 13 | #include //struct input_event 14 | #include 15 | 16 | int fd_event0; 17 | int fd_fb0; 18 | int *p_init = NULL; 19 | 20 | int init_mmap(void) 21 | { 22 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 23 | if(p_init == MAP_FAILED) 24 | { 25 | printf("mmap fail!\n"); 26 | return -1; 27 | } 28 | 29 | return 0; 30 | } 31 | 32 | int exit_mmap(void) 33 | { 34 | munmap(p_init, 800*480*4); 35 | p_init = NULL; 36 | return 0; 37 | } 38 | 39 | int open_fb0(void) 40 | { 41 | fd_fb0 = open("/dev/fb0", O_RDWR); 42 | if(fd_fb0 == -1) 43 | { 44 | printf("open /dev/fb0 fail!\n"); 45 | return -1; 46 | } 47 | else{ 48 | printf("fd_fb0 = %d\n", fd_fb0); 49 | } 50 | return 0; 51 | } 52 | 53 | int close_fb0(void) 54 | { 55 | close(fd_fb0); 56 | return 0; 57 | } 58 | 59 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 60 | { 61 | int *p_mmap = NULL; 62 | p_mmap = p_init; 63 | 64 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 65 | 66 | int x, y; 67 | for(y=0; y=0 && coordinate.value<800) 112 | { 113 | *coordinate_x = coordinate.value; 114 | } 115 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 116 | { 117 | *coordinate_y = coordinate.value; 118 | } 119 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 120 | { 121 | break; 122 | } 123 | } 124 | 125 | 126 | 127 | return 0; 128 | } 129 | 130 | int close_ts(void) 131 | { 132 | close(fd_event0); 133 | return 0; 134 | } 135 | 136 | int main(void) 137 | { 138 | int ts_x, ts_y; 139 | int red=-1; 140 | int green = -1; 141 | int blue = -1; 142 | 143 | open_ts(); 144 | 145 | open_fb0(); 146 | init_mmap(); 147 | 148 | while(1) 149 | { 150 | read_ts(&ts_x, &ts_y); 151 | printf("The X/Y is: (x,y)--->(%d, %d)\n", ts_x, ts_y); 152 | if(ts_x>0&&ts_x<200&&ts_y>0&&ts_y<480) 153 | { 154 | red = -red; 155 | if(red>0) 156 | arm6818_color(0x00ff0000, 0,0 , 480, 200); 157 | else 158 | arm6818_color(0xffffffff,0,0,480,200); 159 | } 160 | else if(ts_x>200&&ts_x<600&&ts_y>0&&ts_y<480) 161 | { 162 | green = -green; 163 | if(green>0) 164 | arm6818_color(0x0000ff00, 200,0 , 480, 400); 165 | else 166 | arm6818_color(0xffffffff,200,0,480,400); 167 | } 168 | else if(ts_x>600&&ts_x<800&&ts_y>0&&ts_y<480) 169 | { 170 | blue = -blue; 171 | if(blue>0) 172 | arm6818_color(0x000000ff, 600,0 , 480, 200); 173 | else 174 | arm6818_color(0xffffffff,600,0,480,200); 175 | } 176 | } 177 | 178 | close_ts(); 179 | close_fb0(); 180 | exit_mmap(); 181 | return 0; 182 | } 183 | -------------------------------------------------------------------------------- /Day2/code/bmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | //1)打开LCD屏幕,打开图片。 6 | 7 | //2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 8 | int *p_init = NULL; 9 | int *p_mmap = NULL; 10 | 11 | 12 | //2-1)800*480个BMP像素点变成800*480个LCD像素点 13 | 14 | //2-2)颠倒图片 15 | 16 | //3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 17 | 18 | 19 | return 0; 20 | } -------------------------------------------------------------------------------- /Day2/code/color.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //mmap、munmap 7 | 8 | int main(void) 9 | { 10 | int fd_fb0; 11 | fd_fb0 = open("/dev/fb0", O_RDWR); 12 | if(fd_fb0 == -1) 13 | { 14 | printf("open /dev/fb0 fail!\n"); 15 | return -1; 16 | } 17 | else{ 18 | printf("fd_fb0 = %d\n", fd_fb0); 19 | } 20 | 21 | int color = 0x0000ff00; 22 | int *p_mmap = NULL; 23 | int *p_init = NULL; 24 | 25 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 26 | if(p_init == MAP_FAILED) 27 | { 28 | printf("mmap fail!\n"); 29 | return -1; 30 | } 31 | 32 | p_mmap = p_init; 33 | *p_mmap = color; 34 | 35 | close(fd_fb0); 36 | munmap(p_init, 800*480*4); 37 | p_mmap = NULL; 38 | p_init = NULL; 39 | 40 | return 0; 41 | } -------------------------------------------------------------------------------- /Day2/code/open.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | 7 | int main(void) 8 | { 9 | int fd_txt; 10 | fd_txt = open("/home/gec/Desktop/1.txt", O_RDWR); 11 | if(fd_txt == -1) 12 | { 13 | printf("open txt fail!\n"); 14 | return -1; 15 | } 16 | else{ 17 | printf("fd_txt = %d\n", fd_txt); 18 | } 19 | 20 | close(fd_txt); 21 | return 0; 22 | } -------------------------------------------------------------------------------- /Day2/code/read.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | 7 | int main(void) 8 | { 9 | int fd_txt; 10 | fd_txt = open("/home/gec/Desktop/1.txt", O_RDWR); 11 | if(fd_txt == -1) 12 | { 13 | printf("open txt fail!\n"); 14 | return -1; 15 | } 16 | else{ 17 | printf("fd_txt = %d\n", fd_txt); 18 | } 19 | 20 | 21 | 22 | 23 | 24 | close(fd_txt); 25 | return 0; 26 | } -------------------------------------------------------------------------------- /Day2/color.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: color.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月01日 星期一 19时50分17秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | int main() 18 | { 19 | int fd_fb0=open("/dev/fb0",O_RDWR); 20 | 21 | if(fd_fb0 < 0) 22 | { 23 | printf("error -1"); 24 | return -1; 25 | } 26 | else 27 | { 28 | 29 | printf("This FileScip is %d\n",fd_fb0); 30 | int color = 0x00ffff00; 31 | int *p_mmap = NULL; 32 | int *p_init = NULL; 33 | 34 | p_init = mmap(NULL,800*480*4,PROT_READ | PROT_WRITE, MAP_SHARED , fd_fb0,0); 35 | if(p_init == MAP_FAILED) 36 | { 37 | printf("error map\n"); 38 | return -2; 39 | } 40 | 41 | p_mmap = p_init; 42 | 43 | int i = 0; 44 | for( i = 0; i < 800*480*4; ++p_mmap) 45 | { 46 | *p_mmap = color; 47 | 48 | ++i; 49 | } 50 | 51 | munmap(p_init, 800*480*4); 52 | p_mmap= NULL; 53 | p_init = NULL; 54 | close(fd_fb0); 55 | } 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Day2/images/main.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day2/images/main.bmp -------------------------------------------------------------------------------- /Day2/images/图片的显示.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day2/images/图片的显示.bmp -------------------------------------------------------------------------------- /Day2/images/颜色的显示.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day2/images/颜色的显示.bmp -------------------------------------------------------------------------------- /Day2/note.txt: -------------------------------------------------------------------------------- 1 | 20190702主要讲解知识点: 2 | 1)LCD屏幕显示颜色 3 | 2)LCD屏幕显示图片 4 | 5 | 一、LCD屏幕显示颜色 6 | 1)预习open、close、read函数的使用。 7 | 练习4: 8 | 1)编辑open.c源程序,保存共享文件夹中。实现如下功能:(open、close) 9 | 打开/home/gec/Desktop/1.txt文件,打印open函数的返回值,关闭文件。 10 | 2)使用vi/vim编辑器写“hello world!”字符串到1.txt文件中。read.c源程序实现如下功能:(read、bzero) 11 | 读取1.txt文件中“hello world!”字符串到数组txt_buf中,并打印txt_buf中的内容。 12 | 2)mmap、munmap 13 | 14 | read.c---->000-张三-李四(4).c 15 | 16 | man手册 17 | 1 Executable programs or shell commands 18 | 2 System calls (functions provided by the kernel) 19 | 3 Library calls (functions within program libraries) 20 | 21 | man -f 关键字(函数名) 22 | 例如: man -f open 23 | man 手册号 open 24 | 功能:打开一个文件或设备。 25 | 头文件: 26 | #include 27 | #include 28 | #include 29 | 函数的原型: 30 | int open(const char *pathname, int flags); 31 | 参数的内容: 32 | const char *pathname:设备/文件的路径 33 | int flags: 34 | O_RDONLY 只读 35 | O_WRONLY 只写 36 | O_RDWR 可读可写 37 | 返回值: 38 | 成功:返回一个文件描述符。(代表打开的设备或文件) 39 | 失败: -1。 40 | 41 | close 42 | #include 43 | int close(int fildes); 44 | int fildes:open的返回值。 45 | 46 | read 47 | #include 48 | ssize_t read(int fd, void *buf, size_t count); 49 | int fd:读取文件的文件描述符。 50 | void *buf:读取数据存放的地址。 51 | size_t count:读取文件的大小。 52 | 返回值: 53 | 成功:返回读取到的字节数。 54 | 失败:-1。 55 | 56 | #include 57 | void bzero(void *s, size_t n); 58 | void *s:地址。 59 | size_t n:填0个数。 60 | 61 | LCD屏幕: 62 | 1)尺寸:7寸(800*480) 63 | 总的像素点:800*480 64 | 每个像素点占用4byte 65 | ARGB 66 | 1byte -----> A ---->透明度(0x00) 67 | 1byte -----> R ---->红色 68 | 1byte -----> G ---->绿色 69 | 1byte -----> B ---->蓝色 70 | 71 | 1个LCD屏幕的像素显示纯绿色: 72 | A : R : G : B 73 | 0000 0000 : 0000 0000 : 1111 1111 : 0000 0000 74 | 75 | int color = 0x0000ff00; --->内存 76 | 77 | 78 | LCD屏幕显存显示颜色的区域占用总字节数=总的像素点*每个像素点占用的字节数 79 | =800*480*4byte 80 | 81 | 举例: 82 | 将1个LCD像素点的数据显示到LCD屏幕上。 83 | 编程思路: 84 | 1)打开LCD屏幕。open 85 | 一切皆文件。(/dev/fb0) 86 | int fd_fb0 = open(); 87 | 2)将内存中颜色数据放到显存上。 88 | mmap、munmap 89 | 90 | #include 91 | void *mmap(void *addr, size_t length, int prot, int flags, 92 | int fd, off_t offset); 93 | 参数的含义: 94 | void *addr: NULL。(表示由Linux系统内核自动分配一个起始地址) 95 | size_t length:映射空间的大小。800*480*4 96 | int prot:映射空间的属性设置。(PROT_READ|PROT_WRITE) 97 | PROT_EXEC Pages may be executed. 98 | PROT_READ Pages may be read. 99 | PROT_WRITE Pages may be written. 100 | PROT_NONE Pages may not be accessed. 101 | int flags:MAP_SHARED Share this mapping. 102 | int fd:文件描述符。(open的返回值fd_fb0) 103 | off_t offset:偏移量。0 104 | 返回值: 105 | 成功:返回一个指针指向映射区域的首地址。 106 | 失败: MAP_FAILED ---> (void *) -1 107 | 108 | int munmap(void *addr, size_t length); 109 | void *addr:分配映射空间的首地址。 110 | size_t length:释放空间的大小。 111 | 112 | 什么叫指针? 113 | 指针是只存储地址的变量。 114 | 115 | 3)关闭LCD屏幕。 116 | 117 | 练习5: 118 | 让整个LCD屏幕显示黄色。(R:G:B=255:255:0) 119 | 120 | 二、LCD屏幕显示24bitBMP图片。 121 | 1)BMP格式图片 122 | 123 | 1)BMP文件存储数据时,图像的扫描方式是按从左到右、从下到上的顺序。 124 | LCD屏幕显示数据时,图像的扫描方式是按从左到右、从上到下的顺序。 125 | 问题1: 126 | 颠倒图片 127 | 128 | 2)BMP文件由文件头、位图信息头、颜色信息和图形数据四部分组成。 129 | BMP文件头(14byte)数据结构含有BMP文件的类型、文件大小和位图起始位置等信息。 130 | 位图信息头(40byte)说明位图的尺寸等信息。 131 | 7) 19-22:位图宽度,以像素为单位。8000 0000,为00000080h=128。 132 |    8)23-26:位图高度,以像素为单位。9000 0000,为00000090h=144。 133 | 134 | 颜色信息和图形数据 --->颜色数据。 135 | typedef struct tagRGBQUAD { 136 |   BYTE rgbBlue;// 蓝色的亮度(值范围为0-255) 137 |   BYTE rgbGreen; // 绿色的亮度(值范围为0-255) 138 |   BYTE rgbRed; // 红色的亮度(值范围为0-255) 139 |   BYTE rgbReserved;// 保留,必须为0 140 |  } RGBQUAD; 141 | 142 | 当biBitCount=24时,1个BMP像素占3个字节; 143 | LCD屏幕1个像素点4byte 144 | 问题2: 145 | 800*480个BMP像素点变成800*480个LCD像素点。 146 | 147 | 一张24bitBMP格式图片的大小 = 尺寸* 每个像素点占用的空间大小 + 54byte 148 | main.bmp = 800*480*3byte + 54byte 149 | =1152054byte 150 | 举例: 151 | 显示800*480尺寸的24bitBMP格式图片到LCD屏幕上。 152 | 编程思路: 153 | 1)打开LCD屏幕,打开图片。 154 | 2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 155 | 1)去掉BMP图片的前54byte。 156 | 2)解决两个算法: 157 | 1)800*480个BMP像素点变成800*480个LCD像素点。 158 | char bmp_buf[800*480*3]; //char --->1byte 159 | int lcd_buf[800*480]; //int --->4byte 160 | 161 | read读取main.bmp中图像数据到bmp_buf。 162 | 163 | 164 | 2)颠倒图片。 165 | 3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 166 | 167 | 使用U盘挂载的方式将图片放到开发板/root/project/images 168 | 1)U盘文件系统一定是FAT32/FAT格式 169 | 2)挂在U盘,SercureCRT出现:sda: sda1,挂载成功。(/mnt/udisk/) 170 | [root@GEC6818 /]#cd /mnt/udisk/ 171 | [root@GEC6818 /mnt/udisk]#ls 172 | 20190701???? main.bmp 173 | System Volume Information 174 | [root@GEC6818 /mnt/udisk]#pwd 175 | /mnt/udisk 176 | [root@GEC6818 /mnt/udisk]# 177 | 178 | 3)复制main.bmp到/root/project/images 179 | [root@GEC6818 /mnt/udisk]#cp main.bmp /root/project/images/ 180 | [root@GEC6818 /mnt/udisk]#cd /root/project/images/ 181 | [root@GEC6818 ~/project/images]#ls 182 | main.bmp 183 | [root@GEC6818 ~/project/images]#ls -l 184 | total 1128 185 | -rwxr-xr-x 1 root root 1152054 Jan 1 00:03 main.bmp 186 | [root@GEC6818 ~/project/images]# 187 | 188 | 练习6: 189 | 显示800*480尺寸的24bitBMP格式图片到LCD屏幕上。 190 | 191 | -------------------------------------------------------------------------------- /Day2/read.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: open.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月01日 星期一 02时56分27秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | int main() 17 | { 18 | int fd = open("./Hello.txt",O_CREAT | O_RDWR ,0777); 19 | if(fd < 0) 20 | { 21 | printf("CREAT is error\n"); 22 | } 23 | printf("this FileScrib is %d\n",fd); 24 | 25 | char p[]="Hello,Technology!!!\n"; 26 | write(fd,p,sizeof(p)); 27 | 28 | close(fd); 29 | 30 | int ffd = open("./Hello.txt", O_RDWR); 31 | char buf[1024]; 32 | bzero(buf,sizeof(buf)); 33 | ssize_t r = read(ffd,buf,sizeof(buf)); 34 | if(r<0) 35 | { 36 | printf("read is eeror\n"); 37 | } 38 | printf("The read is: %s\n",buf); 39 | 40 | close(ffd); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /Day3/Login.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include //struct input_event 17 | 18 | int fd_event0; 19 | int fd_fb0; 20 | int buf_bmp; 21 | int buf_lcd; 22 | int fd_bmp; 23 | int fd_lcd; 24 | int *p_init = NULL; 25 | int *p_mmap = NULL; 26 | 27 | int exit_mmap(void) 28 | { 29 | munmap(p_init, 800*480*4); 30 | p_init = NULL; 31 | return 0; 32 | } 33 | 34 | int open_fb0(void) 35 | { 36 | fd_fb0 = open("/dev/fb0", O_RDWR); 37 | if(fd_fb0 == -1) 38 | { 39 | printf("open /dev/fb0 fail!\n"); 40 | return -1; 41 | } 42 | else{ 43 | printf("fd_fb0 = %d\n", fd_fb0); 44 | } 45 | return 0; 46 | } 47 | 48 | 49 | 50 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 51 | { 52 | int *p_mmap = NULL; 53 | p_mmap = p_init; 54 | 55 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 56 | 57 | int x, y; 58 | for(y=0; y=0 && coordinate.value<800) 103 | { 104 | *coordinate_x = coordinate.value; 105 | } 106 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 107 | { 108 | *coordinate_y = coordinate.value; 109 | } 110 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 111 | { 112 | break; 113 | } 114 | } 115 | 116 | return 0; 117 | } 118 | void input_pageMAIN() 119 | { 120 | //1)打开LCD屏幕,打开图片。 121 | fd_bmp = open("/root/project1/image/main.bmp",O_RDWR); 122 | fd_lcd = open("/dev/fb0",O_RDWR); 123 | if(fd_bmp < 0 || fd_lcd <0) 124 | { 125 | printf("BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 126 | return -1; 127 | } 128 | 129 | printf("BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 130 | int ret = lseek(fd_bmp, 54, SEEK_SET); 131 | if (ret < 0) 132 | { 133 | printf("lseek error %d\n",ret); 134 | return -2; 135 | } 136 | 137 | //2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 138 | 139 | 140 | p_init = mmap(NULL,800 * 480 * 4,PROT_READ | PROT_WRITE,MAP_SHARED,fd_lcd,0); 141 | p_mmap = p_init; 142 | 143 | //2-1)800*480个BMP像素点变成800*480个LCD像素点 144 | 145 | char buf_bmp[800*480*3]; 146 | int buf_lcd[800*480]; 147 | bzero(buf_bmp, sizeof(buf_bmp)); 148 | bzero(buf_lcd, sizeof(buf_lcd)); 149 | 150 | ret = read(fd_bmp, buf_bmp, sizeof(buf_bmp)); 151 | if (ret < 0) 152 | { 153 | printf("read error\n"); 154 | return -3; 155 | } 156 | 157 | char A = 0x00; 158 | int i = 0; 159 | for (i = 0; i<800 * 480; i++) 160 | { 161 | buf_lcd[i] = buf_bmp[i * 3] << 0 | buf_bmp[i * 3 + 1] << 8 | buf_bmp[i * 3 + 2] << 16 | A << 24; 162 | } 163 | 164 | //2-2)颠倒图片 165 | int xx = 0; 166 | int y = 0; 167 | for (xx = 479; xx >= 0; xx--) 168 | { 169 | for (y = 0; y<800; y++) 170 | { 171 | *p_mmap= buf_lcd[xx*800+y]; 172 | p_mmap++; 173 | 174 | } 175 | } 176 | } 177 | 178 | //arm6818_bmp800_480("/root/project/images/0.bmp", 10, 10, 40, 40); 179 | int arm6818_bmp800_480(const char *pathname, int coordinate_x, int coordinate_y, int height, int wide) 180 | { 181 | int fd_bmp = open(pathname, O_RDWR); 182 | if(fd_bmp == -1) 183 | { 184 | printf("open bmp fail!\n"); 185 | return -1; 186 | } 187 | 188 | lseek(fd_bmp, 54, SEEK_SET); 189 | 190 | char bmp_buf[height*wide*3]; 191 | int lcd_buf[height*wide]; 192 | bzero(bmp_buf, sizeof(bmp_buf)); 193 | bzero(lcd_buf, sizeof(lcd_buf)); 194 | 195 | read(fd_bmp, bmp_buf, sizeof(bmp_buf)); 196 | close(fd_bmp); 197 | 198 | int i; 199 | char A = 0x00; 200 | for(i=0; i20&&ts_x<110&&ts_y>150&&ts_y<200) 259 | { 260 | printf("Please input Account:\n"); 261 | 262 | //账号原点 263 | FLAG1: 264 | int ax=135; 265 | int ay= 152; 266 | int i = 0; 267 | while(1) 268 | { 269 | 270 | read_ts(&ts_x, &ts_y); 271 | //--> 272 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 273 | { 274 | input_account[i] = '\0'; 275 | printf("The Account is %s\n",input_account); 276 | break; 277 | } 278 | //<-- 279 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 280 | { 281 | ax-=40; 282 | if(ax < 135) 283 | { 284 | bzero(input_account,sizeof(input_account)); 285 | goto FLAG1; 286 | } 287 | arm6818_bmp800_480("/root/project1/image/q.bmp",ax,ay,40,40); 288 | --i; 289 | printf("delete a number!!!\n"); 290 | 291 | } 292 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 293 | { 294 | arm6818_bmp800_480("/root/project1/image/num1.bmp",ax,ay,40,40); 295 | ax+=40; 296 | input_account[i++]='1'; 297 | printf("1\n"); 298 | } 299 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 300 | { 301 | arm6818_bmp800_480("/root/project1/image/num2.bmp",ax,ay,40,40); 302 | ax+=40; 303 | input_account[i++]='2'; 304 | printf("2\n"); 305 | } 306 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 307 | { 308 | arm6818_bmp800_480("/root/project1/image/num3.bmp",ax,ay,40,40); 309 | ax+=40; 310 | input_account[i++]='3'; 311 | printf("3\n"); 312 | } 313 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 314 | { 315 | arm6818_bmp800_480("/root/project1/image/num4.bmp",ax,ay,40,40); 316 | ax+=40; 317 | input_account[i++]='4'; 318 | printf("4\n"); 319 | } 320 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 321 | { 322 | arm6818_bmp800_480("/root/project1/image/num5.bmp",ax,ay,40,40); 323 | ax+=40; 324 | input_account[i++]='5'; 325 | printf("5\n"); 326 | } 327 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 328 | { 329 | arm6818_bmp800_480("/root/project1/image/num6.bmp",ax,ay,40,40); 330 | ax+=40; 331 | input_account[i++]='6'; 332 | printf("6\n"); 333 | } 334 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 335 | { 336 | arm6818_bmp800_480("/root/project1/image/num7.bmp",ax,ay,40,40); 337 | ax+=40; 338 | input_account[i++]='7'; 339 | printf("7\n"); 340 | } 341 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 342 | { 343 | arm6818_bmp800_480("/root/project1/image/num8.bmp",ax,ay,40,40); 344 | ax+=40; 345 | input_account[i++]='8'; 346 | printf("8\n"); 347 | } 348 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 349 | { 350 | arm6818_bmp800_480("/root/project1/image/num9.bmp",ax,ay,40,40); 351 | ax+=40; 352 | input_account[i++]='9'; 353 | printf("9\n"); 354 | } 355 | } 356 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 357 | { 358 | printf("Please input Passwd:\n"); 359 | //密码原点 360 | FLAG2: 361 | int px=135; 362 | int py= 250; 363 | int i = 0; 364 | while(1) 365 | { 366 | 367 | read_ts(&ts_x, &ts_y); 368 | //---> 369 | if(ts_x>700&&ts_x<790&&ts_y>380&&ts_y<470) 370 | { 371 | input_passwd[i]='\0'; 372 | printf("Input Passwd is %s\n",input_passwd); 373 | num--; 374 | if(num <0) 375 | { 376 | printf("DEV IS SHUTDOWN NOW\n !!!"); 377 | arm6818_color(0x00000000,0,0,480,800); 378 | } 379 | else 380 | { 381 | //校验账号密码是否正确 382 | if((strcmp(account,input_account)==0)&&(strcmp(passwd,input_passwd)==0)) 383 | { 384 | arm6818_color(0x0000ff00,0,0,480,800); 385 | sleep(1); 386 | arm6818_bmp800_480("/root/project1/image/right.bmp",0,0,480,800); 387 | } 388 | else 389 | { 390 | arm6818_color(0x00ff0000,0,0,480,800); 391 | sleep(1); 392 | arm6818_bmp800_480("/root/project1/image/main.bmp",0,0,480,800); 393 | goto FLAG; 394 | printf("Passwd is error \n!!!"); 395 | } 396 | 397 | } 398 | 399 | return 0; 400 | } 401 | //<-- 402 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 403 | { 404 | px-=40; 405 | if(px < 0) 406 | { 407 | bzero(input_passwd,sizeof(input_passwd)); 408 | goto FLAG2; 409 | } 410 | arm6818_bmp800_480("/root/project1/image/q.bmp",px,py,40,40); 411 | --i; 412 | printf("delete a number!!!\n"); 413 | 414 | } 415 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 416 | { 417 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 418 | px+=40; 419 | input_passwd[i++]='1'; 420 | printf("1\n"); 421 | } 422 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 423 | { 424 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 425 | px+=40; 426 | input_passwd[i++]='2'; 427 | printf("2\n"); 428 | } 429 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 430 | { 431 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 432 | px+=40; 433 | input_passwd[i++]='3'; 434 | printf("3\n"); 435 | } 436 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 437 | { 438 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 439 | px+=40; 440 | input_passwd[i++]='4'; 441 | printf("4\n"); 442 | } 443 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 444 | { 445 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 446 | px+=40; 447 | input_passwd[i++]='5'; 448 | printf("5\n"); 449 | } 450 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 451 | { 452 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 453 | px+=40; 454 | input_passwd[i++]='6'; 455 | printf("6\n"); 456 | } 457 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 458 | { 459 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 460 | px+=40; 461 | input_passwd[i++]='7'; 462 | printf("7\n"); 463 | } 464 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 465 | { 466 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 467 | px+=40; 468 | input_passwd[i++]='8'; 469 | printf("8\n"); 470 | } 471 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 472 | { 473 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 474 | px+=40; 475 | input_passwd[i++]='9'; 476 | printf("9\n"); 477 | } 478 | } 479 | 480 | } 481 | } 482 | else 483 | { 484 | printf("Please input Account !!!\n"); 485 | } 486 | } 487 | 488 | 489 | //3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 490 | exit_mmap(); 491 | close_fd(); 492 | 493 | return 0; 494 | } 495 | -------------------------------------------------------------------------------- /Day3/TouchScreen.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ************************************************************************/ 7 | 8 | #include //printf 9 | #include //open 10 | #include //open 11 | #include //open 12 | #include //close 13 | #include //struct input_event 14 | #include 15 | 16 | int fd_event0; 17 | int fd_fb0; 18 | int *p_init = NULL; 19 | 20 | int init_mmap(void) 21 | { 22 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 23 | if(p_init == MAP_FAILED) 24 | { 25 | printf("mmap fail!\n"); 26 | return -1; 27 | } 28 | 29 | return 0; 30 | } 31 | 32 | int exit_mmap(void) 33 | { 34 | munmap(p_init, 800*480*4); 35 | p_init = NULL; 36 | return 0; 37 | } 38 | 39 | int open_fb0(void) 40 | { 41 | fd_fb0 = open("/dev/fb0", O_RDWR); 42 | if(fd_fb0 == -1) 43 | { 44 | printf("open /dev/fb0 fail!\n"); 45 | return -1; 46 | } 47 | else{ 48 | printf("fd_fb0 = %d\n", fd_fb0); 49 | } 50 | return 0; 51 | } 52 | 53 | int close_fb0(void) 54 | { 55 | close(fd_fb0); 56 | return 0; 57 | } 58 | 59 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 60 | { 61 | int *p_mmap = NULL; 62 | p_mmap = p_init; 63 | 64 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 65 | 66 | int x, y; 67 | for(y=0; y=0 && coordinate.value<800) 112 | { 113 | *coordinate_x = coordinate.value; 114 | } 115 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 116 | { 117 | *coordinate_y = coordinate.value; 118 | } 119 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 120 | { 121 | break; 122 | } 123 | } 124 | 125 | 126 | 127 | return 0; 128 | } 129 | 130 | int close_ts(void) 131 | { 132 | close(fd_event0); 133 | return 0; 134 | } 135 | 136 | int main(void) 137 | { 138 | int ts_x, ts_y; 139 | int red=-1; 140 | int green = -1; 141 | int blue = -1; 142 | 143 | open_ts(); 144 | 145 | open_fb0(); 146 | init_mmap(); 147 | 148 | while(1) 149 | { 150 | read_ts(&ts_x, &ts_y); 151 | printf("The X/Y is: (x,y)--->(%d, %d)\n", ts_x, ts_y); 152 | if(ts_x>0&&ts_x<200&&ts_y>0&&ts_y<480) 153 | { 154 | red = -red; 155 | if(red>0) 156 | arm6818_color(0x00ff0000, 0,0 , 480, 200); 157 | else 158 | arm6818_color(0xffffffff,0,0,480,200); 159 | } 160 | else if(ts_x>200&&ts_x<600&&ts_y>0&&ts_y<480) 161 | { 162 | green = -green; 163 | if(green>0) 164 | arm6818_color(0x0000ff00, 200,0 , 480, 400); 165 | else 166 | arm6818_color(0xffffffff,200,0,480,400); 167 | } 168 | else if(ts_x>600&&ts_x<800&&ts_y>0&&ts_y<480) 169 | { 170 | blue = -blue; 171 | if(blue>0) 172 | arm6818_color(0x000000ff, 600,0 , 480, 200); 173 | else 174 | arm6818_color(0xffffffff,600,0,480,200); 175 | } 176 | } 177 | 178 | close_ts(); 179 | close_fb0(); 180 | exit_mmap(); 181 | return 0; 182 | } 183 | -------------------------------------------------------------------------------- /Day3/code/bmp.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //mmap、munmap 7 | #include //bzero 8 | 9 | int fd_fb0; 10 | int *p_init = NULL; 11 | 12 | int init_mmap(void) 13 | { 14 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 15 | if(p_init == MAP_FAILED) 16 | { 17 | printf("mmap fail!\n"); 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int exit_mmap(void) 25 | { 26 | munmap(p_init, 800*480*4); 27 | p_init = NULL; 28 | return 0; 29 | } 30 | 31 | int open_fb0(void) 32 | { 33 | fd_fb0 = open("/dev/fb0", O_RDWR); 34 | if(fd_fb0 == -1) 35 | { 36 | printf("open /dev/fb0 fail!\n"); 37 | return -1; 38 | } 39 | else{ 40 | printf("fd_fb0 = %d\n", fd_fb0); 41 | } 42 | return 0; 43 | } 44 | 45 | int close_fb0(void) 46 | { 47 | close(fd_fb0); 48 | return 0; 49 | } 50 | 51 | int arm6818_bmp800_480(const char *pathname, int coordinate_x, int coordinate_y, int height, int wide) 52 | { 53 | int fd_bmp = open(pathname, O_RDWR); 54 | if(fd_bmp == -1) 55 | { 56 | printf("open bmp fail!\n"); 57 | return -1; 58 | } 59 | else{ 60 | printf("fd_bmp = %d\n", fd_bmp); 61 | } 62 | 63 | lseek(fd_bmp, 54, SEEK_SET); 64 | 65 | char bmp_buf[height*wide*3]; 66 | int lcd_buf[height*wide]; 67 | bzero(bmp_buf, sizeof(bmp_buf)); 68 | bzero(lcd_buf, sizeof(lcd_buf)); 69 | 70 | read(fd_bmp, bmp_buf, sizeof(bmp_buf)); 71 | close(fd_bmp); 72 | 73 | int i; 74 | char A = 0x00; 75 | for(i=0; i//printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //mmap、munmap 7 | 8 | int fd_fb0; 9 | int *p_init = NULL; 10 | 11 | int init_mmap(void) 12 | { 13 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 14 | if(p_init == MAP_FAILED) 15 | { 16 | printf("mmap fail!\n"); 17 | return -1; 18 | } 19 | 20 | return 0; 21 | } 22 | 23 | int exit_mmap(void) 24 | { 25 | munmap(p_init, 800*480*4); 26 | p_init = NULL; 27 | return 0; 28 | } 29 | 30 | int open_fb0(void) 31 | { 32 | fd_fb0 = open("/dev/fb0", O_RDWR); 33 | if(fd_fb0 == -1) 34 | { 35 | printf("open /dev/fb0 fail!\n"); 36 | return -1; 37 | } 38 | else{ 39 | printf("fd_fb0 = %d\n", fd_fb0); 40 | } 41 | return 0; 42 | } 43 | 44 | int close_fb0(void) 45 | { 46 | close(fd_fb0); 47 | return 0; 48 | } 49 | 50 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 51 | { 52 | int *p_mmap = NULL; 53 | p_mmap = p_init; 54 | 55 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 56 | 57 | int x, y; 58 | for(y=0; y//printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close、sleep 6 | #include //mmap、munmap 7 | #include 8 | 9 | int fd_fb0; 10 | int *p_init = NULL; 11 | 12 | int init_mmap(void) 13 | { 14 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 15 | if(p_init == MAP_FAILED) 16 | { 17 | printf("mmap fail!\n"); 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int exit_mmap(void) 25 | { 26 | munmap(p_init, 800*480*4); 27 | p_init = NULL; 28 | return 0; 29 | } 30 | 31 | int open_fb0(void) 32 | { 33 | fd_fb0 = open("/dev/fb0", O_RDWR); 34 | if(fd_fb0 == -1) 35 | { 36 | printf("open /dev/fb0 fail!\n"); 37 | return -1; 38 | } 39 | else{ 40 | printf("fd_fb0 = %d\n", fd_fb0); 41 | } 42 | return 0; 43 | } 44 | 45 | int close_fb0(void) 46 | { 47 | close(fd_fb0); 48 | return 0; 49 | } 50 | 51 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 52 | { 53 | int *p_mmap = NULL; 54 | p_mmap = p_init; 55 | 56 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 57 | 58 | int x, y; 59 | for(y=0; y//printf 2 | #include //strcmp 3 | 4 | int main(void) 5 | { 6 | char login_account[7] = "123456"; 7 | char login_password[7] = "123456"; 8 | 9 | char input_password[7] = "12345"; 10 | 11 | if(strcmp(login_password, input_password) == 0) 12 | { 13 | printf("equal!\n"); 14 | } 15 | else{ 16 | printf("no equal!\n"); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /Day3/code/touch_screen.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //struct input_event 7 | 8 | int fd_event0; 9 | 10 | int open_ts(void) 11 | { 12 | 13 | fd_event0 = open("/dev/input/event0", O_RDWR); 14 | if(fd_event0 == -1) 15 | { 16 | printf("open event0 fail!\n"); 17 | return -1; 18 | } 19 | else{ 20 | printf("fd_event0 = %d\n", fd_event0); 21 | } 22 | return 0; 23 | } 24 | 25 | int read_ts(int *coordinate_x, int *coordinate_y) 26 | { 27 | struct input_event coordinate; 28 | while(1) 29 | { 30 | read(fd_event0, &coordinate, sizeof(struct input_event)); 31 | //printf("type:%d; code:%d; value:%d\n", coordinate.type, coordinate.code, coordinate.value); 32 | /* 33 | type:3; code:0; value:457//X轴坐标轴 34 | type:3; code:1; value:349//Y轴坐标轴 35 | type:3; code:24; value:200 36 | type:1; code:330; value:1 37 | type:0; code:0; value:0 38 | type:3; code:24; value:0 39 | type:1; code:330; value:0 40 | type:0; code:0; value:0 41 | */ 42 | if(coordinate.type==3 && coordinate.code==0 && coordinate.value>=0 && coordinate.value<800) 43 | { 44 | *coordinate_x = coordinate.value; 45 | } 46 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 47 | { 48 | *coordinate_y = coordinate.value; 49 | } 50 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 51 | { 52 | break; 53 | } 54 | } 55 | 56 | 57 | 58 | return 0; 59 | } 60 | 61 | int close_ts(void) 62 | { 63 | close(fd_event0); 64 | return 0; 65 | } 66 | 67 | int main(void) 68 | { 69 | int ts_x, ts_y; 70 | open_ts(); 71 | 72 | while(1) 73 | { 74 | read_ts(&ts_x, &ts_y); 75 | printf("(x,y):(%d, %d)\n", ts_x, ts_y); 76 | } 77 | 78 | close_ts(); 79 | return 0; 80 | } -------------------------------------------------------------------------------- /Day3/file/ui/num0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num0.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num1.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num10.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num2.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num3.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num4.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num5.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num6.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num7.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num8.bmp -------------------------------------------------------------------------------- /Day3/file/ui/num9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/num9.bmp -------------------------------------------------------------------------------- /Day3/file/ui/password.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/file/ui/password.bmp -------------------------------------------------------------------------------- /Day3/images/显示颜色的优化.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/images/显示颜色的优化.bmp -------------------------------------------------------------------------------- /Day3/note.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day3/note.txt -------------------------------------------------------------------------------- /Day3/pthread.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close、sleep 6 | #include //mmap、munmap 7 | #include 8 | 9 | int fd_fb0; 10 | int *p_init = NULL; 11 | 12 | int init_mmap(void) 13 | { 14 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 15 | if(p_init == MAP_FAILED) 16 | { 17 | printf("mmap fail!\n"); 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int exit_mmap(void) 25 | { 26 | munmap(p_init, 800*480*4); 27 | p_init = NULL; 28 | return 0; 29 | } 30 | 31 | int open_fb0(void) 32 | { 33 | fd_fb0 = open("/dev/fb0", O_RDWR); 34 | if(fd_fb0 == -1) 35 | { 36 | printf("open /dev/fb0 fail!\n"); 37 | return -1; 38 | } 39 | else{ 40 | printf("fd_fb0 = %d\n", fd_fb0); 41 | } 42 | return 0; 43 | } 44 | 45 | int close_fb0(void) 46 | { 47 | close(fd_fb0); 48 | return 0; 49 | } 50 | 51 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 52 | { 53 | int *p_mmap = NULL; 54 | p_mmap = p_init; 55 | 56 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 57 | 58 | int x, y; 59 | for(y=0; y//printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //mmap、munmap 7 | #include //bzero 8 | 9 | int fd_fb0; 10 | int *p_init = NULL; 11 | 12 | int init_mmap(void) 13 | { 14 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 15 | if(p_init == MAP_FAILED) 16 | { 17 | printf("mmap fail!\n"); 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int exit_mmap(void) 25 | { 26 | munmap(p_init, 800*480*4); 27 | p_init = NULL; 28 | return 0; 29 | } 30 | 31 | int open_fb0(void) 32 | { 33 | fd_fb0 = open("/dev/fb0", O_RDWR); 34 | if(fd_fb0 == -1) 35 | { 36 | printf("open /dev/fb0 fail!\n"); 37 | return -1; 38 | } 39 | else{ 40 | printf("fd_fb0 = %d\n", fd_fb0); 41 | } 42 | return 0; 43 | } 44 | 45 | int close_fb0(void) 46 | { 47 | close(fd_fb0); 48 | return 0; 49 | } 50 | 51 | int arm6818_bmp800_480(const char *pathname, int coordinate_x, int coordinate_y, int height, int wide) 52 | { 53 | int fd_bmp = open(pathname, O_RDWR); 54 | if(fd_bmp == -1) 55 | { 56 | printf("open bmp fail!\n"); 57 | return -1; 58 | } 59 | else{ 60 | printf("fd_bmp = %d\n", fd_bmp); 61 | } 62 | 63 | lseek(fd_bmp, 54, SEEK_SET); 64 | 65 | char bmp_buf[height*wide*3]; 66 | int lcd_buf[height*wide]; 67 | bzero(bmp_buf, sizeof(bmp_buf)); 68 | bzero(lcd_buf, sizeof(lcd_buf)); 69 | 70 | read(fd_bmp, bmp_buf, sizeof(bmp_buf)); 71 | close(fd_bmp); 72 | 73 | int i; 74 | char A = 0x00; 75 | for(i=0; i//printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //mmap、munmap 7 | 8 | int fd_fb0; 9 | int *p_init = NULL; 10 | 11 | int init_mmap(void) 12 | { 13 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 14 | if(p_init == MAP_FAILED) 15 | { 16 | printf("mmap fail!\n"); 17 | return -1; 18 | } 19 | 20 | return 0; 21 | } 22 | 23 | int exit_mmap(void) 24 | { 25 | munmap(p_init, 800*480*4); 26 | p_init = NULL; 27 | return 0; 28 | } 29 | 30 | int open_fb0(void) 31 | { 32 | fd_fb0 = open("/dev/fb0", O_RDWR); 33 | if(fd_fb0 == -1) 34 | { 35 | printf("open /dev/fb0 fail!\n"); 36 | return -1; 37 | } 38 | else{ 39 | printf("fd_fb0 = %d\n", fd_fb0); 40 | } 41 | return 0; 42 | } 43 | 44 | int close_fb0(void) 45 | { 46 | close(fd_fb0); 47 | return 0; 48 | } 49 | 50 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 51 | { 52 | int *p_mmap = NULL; 53 | p_mmap = p_init; 54 | 55 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 56 | 57 | int x, y; 58 | for(y=0; y//printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close、sleep 6 | #include //mmap、munmap 7 | #include 8 | 9 | int fd_fb0; 10 | int *p_init = NULL; 11 | 12 | int init_mmap(void) 13 | { 14 | p_init = mmap(NULL,800*480*4, PROT_READ|PROT_WRITE, MAP_SHARED, fd_fb0, 0); 15 | if(p_init == MAP_FAILED) 16 | { 17 | printf("mmap fail!\n"); 18 | return -1; 19 | } 20 | 21 | return 0; 22 | } 23 | 24 | int exit_mmap(void) 25 | { 26 | munmap(p_init, 800*480*4); 27 | p_init = NULL; 28 | return 0; 29 | } 30 | 31 | int open_fb0(void) 32 | { 33 | fd_fb0 = open("/dev/fb0", O_RDWR); 34 | if(fd_fb0 == -1) 35 | { 36 | printf("open /dev/fb0 fail!\n"); 37 | return -1; 38 | } 39 | else{ 40 | printf("fd_fb0 = %d\n", fd_fb0); 41 | } 42 | return 0; 43 | } 44 | 45 | int close_fb0(void) 46 | { 47 | close(fd_fb0); 48 | return 0; 49 | } 50 | 51 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 52 | { 53 | int *p_mmap = NULL; 54 | p_mmap = p_init; 55 | 56 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 57 | 58 | int x, y; 59 | for(y=0; y//printf 2 | #include //strcmp 3 | 4 | int main(void) 5 | { 6 | char login_account[7] = "123456"; 7 | char login_password[7] = "123456"; 8 | 9 | char input_password[7] = "12345"; 10 | 11 | if(strcmp(login_password, input_password) == 0) 12 | { 13 | printf("equal!\n"); 14 | } 15 | else{ 16 | printf("no equal!\n"); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /Day4/code/touch_screen.c: -------------------------------------------------------------------------------- 1 | #include //printf 2 | #include //open 3 | #include //open 4 | #include //open 5 | #include //close 6 | #include //struct input_event 7 | 8 | int fd_event0; 9 | 10 | int open_ts(void) 11 | { 12 | 13 | fd_event0 = open("/dev/input/event0", O_RDWR); 14 | if(fd_event0 == -1) 15 | { 16 | printf("open event0 fail!\n"); 17 | return -1; 18 | } 19 | else{ 20 | printf("fd_event0 = %d\n", fd_event0); 21 | } 22 | return 0; 23 | } 24 | 25 | int read_ts(int *coordinate_x, int *coordinate_y) 26 | { 27 | struct input_event coordinate; 28 | while(1) 29 | { 30 | read(fd_event0, &coordinate, sizeof(struct input_event)); 31 | //printf("type:%d; code:%d; value:%d\n", coordinate.type, coordinate.code, coordinate.value); 32 | /* 33 | type:3; code:0; value:457//X轴坐标轴 34 | type:3; code:1; value:349//Y轴坐标轴 35 | type:3; code:24; value:200 36 | type:1; code:330; value:1 37 | type:0; code:0; value:0 38 | type:3; code:24; value:0 39 | type:1; code:330; value:0 40 | type:0; code:0; value:0 41 | */ 42 | if(coordinate.type==3 && coordinate.code==0 && coordinate.value>=0 && coordinate.value<800) 43 | { 44 | *coordinate_x = coordinate.value; 45 | } 46 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 47 | { 48 | *coordinate_y = coordinate.value; 49 | } 50 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 51 | { 52 | break; 53 | } 54 | } 55 | 56 | 57 | 58 | return 0; 59 | } 60 | 61 | int close_ts(void) 62 | { 63 | close(fd_event0); 64 | return 0; 65 | } 66 | 67 | int main(void) 68 | { 69 | int ts_x, ts_y; 70 | open_ts(); 71 | 72 | while(1) 73 | { 74 | read_ts(&ts_x, &ts_y); 75 | printf("(x,y):(%d, %d)\n", ts_x, ts_y); 76 | } 77 | 78 | close_ts(); 79 | return 0; 80 | } -------------------------------------------------------------------------------- /Day4/file/ui/num0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num0.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num1.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num10.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num2.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num3.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num4.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num5.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num6.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num7.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num8.bmp -------------------------------------------------------------------------------- /Day4/file/ui/num9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/num9.bmp -------------------------------------------------------------------------------- /Day4/file/ui/password.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/file/ui/password.bmp -------------------------------------------------------------------------------- /Day4/images/显示颜色的优化.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day4/images/显示颜色的优化.bmp -------------------------------------------------------------------------------- /Day4/note.txt: -------------------------------------------------------------------------------- 1 | 20190704主要讲解知识点: 2 | 1)实时时间的显示。 3 | 2)摄像头的移植。 4 | 5 | 6 | 7 | 8 | 9 | 10 | 一、实时时间的显示 11 | 1)查看系统时间date 12 | 2)通过终端命令修改时间。 13 | 年月日: date -s 2019-7-4 14 | 时分秒: date -s 09:13:30 15 | 3)使用函数进行时间的设置。 16 | system 17 | 功能:执行终端的shell命令。 18 | #include 19 | int system(const char *command); 20 | const char *command:终端的shell命令。 21 | 22 | system("date -s 2019-7-4"); 23 | system("date -s 09:13:30"); 24 | 25 | 4)time、ctime 26 | man -f time 27 | man -f ctime 28 | 29 | man 3 time 30 | 31 | 1)Notpad++:进行C语言源程序的编辑。 32 | 2)SercureCRT:进行GEC6818开发板的控制及程序的下载。 33 | 3)VMware-Workstation10:实现Windows系统和Linux系统双个系统的运行。 34 | 4)Ubuntu12.04:视频监控系统开发的系统平台。 35 | time - get time 36 | #include 37 | time_t time(time_t *tloc); 38 | time_t *tloc:存储获取到的时间的地址。 39 | 返回值:成功:获取到的时间。 40 | 41 | ctime 42 | man 3 ctime 43 | 功能:将time函数获取到的十进制的时间转化成字符串。 44 | #include 45 | char *ctime(const time_t *timep); 46 | const time_t *timep:存储十进制的时间地址。 47 | 返回值:成功 返回转化后的时间字符串 48 | 49 | //"Wed Jul 3 18:39:17 PDT 2019" 50 | 系统要求时间显示格式: 51 | 09:41:50 52 | 2019-7-4 53 | 54 | 思路:对"Wed Jul 3 18:39:17 PDT 2019"字符串进行切割与组合。 55 | 切割:strtok 56 | 组合: sprintf 57 | 58 | man -f strtok 59 | #include 60 | char *strtok(char *str, const char *delim); 61 | char *str:要切割的字符串的地址。 62 | const char *delim:切割的方式(' '、'-'、'\'、':'……) 63 | 返回值:成功 放回切割后的字符串。 64 | 65 | sprintf 66 | #include 67 | int sprintf(char *str, const char *format, const char *format); 68 | char *str:拼接后新的字符串存储的地址。 69 | const char *format:拼接的字符串1. 70 | const char *format:拼接的字符串2. 71 | 72 | 4)使用字库显示时间到LCD屏幕上。 73 | 举例:参考font文件夹中的程序 74 | arm-linux-gcc main.c -o armmain -L./ -lfont 75 | 76 | 在Linux系统中有静态库(.a)和动态库(.so) 77 | libfont.a --->静态库 78 | 库的命名规则:前缀+库名称+后缀 79 | 前缀:lib 80 | 库名称:font 81 | 后缀:.a 82 | 83 | 练习10: 84 | 实时显示时间在LCD屏幕上。 85 | 10:49:51 86 | 2019-7-4 87 | 88 | 二、头文件的制作。 89 | 函数的定义、调用及声明。 90 | 1)创建一个main.c程序,将具体某一个功能进行函数封装。 91 | 2)分别在创建两个文件。(同名不同格式的文件.c/.h) 92 | 3)将函数的定义放到.c文件中,将函数的声明和函数用到的头文件放到.h文件中。 93 | 94 | 注意:编译时需要一起编译所有.c文件。 95 | 96 | 练习11: 97 | 根据bmp文件夹制作touch_screen.h和touch_screen.c的头文件,在main.c文件中调用,实现坐标的连续获取。 98 | 99 | 三、摄像头的移植。 100 | 1)查看摄像头的设备文件。 101 | 1)不插摄像头,切换路径到/dev/目录中 102 | cd /dev/ 103 | ls 104 | 105 | video0 106 | video1 107 | video2 108 | video3 109 | video4 110 | video5 111 | video6 112 | 2)插摄像头,切换路径到/dev/目录中 113 | video0 114 | video1 115 | video2 116 | video3 117 | video4 118 | video5 119 | video6 120 | video7 121 | 通过比较确认设备文件路径:/dev/video7 122 | 3) 更改camera.c中的设备路径。 123 | 4)编译程序。 124 | arm-linux-gcc *.c -o armmain -I./jpeg -L./jpeg -ljpeg -lapi_v4l2_arm -pthread 125 | 5)用U盘下载libapi_v4l2_arm.so、libjpeg.so、 libjpeg.so.8.3.0到/root/project/lib 126 | 6)复制libapi_v4l2_arm.so、libjpeg.so、 libjpeg.so.8.3.0到/lib/ 127 | 128 | 四、整体系统的优化与移植 129 | 用到的库 130 | libfont.a 131 | libapi_v4l2_arm.so 132 | libjpeg.so 133 | 总的编译命令: 134 | arm-linux-gcc *.c -o armmain -I./jpeg -L./jpeg -ljpeg -lapi_v4l2_arm -L./ -lfont -pthread 135 | 136 | 最好建一个文件夹project_v1 137 | project_v2 138 | …… 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/10.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/fanhui.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/fanhui.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/main.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/main.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num0.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num1.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num10.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num2.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num3.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num4.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num5.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num6.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num7.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num8.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/num9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/num9.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/password.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/password.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/q.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/q.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/q.png -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/welcome.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/welcome.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/图片素材/zhongjian.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/图片素材/zhongjian.bmp -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/Makefile: -------------------------------------------------------------------------------- 1 | main:main.c camera.c 2 | 3 | arm-linux-gcc -w $^ -o $@ -I./jpeg -L./jpeg -ljpeg -lapi_v4l2_arm -L./ -lfont -lpthread 4 | .PHONY:clean 5 | clean: 6 | rm -rf main 7 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/camera.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/camera.c -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/camera.h: -------------------------------------------------------------------------------- 1 | #ifndef __CAMERA_H__ 2 | #define __CAMERA_H__ 3 | 4 | #include 5 | #include "jpeglib.h" 6 | #include "camera.h" 7 | #include "yuyv.h" 8 | 9 | 10 | #define LCD_WIDTH 800 11 | #define LCD_HEIGHT 480 12 | #define FB_SIZE (LCD_WIDTH * LCD_HEIGHT * 4) 13 | 14 | typedef struct VideoBuffer { 15 | void *start; //映射到用户空间的地址 16 | size_t length; //采集到数据的长度 17 | } VideoBuffer1; //存放采集数据的位置 18 | 19 | #define BUFFER_COUNT 4 20 | VideoBuffer1 framebuf[BUFFER_COUNT]; 21 | 22 | //函数声明 23 | extern unsigned long file_size_get(const char *pfile_path); 24 | extern void lcd_close(void); 25 | extern int show_video_data(unsigned int x,unsigned int y,char *pjpg_buf,unsigned int jpg_buf_size); 26 | extern int lcd_draw_jpg(unsigned int x,unsigned int y,const char *pjpg_path); 27 | extern void lcd_draw_point(unsigned int x,unsigned int y, unsigned int color); 28 | extern int mmap_lcd(void); 29 | extern int lcd_open(void); 30 | 31 | #endif -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/font.h: -------------------------------------------------------------------------------- 1 | #ifndef __FONT__ 2 | #define __FONT__ 3 | 4 | extern int Init_Font(void); //显示字体库前先调用本函数进行初始化 5 | 6 | extern void UnInit_Font(void); //程序退出前,调用本函数 7 | 8 | extern int Clean_Area(int X,//x坐标起始点 9 | int Y,//y坐标起始点 10 | int width,//绘制的宽度 11 | int height,//绘制的高度 12 | unsigned long color);//往屏幕指定区域填充颜色 13 | 14 | extern int Display_characterX(unsigned int x,//x坐标起始点 15 | unsigned int y,//y坐标起始点 16 | unsigned char *string,//GB2312 中文字符串 17 | unsigned int color ,//字体颜色值 18 | int size);//字体放大倍数 1~8 19 | #endif -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/api_v4l2.h: -------------------------------------------------------------------------------- 1 | /************************************************* 2 | File name : api_v4l2.h 3 | Create date : 2014-07-01 19:42 4 | Modified date : 2014-07-01 19:42 5 | Author : heqingde 6 | Email : hqd173@163.com 7 | 8 | ***********************************************/ 9 | #ifndef API_V4L2_H_ 10 | #define API_V4L2_H_ 11 | 12 | #define VIDEO_WIDTH 640 13 | #define VIDEO_HEIGHT 480 14 | #define MAX_CAM_RES 32 //camres res 15 | #define BUFFER_COUNT 4 //buffer zone 16 | #define FPS 30 17 | #define MAX_CAM_RES 32 18 | //#define CAMERA_DEVICE "/dev/video1" 19 | 20 | #define exit_error(s)\ 21 | do{\ 22 | printf("%s is error\n",s);\ 23 | return (-1);\ 24 | }while(0) 25 | 26 | 27 | /********************************* 28 | * NAME:VideoBuffer struct 29 | * Function: Describe buffer V4L2 driver assigns and maps 30 | * Member: start: point of buffer 31 | * length: total length of buffer 32 | **********************************/ 33 | typedef struct Video_Buffer 34 | { 35 | void *start; 36 | int length; 37 | }VideoBuffer; 38 | /******************************* 39 | * nan=me :fream_buffer 40 | * Function: save fream 41 | * member: buf :point of buf 42 | * length:total length op buf 43 | ********************************/ 44 | typedef struct Frame_Buffer 45 | { 46 | char buf[1843200]; 47 | int length; 48 | 49 | }FrameBuffer; 50 | /************************************ 51 | *name:CamRes 52 | *Function:CamRes format 53 | *Member: width : format width 54 | *height: format height 55 | */ 56 | typedef struct CamRes 57 | { 58 | int width; 59 | int height; 60 | }CamRes; 61 | /************************************* 62 | *name:CamResList struct 63 | *Function:CamRes format list 64 | *Member: cam_res :struct CamRes 65 | *res_num:camres format number 66 | */ 67 | typedef struct CamResList 68 | { 69 | struct CamRes *cam_res; 70 | int res_num; 71 | }CamResList; 72 | 73 | /************************************* 74 | *name:device_init 75 | *Function:Initial Camera v4l2 76 | */ 77 | int linux_v4l2_device_init(const char *dev); 78 | 79 | /************************************ 80 | *name:start_capturing 81 | *Function: starting Capture Options 82 | */ 83 | int linux_v4l2_start_capturing(); 84 | 85 | /************************************ 86 | *name:stop_capturing 87 | *Function: stop Capture Options 88 | */ 89 | int linux_v4l2_stop_capturing(); 90 | 91 | /************************************ 92 | *name :device_uinit 93 | *Function:uinit device 94 | */ 95 | int linux_v4l2_device_uinit(); 96 | /************************************ 97 | *name :linux_v4l2_get_fream 98 | *Function:save device_stream data; 99 | */ 100 | int linux_v4l2_get_fream(FrameBuffer *freambuf); 101 | #endif /*API_V4L2_H*/ 102 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.h. Generated from jconfig.cfg by configure. */ 2 | /* jconfig.cfg --- source file edited by configure script */ 3 | /* see jconfig.txt for explanations */ 4 | 5 | #define HAVE_PROTOTYPES 1 6 | #define HAVE_UNSIGNED_CHAR 1 7 | #define HAVE_UNSIGNED_SHORT 1 8 | /* #undef void */ 9 | /* #undef const */ 10 | /* #undef CHAR_IS_UNSIGNED */ 11 | #define HAVE_STDDEF_H 1 12 | #define HAVE_STDLIB_H 1 13 | #define HAVE_LOCALE_H 1 14 | /* #undef NEED_BSD_STRINGS */ 15 | /* #undef NEED_SYS_TYPES_H */ 16 | /* #undef NEED_FAR_POINTERS */ 17 | /* #undef NEED_SHORT_EXTERNAL_NAMES */ 18 | /* Define this if you get warnings about undefined structures. */ 19 | /* #undef INCOMPLETE_TYPES_BROKEN */ 20 | 21 | /* Define "boolean" as unsigned char, not int, on Windows systems. */ 22 | #ifdef _WIN32 23 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 24 | typedef unsigned char boolean; 25 | #endif 26 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 27 | #endif 28 | 29 | #ifdef JPEG_INTERNALS 30 | 31 | /* #undef RIGHT_SHIFT_IS_UNSIGNED */ 32 | #define INLINE __inline__ 33 | /* These are for configuring the JPEG memory manager. */ 34 | /* #undef DEFAULT_MAX_MEM */ 35 | /* #undef NO_MKTEMP */ 36 | 37 | #endif /* JPEG_INTERNALS */ 38 | 39 | #ifdef JPEG_CJPEG_DJPEG 40 | 41 | #define BMP_SUPPORTED /* BMP image file format */ 42 | #define GIF_SUPPORTED /* GIF image file format */ 43 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 44 | /* #undef RLE_SUPPORTED */ 45 | #define TARGA_SUPPORTED /* Targa image file format */ 46 | 47 | /* #undef TWO_FILE_COMMANDLINE */ 48 | /* #undef NEED_SIGNAL_CATCHER */ 49 | /* #undef DONT_USE_B_MODE */ 50 | 51 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 52 | /* #undef PROGRESS_REPORT */ 53 | 54 | #endif /* JPEG_CJPEG_DJPEG */ 55 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/jerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jerror.h 3 | * 4 | * Copyright (C) 1994-1997, Thomas G. Lane. 5 | * Modified 1997-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file defines the error and message codes for the JPEG library. 10 | * Edit this file to add new codes, or to translate the message strings to 11 | * some other language. 12 | * A set of error-reporting macros are defined too. Some applications using 13 | * the JPEG library may wish to include this file to get the error codes 14 | * and/or the macros. 15 | */ 16 | 17 | /* 18 | * To define the enum list of message codes, include this file without 19 | * defining macro JMESSAGE. To create a message string table, include it 20 | * again with a suitable JMESSAGE definition (see jerror.c for an example). 21 | */ 22 | #ifndef JMESSAGE 23 | #ifndef JERROR_H 24 | /* First time through, define the enum list */ 25 | #define JMAKE_ENUM_LIST 26 | #else 27 | /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ 28 | #define JMESSAGE(code,string) 29 | #endif /* JERROR_H */ 30 | #endif /* JMESSAGE */ 31 | 32 | #ifdef JMAKE_ENUM_LIST 33 | 34 | typedef enum { 35 | 36 | #define JMESSAGE(code,string) code , 37 | 38 | #endif /* JMAKE_ENUM_LIST */ 39 | 40 | JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ 41 | 42 | /* For maintenance convenience, list is alphabetical by message code name */ 43 | JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") 44 | JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") 45 | JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") 46 | JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") 47 | JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") 48 | JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") 49 | JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") 50 | JMESSAGE(JERR_BAD_DROP_SAMPLING, 51 | "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") 52 | JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") 53 | JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") 54 | JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") 55 | JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") 56 | JMESSAGE(JERR_BAD_LIB_VERSION, 57 | "Wrong JPEG library version: library is %d, caller expects %d") 58 | JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") 59 | JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") 60 | JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") 61 | JMESSAGE(JERR_BAD_PROGRESSION, 62 | "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") 63 | JMESSAGE(JERR_BAD_PROG_SCRIPT, 64 | "Invalid progressive parameters at scan script entry %d") 65 | JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") 66 | JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") 67 | JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") 68 | JMESSAGE(JERR_BAD_STRUCT_SIZE, 69 | "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") 70 | JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") 71 | JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") 72 | JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") 73 | JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") 74 | JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") 75 | JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") 76 | JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") 77 | JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") 78 | JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") 79 | JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") 80 | JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") 81 | JMESSAGE(JERR_EMS_READ, "Read from EMS failed") 82 | JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") 83 | JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") 84 | JMESSAGE(JERR_FILE_READ, "Input file read error") 85 | JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") 86 | JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") 87 | JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") 88 | JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") 89 | JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") 90 | JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") 91 | JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") 92 | JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, 93 | "Cannot transcode due to multiple use of quantization table %d") 94 | JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") 95 | JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") 96 | JMESSAGE(JERR_NOTIMPL, "Not implemented yet") 97 | JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") 98 | JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") 99 | JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") 100 | JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") 101 | JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") 102 | JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") 103 | JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") 104 | JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") 105 | JMESSAGE(JERR_QUANT_COMPONENTS, 106 | "Cannot quantize more than %d color components") 107 | JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") 108 | JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") 109 | JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") 110 | JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") 111 | JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") 112 | JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") 113 | JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") 114 | JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") 115 | JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") 116 | JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") 117 | JMESSAGE(JERR_TFILE_WRITE, 118 | "Write failed on temporary file --- out of disk space?") 119 | JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") 120 | JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") 121 | JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") 122 | JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") 123 | JMESSAGE(JERR_XMS_READ, "Read from XMS failed") 124 | JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") 125 | JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) 126 | JMESSAGE(JMSG_VERSION, JVERSION) 127 | JMESSAGE(JTRC_16BIT_TABLES, 128 | "Caution: quantization tables are too coarse for baseline JPEG") 129 | JMESSAGE(JTRC_ADOBE, 130 | "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") 131 | JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") 132 | JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") 133 | JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") 134 | JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") 135 | JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") 136 | JMESSAGE(JTRC_DRI, "Define Restart Interval %u") 137 | JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") 138 | JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") 139 | JMESSAGE(JTRC_EOI, "End Of Image") 140 | JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") 141 | JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") 142 | JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, 143 | "Warning: thumbnail image size does not match data length %u") 144 | JMESSAGE(JTRC_JFIF_EXTENSION, 145 | "JFIF extension marker: type 0x%02x, length %u") 146 | JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") 147 | JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") 148 | JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") 149 | JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") 150 | JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") 151 | JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") 152 | JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") 153 | JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") 154 | JMESSAGE(JTRC_RST, "RST%d") 155 | JMESSAGE(JTRC_SMOOTH_NOTIMPL, 156 | "Smoothing not supported with nonstandard sampling ratios") 157 | JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") 158 | JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") 159 | JMESSAGE(JTRC_SOI, "Start of Image") 160 | JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") 161 | JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") 162 | JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") 163 | JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") 164 | JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") 165 | JMESSAGE(JTRC_THUMB_JPEG, 166 | "JFIF extension marker: JPEG-compressed thumbnail image, length %u") 167 | JMESSAGE(JTRC_THUMB_PALETTE, 168 | "JFIF extension marker: palette thumbnail image, length %u") 169 | JMESSAGE(JTRC_THUMB_RGB, 170 | "JFIF extension marker: RGB thumbnail image, length %u") 171 | JMESSAGE(JTRC_UNKNOWN_IDS, 172 | "Unrecognized component IDs %d %d %d, assuming YCbCr") 173 | JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") 174 | JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") 175 | JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") 176 | JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") 177 | JMESSAGE(JWRN_BOGUS_PROGRESSION, 178 | "Inconsistent progression sequence for component %d coefficient %d") 179 | JMESSAGE(JWRN_EXTRANEOUS_DATA, 180 | "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") 181 | JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") 182 | JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") 183 | JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") 184 | JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") 185 | JMESSAGE(JWRN_MUST_RESYNC, 186 | "Corrupt JPEG data: found marker 0x%02x instead of RST%d") 187 | JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") 188 | JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") 189 | 190 | #ifdef JMAKE_ENUM_LIST 191 | 192 | JMSG_LASTMSGCODE 193 | } J_MESSAGE_CODE; 194 | 195 | #undef JMAKE_ENUM_LIST 196 | #endif /* JMAKE_ENUM_LIST */ 197 | 198 | /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ 199 | #undef JMESSAGE 200 | 201 | 202 | #ifndef JERROR_H 203 | #define JERROR_H 204 | 205 | /* Macros to simplify using the error and trace message stuff */ 206 | /* The first parameter is either type of cinfo pointer */ 207 | 208 | /* Fatal errors (print message and exit) */ 209 | #define ERREXIT(cinfo,code) \ 210 | ((cinfo)->err->msg_code = (code), \ 211 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 212 | #define ERREXIT1(cinfo,code,p1) \ 213 | ((cinfo)->err->msg_code = (code), \ 214 | (cinfo)->err->msg_parm.i[0] = (p1), \ 215 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 216 | #define ERREXIT2(cinfo,code,p1,p2) \ 217 | ((cinfo)->err->msg_code = (code), \ 218 | (cinfo)->err->msg_parm.i[0] = (p1), \ 219 | (cinfo)->err->msg_parm.i[1] = (p2), \ 220 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 221 | #define ERREXIT3(cinfo,code,p1,p2,p3) \ 222 | ((cinfo)->err->msg_code = (code), \ 223 | (cinfo)->err->msg_parm.i[0] = (p1), \ 224 | (cinfo)->err->msg_parm.i[1] = (p2), \ 225 | (cinfo)->err->msg_parm.i[2] = (p3), \ 226 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 227 | #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ 228 | ((cinfo)->err->msg_code = (code), \ 229 | (cinfo)->err->msg_parm.i[0] = (p1), \ 230 | (cinfo)->err->msg_parm.i[1] = (p2), \ 231 | (cinfo)->err->msg_parm.i[2] = (p3), \ 232 | (cinfo)->err->msg_parm.i[3] = (p4), \ 233 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 234 | #define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ 235 | ((cinfo)->err->msg_code = (code), \ 236 | (cinfo)->err->msg_parm.i[0] = (p1), \ 237 | (cinfo)->err->msg_parm.i[1] = (p2), \ 238 | (cinfo)->err->msg_parm.i[2] = (p3), \ 239 | (cinfo)->err->msg_parm.i[3] = (p4), \ 240 | (cinfo)->err->msg_parm.i[4] = (p5), \ 241 | (cinfo)->err->msg_parm.i[5] = (p6), \ 242 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 243 | #define ERREXITS(cinfo,code,str) \ 244 | ((cinfo)->err->msg_code = (code), \ 245 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 246 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 247 | 248 | #define MAKESTMT(stuff) do { stuff } while (0) 249 | 250 | /* Nonfatal errors (we can keep going, but the data is probably corrupt) */ 251 | #define WARNMS(cinfo,code) \ 252 | ((cinfo)->err->msg_code = (code), \ 253 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 254 | #define WARNMS1(cinfo,code,p1) \ 255 | ((cinfo)->err->msg_code = (code), \ 256 | (cinfo)->err->msg_parm.i[0] = (p1), \ 257 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 258 | #define WARNMS2(cinfo,code,p1,p2) \ 259 | ((cinfo)->err->msg_code = (code), \ 260 | (cinfo)->err->msg_parm.i[0] = (p1), \ 261 | (cinfo)->err->msg_parm.i[1] = (p2), \ 262 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 263 | 264 | /* Informational/debugging messages */ 265 | #define TRACEMS(cinfo,lvl,code) \ 266 | ((cinfo)->err->msg_code = (code), \ 267 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 268 | #define TRACEMS1(cinfo,lvl,code,p1) \ 269 | ((cinfo)->err->msg_code = (code), \ 270 | (cinfo)->err->msg_parm.i[0] = (p1), \ 271 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 272 | #define TRACEMS2(cinfo,lvl,code,p1,p2) \ 273 | ((cinfo)->err->msg_code = (code), \ 274 | (cinfo)->err->msg_parm.i[0] = (p1), \ 275 | (cinfo)->err->msg_parm.i[1] = (p2), \ 276 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 277 | #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ 278 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 279 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ 280 | (cinfo)->err->msg_code = (code); \ 281 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 282 | #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ 283 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 284 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 285 | (cinfo)->err->msg_code = (code); \ 286 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 287 | #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ 288 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 289 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 290 | _mp[4] = (p5); \ 291 | (cinfo)->err->msg_code = (code); \ 292 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 293 | #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ 294 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 295 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 296 | _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ 297 | (cinfo)->err->msg_code = (code); \ 298 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 299 | #define TRACEMSS(cinfo,lvl,code,str) \ 300 | ((cinfo)->err->msg_code = (code), \ 301 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 302 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 303 | 304 | #endif /* JERROR_H */ 305 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/jmorecfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jmorecfg.h 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * Modified 1997-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains additional configuration options that customize the 10 | * JPEG software for special applications or support machine-dependent 11 | * optimizations. Most users will not need to touch this file. 12 | */ 13 | 14 | 15 | /* 16 | * Define BITS_IN_JSAMPLE as either 17 | * 8 for 8-bit sample values (the usual setting) 18 | * 12 for 12-bit sample values 19 | * Only 8 and 12 are legal data precisions for lossy JPEG according to the 20 | * JPEG standard, and the IJG code does not support anything else! 21 | * We do not support run-time selection of data precision, sorry. 22 | */ 23 | 24 | #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ 25 | 26 | 27 | /* 28 | * Maximum number of components (color channels) allowed in JPEG image. 29 | * To meet the letter of the JPEG spec, set this to 255. However, darn 30 | * few applications need more than 4 channels (maybe 5 for CMYK + alpha 31 | * mask). We recommend 10 as a reasonable compromise; use 4 if you are 32 | * really short on memory. (Each allowed component costs a hundred or so 33 | * bytes of storage, whether actually used in an image or not.) 34 | */ 35 | 36 | #define MAX_COMPONENTS 10 /* maximum number of image components */ 37 | 38 | 39 | /* 40 | * Basic data types. 41 | * You may need to change these if you have a machine with unusual data 42 | * type sizes; for example, "char" not 8 bits, "short" not 16 bits, 43 | * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, 44 | * but it had better be at least 16. 45 | */ 46 | 47 | /* Representation of a single sample (pixel element value). 48 | * We frequently allocate large arrays of these, so it's important to keep 49 | * them small. But if you have memory to burn and access to char or short 50 | * arrays is very slow on your hardware, you might want to change these. 51 | */ 52 | 53 | #if BITS_IN_JSAMPLE == 8 54 | /* JSAMPLE should be the smallest type that will hold the values 0..255. 55 | * You can use a signed char by having GETJSAMPLE mask it with 0xFF. 56 | */ 57 | 58 | #ifdef HAVE_UNSIGNED_CHAR 59 | 60 | typedef unsigned char JSAMPLE; 61 | #define GETJSAMPLE(value) ((int) (value)) 62 | 63 | #else /* not HAVE_UNSIGNED_CHAR */ 64 | 65 | typedef char JSAMPLE; 66 | #ifdef CHAR_IS_UNSIGNED 67 | #define GETJSAMPLE(value) ((int) (value)) 68 | #else 69 | #define GETJSAMPLE(value) ((int) (value) & 0xFF) 70 | #endif /* CHAR_IS_UNSIGNED */ 71 | 72 | #endif /* HAVE_UNSIGNED_CHAR */ 73 | 74 | #define MAXJSAMPLE 255 75 | #define CENTERJSAMPLE 128 76 | 77 | #endif /* BITS_IN_JSAMPLE == 8 */ 78 | 79 | 80 | #if BITS_IN_JSAMPLE == 12 81 | /* JSAMPLE should be the smallest type that will hold the values 0..4095. 82 | * On nearly all machines "short" will do nicely. 83 | */ 84 | 85 | typedef short JSAMPLE; 86 | #define GETJSAMPLE(value) ((int) (value)) 87 | 88 | #define MAXJSAMPLE 4095 89 | #define CENTERJSAMPLE 2048 90 | 91 | #endif /* BITS_IN_JSAMPLE == 12 */ 92 | 93 | 94 | /* Representation of a DCT frequency coefficient. 95 | * This should be a signed value of at least 16 bits; "short" is usually OK. 96 | * Again, we allocate large arrays of these, but you can change to int 97 | * if you have memory to burn and "short" is really slow. 98 | */ 99 | 100 | typedef short JCOEF; 101 | 102 | 103 | /* Compressed datastreams are represented as arrays of JOCTET. 104 | * These must be EXACTLY 8 bits wide, at least once they are written to 105 | * external storage. Note that when using the stdio data source/destination 106 | * managers, this is also the data type passed to fread/fwrite. 107 | */ 108 | 109 | #ifdef HAVE_UNSIGNED_CHAR 110 | 111 | typedef unsigned char JOCTET; 112 | #define GETJOCTET(value) (value) 113 | 114 | #else /* not HAVE_UNSIGNED_CHAR */ 115 | 116 | typedef char JOCTET; 117 | #ifdef CHAR_IS_UNSIGNED 118 | #define GETJOCTET(value) (value) 119 | #else 120 | #define GETJOCTET(value) ((value) & 0xFF) 121 | #endif /* CHAR_IS_UNSIGNED */ 122 | 123 | #endif /* HAVE_UNSIGNED_CHAR */ 124 | 125 | 126 | /* These typedefs are used for various table entries and so forth. 127 | * They must be at least as wide as specified; but making them too big 128 | * won't cost a huge amount of memory, so we don't provide special 129 | * extraction code like we did for JSAMPLE. (In other words, these 130 | * typedefs live at a different point on the speed/space tradeoff curve.) 131 | */ 132 | 133 | /* UINT8 must hold at least the values 0..255. */ 134 | 135 | #ifdef HAVE_UNSIGNED_CHAR 136 | typedef unsigned char UINT8; 137 | #else /* not HAVE_UNSIGNED_CHAR */ 138 | #ifdef CHAR_IS_UNSIGNED 139 | typedef char UINT8; 140 | #else /* not CHAR_IS_UNSIGNED */ 141 | typedef short UINT8; 142 | #endif /* CHAR_IS_UNSIGNED */ 143 | #endif /* HAVE_UNSIGNED_CHAR */ 144 | 145 | /* UINT16 must hold at least the values 0..65535. */ 146 | 147 | #ifdef HAVE_UNSIGNED_SHORT 148 | typedef unsigned short UINT16; 149 | #else /* not HAVE_UNSIGNED_SHORT */ 150 | typedef unsigned int UINT16; 151 | #endif /* HAVE_UNSIGNED_SHORT */ 152 | 153 | /* INT16 must hold at least the values -32768..32767. */ 154 | 155 | #ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ 156 | typedef short INT16; 157 | #endif 158 | 159 | /* INT32 must hold at least signed 32-bit values. */ 160 | 161 | #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ 162 | #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ 163 | #ifndef _BASETSD_H /* MinGW is slightly different */ 164 | #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ 165 | typedef long INT32; 166 | #endif 167 | #endif 168 | #endif 169 | #endif 170 | 171 | /* Datatype used for image dimensions. The JPEG standard only supports 172 | * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 173 | * "unsigned int" is sufficient on all machines. However, if you need to 174 | * handle larger images and you don't mind deviating from the spec, you 175 | * can change this datatype. 176 | */ 177 | 178 | typedef unsigned int JDIMENSION; 179 | 180 | #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ 181 | 182 | 183 | /* These macros are used in all function definitions and extern declarations. 184 | * You could modify them if you need to change function linkage conventions; 185 | * in particular, you'll need to do that to make the library a Windows DLL. 186 | * Another application is to make all functions global for use with debuggers 187 | * or code profilers that require it. 188 | */ 189 | 190 | /* a function called through method pointers: */ 191 | #define METHODDEF(type) static type 192 | /* a function used only in its module: */ 193 | #define LOCAL(type) static type 194 | /* a function referenced thru EXTERNs: */ 195 | #define GLOBAL(type) type 196 | /* a reference to a GLOBAL function: */ 197 | #define EXTERN(type) extern type 198 | 199 | 200 | /* This macro is used to declare a "method", that is, a function pointer. 201 | * We want to supply prototype parameters if the compiler can cope. 202 | * Note that the arglist parameter must be parenthesized! 203 | * Again, you can customize this if you need special linkage keywords. 204 | */ 205 | 206 | #ifdef HAVE_PROTOTYPES 207 | #define JMETHOD(type,methodname,arglist) type (*methodname) arglist 208 | #else 209 | #define JMETHOD(type,methodname,arglist) type (*methodname) () 210 | #endif 211 | 212 | 213 | /* Here is the pseudo-keyword for declaring pointers that must be "far" 214 | * on 80x86 machines. Most of the specialized coding for 80x86 is handled 215 | * by just saying "FAR *" where such a pointer is needed. In a few places 216 | * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. 217 | */ 218 | 219 | #ifndef FAR 220 | #ifdef NEED_FAR_POINTERS 221 | #define FAR far 222 | #else 223 | #define FAR 224 | #endif 225 | #endif 226 | 227 | 228 | /* 229 | * On a few systems, type boolean and/or its values FALSE, TRUE may appear 230 | * in standard header files. Or you may have conflicts with application- 231 | * specific header files that you want to include together with these files. 232 | * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. 233 | */ 234 | 235 | #ifndef HAVE_BOOLEAN 236 | typedef int boolean; 237 | #endif 238 | #ifndef FALSE /* in case these macros already exist */ 239 | #define FALSE 0 /* values of boolean */ 240 | #endif 241 | #ifndef TRUE 242 | #define TRUE 1 243 | #endif 244 | 245 | 246 | /* 247 | * The remaining options affect code selection within the JPEG library, 248 | * but they don't need to be visible to most applications using the library. 249 | * To minimize application namespace pollution, the symbols won't be 250 | * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. 251 | */ 252 | 253 | #ifdef JPEG_INTERNALS 254 | #define JPEG_INTERNAL_OPTIONS 255 | #endif 256 | 257 | #ifdef JPEG_INTERNAL_OPTIONS 258 | 259 | 260 | /* 261 | * These defines indicate whether to include various optional functions. 262 | * Undefining some of these symbols will produce a smaller but less capable 263 | * library. Note that you can leave certain source files out of the 264 | * compilation/linking process if you've #undef'd the corresponding symbols. 265 | * (You may HAVE to do that if your compiler doesn't like null source files.) 266 | */ 267 | 268 | /* Capability options common to encoder and decoder: */ 269 | 270 | #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ 271 | #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ 272 | #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ 273 | 274 | /* Encoder capability options: */ 275 | 276 | #define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ 277 | #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 278 | #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ 279 | #define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ 280 | #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ 281 | /* Note: if you selected 12-bit data precision, it is dangerous to turn off 282 | * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit 283 | * precision, so jchuff.c normally uses entropy optimization to compute 284 | * usable tables for higher precision. If you don't want to do optimization, 285 | * you'll have to supply different default Huffman tables. 286 | * The exact same statements apply for progressive JPEG: the default tables 287 | * don't work for progressive mode. (This may get fixed, however.) 288 | */ 289 | #define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ 290 | 291 | /* Decoder capability options: */ 292 | 293 | #define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ 294 | #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 295 | #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ 296 | #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ 297 | #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ 298 | #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ 299 | #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ 300 | #define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ 301 | #define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ 302 | #define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ 303 | 304 | /* more capability options later, no doubt */ 305 | 306 | 307 | /* 308 | * Ordering of RGB data in scanlines passed to or from the application. 309 | * If your application wants to deal with data in the order B,G,R, just 310 | * change these macros. You can also deal with formats such as R,G,B,X 311 | * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing 312 | * the offsets will also change the order in which colormap data is organized. 313 | * RESTRICTIONS: 314 | * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. 315 | * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not 316 | * useful if you are using JPEG color spaces other than YCbCr or grayscale. 317 | * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE 318 | * is not 3 (they don't understand about dummy color components!). So you 319 | * can't use color quantization if you change that value. 320 | */ 321 | 322 | #define RGB_RED 0 /* Offset of Red in an RGB scanline element */ 323 | #define RGB_GREEN 1 /* Offset of Green */ 324 | #define RGB_BLUE 2 /* Offset of Blue */ 325 | #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ 326 | 327 | 328 | /* Definitions for speed-related optimizations. */ 329 | 330 | 331 | /* If your compiler supports inline functions, define INLINE 332 | * as the inline keyword; otherwise define it as empty. 333 | */ 334 | 335 | #ifndef INLINE 336 | #ifdef __GNUC__ /* for instance, GNU C knows about inline */ 337 | #define INLINE __inline__ 338 | #endif 339 | #ifndef INLINE 340 | #define INLINE /* default is to define it as empty */ 341 | #endif 342 | #endif 343 | 344 | 345 | /* On some machines (notably 68000 series) "int" is 32 bits, but multiplying 346 | * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER 347 | * as short on such a machine. MULTIPLIER must be at least 16 bits wide. 348 | */ 349 | 350 | #ifndef MULTIPLIER 351 | #define MULTIPLIER int /* type for fastest integer multiply */ 352 | #endif 353 | 354 | 355 | /* FAST_FLOAT should be either float or double, whichever is done faster 356 | * by your compiler. (Note that this type is only used in the floating point 357 | * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) 358 | * Typically, float is faster in ANSI C compilers, while double is faster in 359 | * pre-ANSI compilers (because they insist on converting to double anyway). 360 | * The code below therefore chooses float if we have ANSI-style prototypes. 361 | */ 362 | 363 | #ifndef FAST_FLOAT 364 | #ifdef HAVE_PROTOTYPES 365 | #define FAST_FLOAT float 366 | #else 367 | #define FAST_FLOAT double 368 | #endif 369 | #endif 370 | 371 | #endif /* JPEG_INTERNAL_OPTIONS */ 372 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/kernel_list.h: -------------------------------------------------------------------------------- 1 | #ifndef __DLIST_H 2 | #define __DLIST_H 3 | 4 | /* This file is from Linux Kernel (include/linux/list.h) 5 | * and modified by simply removing hardware prefetching of list items. 6 | * Here by copyright, credits attributed to wherever they belong. 7 | * Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu) 8 | */ 9 | 10 | /* 11 | * Simple doubly linked list implementation. 12 | * 13 | * Some of the internal functions (“__xxx”) are useful when 14 | * manipulating whole lists rather than single entries, as 15 | * sometimes we already know the next/prev entries and we can 16 | * generate better code by using them directly rather than 17 | * using the generic single-entry routines. 18 | */ 19 | /** 20 | * container_of - cast a member of a structure out to the containing structure 21 | * 22 | * @ptr: the pointer to the member. 23 | * @type: the type of the container struct this is embedded in. 24 | * @member: the name of the member within the struct. 25 | * 26 | */ 27 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 28 | 29 | #define container_of(ptr, type, member) ({ \ 30 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 31 | (type *)( (char *)__mptr - offsetof(type,member) );}) 32 | /* 33 | * These are non-NULL pointers that will result in page faults 34 | * under normal circumstances, used to verify that nobody uses 35 | * non-initialized list entries. 36 | */ 37 | #define LIST_POISON1 ((void *) 0x00100100) 38 | #define LIST_POISON2 ((void *) 0x00200) 39 | 40 | struct list_head { 41 | struct list_head *next; 42 | struct list_head *prev; 43 | }; 44 | 45 | #define LIST_HEAD_INIT(name) { &(name), &(name) } 46 | 47 | #define LIST_HEAD(name) \ 48 | struct list_head name = LIST_HEAD_INIT(name) 49 | 50 | #define INIT_LIST_HEAD(ptr) do { \ 51 | (ptr)->next = (ptr); (ptr)->prev = (ptr); \ 52 | } while (0) 53 | 54 | /* 55 | * Insert a new entry between two known consecutive entries. 56 | * 57 | * This is only for internal list manipulation where we know 58 | * the prev/next entries already! 59 | */ 60 | static inline void __list_add(struct list_head *new, // 要插入的节点 61 | struct list_head *prev,// 前节点 before 62 | struct list_head *next) // 后节点 after 63 | { 64 | next->prev = new; // 后节点的上家为new 65 | new->next = next; 66 | new->prev = prev; 67 | prev->next = new; 68 | } 69 | 70 | /** 71 | * list_add – add a new entry 72 | * @new: new entry to be added 73 | * @head: list head to add it after 74 | * 75 | * Insert a new entry after the specified head. 76 | * This is good for implementing stacks. 77 | */ 78 | static inline void list_add(struct list_head *new, struct list_head *head) 79 | { 80 | __list_add(new, head, head->next); 81 | } 82 | 83 | /** 84 | * list_add_tail – add a new entry 85 | * @new: new entry to be added 86 | * @head: list head to add it before 87 | * 88 | * Insert a new entry before the specified head. 89 | * This is useful for implementing queues. 90 | */ 91 | static inline void list_add_tail(struct list_head *new, struct list_head *head) 92 | { 93 | __list_add(new, head->prev, head); 94 | } 95 | 96 | /* 97 | * Delete a list entry by making the prev/next entries 98 | * point to each other. 99 | * 100 | * This is only for internal list manipulation where we know 101 | * the prev/next entries already! 102 | */ 103 | static inline void __list_del(struct list_head *prev, struct list_head *next) 104 | { 105 | next->prev = prev; 106 | prev->next = next; 107 | } 108 | 109 | /** 110 | * list_del – deletes entry from list. 111 | * @entry: the element to delete from the list. 112 | * Note: list_empty on entry does not return true after this, the entry is in an undefined state. 113 | */ 114 | static inline void list_del(struct list_head *entry) 115 | { 116 | __list_del(entry->prev, entry->next); 117 | entry->next = (void *) 0; 118 | entry->prev = (void *) 0; 119 | } 120 | 121 | /** 122 | * list_del_init – deletes entry from list and reinitialize it. 123 | * @entry: the element to delete from the list. 124 | */ 125 | static inline void list_del_init(struct list_head *entry) 126 | { 127 | __list_del(entry->prev, entry->next); 128 | INIT_LIST_HEAD(entry); 129 | } 130 | 131 | /** 132 | * list_move – delete from one list and add as another’s head 133 | * @list: the entry to move 134 | * @head: the head that will precede our entry 135 | */ 136 | static inline void list_move(struct list_head *list, 137 | struct list_head *head) 138 | { 139 | __list_del(list->prev, list->next); 140 | list_add(list, head); 141 | } 142 | 143 | /** 144 | * list_move_tail – delete from one list and add as another’s tail 145 | * @list: the entry to move 146 | * @head: the head that will follow our entry 147 | */ 148 | static inline void list_move_tail(struct list_head *list, 149 | struct list_head *head) 150 | { 151 | __list_del(list->prev, list->next); 152 | list_add_tail(list, head); 153 | } 154 | 155 | /** 156 | * list_empty – tests whether a list is empty 157 | * @head: the list to test. 158 | */ 159 | static inline int list_empty(struct list_head *head) 160 | { 161 | return head->next == head; 162 | } 163 | 164 | static inline void __list_splice(struct list_head *list, 165 | struct list_head *head) 166 | { 167 | struct list_head *first = list->next; 168 | struct list_head *last = list->prev; 169 | struct list_head *at = head->next; 170 | 171 | first->prev = head; 172 | head->next = first; 173 | 174 | last->next = at; 175 | at->prev = last; 176 | } 177 | 178 | /** 179 | * list_splice – join two lists 180 | * @list: the new list to add. 181 | * @head: the place to add it in the first list. 182 | */ 183 | static inline void list_splice(struct list_head *list, struct list_head *head) 184 | { 185 | if (!list_empty(list)) 186 | __list_splice(list, head); 187 | } 188 | 189 | /** 190 | * list_splice_init – join two lists and reinitialise the emptied list. 191 | * @list: the new list to add. 192 | * @head: the place to add it in the first list. 193 | * 194 | * The list at @list is reinitialised 195 | */ 196 | static inline void list_splice_init(struct list_head *list, 197 | struct list_head *head) 198 | { 199 | if (!list_empty(list)) { 200 | __list_splice(list, head); 201 | INIT_LIST_HEAD(list); 202 | } 203 | } 204 | 205 | /** 206 | * list_entry – get the struct for this entry 207 | * @ptr: the &struct list_head pointer. 208 | * @type: the type of the struct this is embedded in. 209 | * @member: the name of the list_struct within the struct. 210 | */ 211 | #define list_entry(ptr, type, member) \ 212 | ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) 213 | 214 | /** 215 | * list_for_each - iterate over a list 216 | * @pos: the &struct list_head to use as a loop counter. // p 217 | * @head: the head for your list. 218 | */ 219 | #define list_for_each(pos, head) \ 220 | for (pos = (head)->next; pos != (head); \ 221 | pos = pos->next) 222 | /** 223 | * list_for_each_prev - iterate over a list backwards 224 | * @pos: the &struct list_head to use as a loop counter. 225 | * @head: the head for your list. 226 | */ 227 | #define list_for_each_prev(pos, head) \ 228 | for (pos = (head)->prev; pos != (head); \ 229 | pos = pos->prev) 230 | 231 | /** 232 | * list_for_each_safe - iterate over a list safe against removal of list entry 233 | * @pos: the &struct list_head to use as a loop counter. 234 | * @n: another &struct list_head to use as temporary storage 235 | * @head: the head for your list. 236 | */ 237 | #define list_for_each_safe(pos, n, head) \ 238 | for (pos = (head)->next, n = pos->next; pos != (head); \ 239 | pos = n, n = pos->next) 240 | 241 | /** 242 | * list_for_each_entry - iterate over list of given type 243 | * @pos: the type * to use as a loop counter. 244 | * @head: the head for your list. 245 | * @member: the name of the list_struct within the struct. 246 | */ 247 | #define list_for_each_entry(pos, head, member) \ 248 | for (pos = list_entry((head)->next, typeof(*pos), member); \ 249 | &pos->member != (head); \ 250 | pos = list_entry(pos->member.next, typeof(*pos), member)) 251 | 252 | /** 253 | * list_for_each_entry_safe – iterate over list of given type safe against removal of list entry 254 | * @pos: the type * to use as a loop counter. 255 | * @n: another type * to use as temporary storage 256 | * @head: the head for your list. 257 | * @member: the name of the list_struct within the struct. 258 | */ 259 | #define list_for_each_entry_safe(pos, n, head, member) \ 260 | for (pos = list_entry((head)->next, typeof(*pos), member), \ 261 | n = list_entry(pos->member.next, typeof(*pos), member); \ 262 | &pos->member != (head); \ 263 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) 264 | 265 | #endif 266 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/libapi_v4l2_arm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/jpeg/libapi_v4l2_arm.so -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so.8 -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so.8.3.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/jpeg/libjpeg.so.8.3.0 -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/jpeg/yuyv.h: -------------------------------------------------------------------------------- 1 | #ifndef __YUYV_H__ 2 | #define __YUYV_H__ 3 | 4 | struct jpg_data 5 | { 6 | unsigned char jpg_data[614400]; //用于存放摄像头数据 7 | int jpg_size; //用于存放摄像头数据大小 8 | }; 9 | 10 | //参数 设备文件的路径 11 | extern int linux_v4l2_yuyv_init(char *dev_name); 12 | 13 | //开始摄像头头捕捉画面 14 | extern int linux_v4l2_start_yuyv_capturing(); 15 | 16 | //读取一帧的内容 获取摄像头采集数据 17 | extern int linux_v4l2_get_yuyv_data (struct jpg_data * jpg_buf); 18 | 19 | //退出摄像头 20 | extern int linux_v4l2_yuyv_quit(); 21 | 22 | #endif -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/libfont.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/libfont.a -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/main -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/main.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "fcntl.h" 16 | #include "camera.h" 17 | #include 18 | #include 19 | #include 20 | #include //struct input_event 21 | 22 | int fd_event0; 23 | int fd_fb0; 24 | int buf_bmp; 25 | int buf_lcd; 26 | int fd_bmp; 27 | int fd_lcd; 28 | int *p_init = NULL; 29 | int *p_mmap = NULL; 30 | 31 | int exit_mmap(void) 32 | { 33 | munmap(p_init, 800*480*4); 34 | p_init = NULL; 35 | return 0; 36 | } 37 | 38 | int open_fb0(void) 39 | { 40 | fd_fb0 = open("/dev/fb0", O_RDWR); 41 | if(fd_fb0 == -1) 42 | { 43 | printf("open /dev/fb0 fail!\n"); 44 | return -1; 45 | } 46 | else{ 47 | printf("fd_fb0 = %d\n", fd_fb0); 48 | } 49 | return 0; 50 | } 51 | 52 | 53 | 54 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 55 | { 56 | int *p_mmap = NULL; 57 | p_mmap = p_init; 58 | 59 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 60 | 61 | int x, y; 62 | for(y=0; y=0 && coordinate.value<800) 107 | { 108 | *coordinate_x = coordinate.value; 109 | } 110 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 111 | { 112 | *coordinate_y = coordinate.value; 113 | } 114 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 115 | { 116 | break; 117 | } 118 | } 119 | 120 | return 0; 121 | } 122 | void input_pageMAIN() 123 | { 124 | //1)打开LCD屏幕,打开图片。 125 | fd_bmp = open("/root/project1/image/main.bmp",O_RDWR); 126 | fd_lcd = open("/dev/fb0",O_RDWR); 127 | if(fd_bmp < 0 || fd_lcd <0) 128 | { 129 | printf("FAILD !!! BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 130 | return -1; 131 | } 132 | 133 | printf("fd_bmp Filescip iS %d \nfd_lcd Filescip is %d \n",fd_bmp,fd_lcd); 134 | int ret = lseek(fd_bmp, 54, SEEK_SET); 135 | if (ret < 0) 136 | { 137 | printf("lseek error %d\n",ret); 138 | return -2; 139 | } 140 | 141 | //2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 142 | 143 | 144 | p_init = mmap(NULL,800 * 480 * 4,PROT_READ | PROT_WRITE,MAP_SHARED,fd_lcd,0); 145 | p_mmap = p_init; 146 | 147 | //2-1)800*480个BMP像素点变成800*480个LCD像素点 148 | 149 | char buf_bmp[800*480*3]; 150 | int buf_lcd[800*480]; 151 | bzero(buf_bmp, sizeof(buf_bmp)); 152 | bzero(buf_lcd, sizeof(buf_lcd)); 153 | 154 | ret = read(fd_bmp, buf_bmp, sizeof(buf_bmp)); 155 | if (ret < 0) 156 | { 157 | printf("read error\n"); 158 | return -3; 159 | } 160 | 161 | char A = 0x00; 162 | int i = 0; 163 | for (i = 0; i<800 * 480; i++) 164 | { 165 | buf_lcd[i] = buf_bmp[i * 3] << 0 | buf_bmp[i * 3 + 1] << 8 | buf_bmp[i * 3 + 2] << 16 | A << 24; 166 | } 167 | 168 | //2-2)颠倒图片 169 | int xx = 0; 170 | int y = 0; 171 | for (xx = 479; xx >= 0; xx--) 172 | { 173 | for (y = 0; y<800; y++) 174 | { 175 | *p_mmap= buf_lcd[xx*800+y]; 176 | p_mmap++; 177 | 178 | } 179 | } 180 | } 181 | 182 | //arm6818_bmp800_480("/root/project/images/0.bmp", 10, 10, 40, 40); 183 | int arm6818_bmp800_480(const char *pathname, int coordinate_x, int coordinate_y, int height, int wide) 184 | { 185 | int fd_bmp = open(pathname, O_RDWR); 186 | if(fd_bmp == -1) 187 | { 188 | printf("open bmp fail!\n"); 189 | return -1; 190 | } 191 | 192 | lseek(fd_bmp, 54, SEEK_SET); 193 | 194 | char bmp_buf[height*wide*3]; 195 | int lcd_buf[height*wide]; 196 | bzero(bmp_buf, sizeof(bmp_buf)); 197 | bzero(lcd_buf, sizeof(lcd_buf)); 198 | 199 | read(fd_bmp, bmp_buf, sizeof(bmp_buf)); 200 | close(fd_bmp); 201 | 202 | int i; 203 | char A = 0x00; 204 | for(i=0; i 278 | int month=0; 279 | 280 | if(strcmp(p_second, "Jan") == 0) month = 1; 281 | else if(strcmp(p_second, "Feb") == 0) month = 2; 282 | else if(strcmp(p_second, "Mar") == 0) month = 3; 283 | else if(strcmp(p_second, "Apr") == 0) month = 4; 284 | else if(strcmp(p_second, "May") == 0) month = 5; 285 | else if(strcmp(p_second, "Jun") == 0) month = 6; 286 | else if(strcmp(p_second, "Jul") == 0) month = 7; 287 | else if(strcmp(p_second, "Aug") == 0) month = 8; 288 | else if(strcmp(p_second, "Sept") == 0) month = 9; 289 | else if(strcmp(p_second, "Oct") == 0) month = 10; 290 | else if(strcmp(p_second, "Nov") == 0) month = 11; 291 | else if(strcmp(p_second, "Dec") == 0) month = 12; 292 | 293 | char str[50]; 294 | bzero(str, sizeof(str)); 295 | sprintf(str, "%s-%d-%s %s", p_five, month, p_third,p_forth); 296 | 297 | //显示 "Jul 4 11:10:00 2019" 字符串 298 | Init_Font(); 299 | 300 | Clean_Area(640,//x坐标起始点 301 | 0,//y坐标起始点 302 | 160,//绘制的宽度 303 | 15,//绘制的高度 304 | 0x00ffffff);//往屏幕指定区域填充黑颜色 305 | 306 | Display_characterX(640,//x坐标起始点 307 | 0,//y坐标起始点 308 | str,//GB2312 中文字符串 309 | 0x00000000 ,//字体白颜色值 310 | 1);//字体放大倍数 1~8 311 | 312 | UnInit_Font(); 313 | sleep(1); 314 | } 315 | pthread_exit(NULL); 316 | } 317 | 318 | 319 | int num = 3; //输入最多次数 320 | int main() 321 | { 322 | pthread_t pid; 323 | pthread_create(&pid,NULL,(void*)task_ser,NULL); 324 | 325 | 326 | Build: 327 | input_pageMAIN(); 328 | int ts_x, ts_y; 329 | 330 | open_ts(); 331 | open_fb0(); 332 | 333 | 334 | //登陆 335 | char account[7]="123456"; 336 | char passwd[7]="123456"; 337 | char input_account[11]; 338 | char input_passwd[11]; 339 | FLAG: 340 | bzero(input_account,sizeof(input_account)); 341 | bzero(input_passwd,sizeof(input_passwd)); 342 | 343 | 344 | while(1) 345 | { 346 | read_ts(&ts_x, &ts_y); 347 | if(ts_x>20&&ts_x<110&&ts_y>150&&ts_y<200) 348 | { 349 | printf("Please input Account:\n"); 350 | 351 | //账号原点 352 | 353 | int ax=135; 354 | int ay= 152; 355 | int i = 0; 356 | while(1) 357 | { 358 | FLAG1: 359 | read_ts(&ts_x, &ts_y); 360 | //--> 361 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 362 | { 363 | input_account[i] = '\0'; 364 | printf("The Account is %s\n",input_account); 365 | break; 366 | } 367 | //<-- 368 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 369 | { 370 | ax-=40; 371 | if(ax < 135) 372 | { 373 | bzero(input_account,sizeof(input_account)); 374 | ax=135; 375 | i=0; 376 | goto FLAG1; 377 | 378 | } 379 | arm6818_bmp800_480("/root/project1/image/q.bmp",ax,ay,40,40); 380 | --i; 381 | printf("delete a number!!!\n"); 382 | 383 | } 384 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 385 | { 386 | arm6818_bmp800_480("/root/project1/image/num1.bmp",ax,ay,40,40); 387 | ax+=40; 388 | input_account[i++]='1'; 389 | printf("1\n"); 390 | } 391 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 392 | { 393 | arm6818_bmp800_480("/root/project1/image/num2.bmp",ax,ay,40,40); 394 | ax+=40; 395 | input_account[i++]='2'; 396 | printf("2\n"); 397 | } 398 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 399 | { 400 | arm6818_bmp800_480("/root/project1/image/num3.bmp",ax,ay,40,40); 401 | ax+=40; 402 | input_account[i++]='3'; 403 | printf("3\n"); 404 | } 405 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 406 | { 407 | arm6818_bmp800_480("/root/project1/image/num4.bmp",ax,ay,40,40); 408 | ax+=40; 409 | input_account[i++]='4'; 410 | printf("4\n"); 411 | } 412 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 413 | { 414 | arm6818_bmp800_480("/root/project1/image/num5.bmp",ax,ay,40,40); 415 | ax+=40; 416 | input_account[i++]='5'; 417 | printf("5\n"); 418 | } 419 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 420 | { 421 | arm6818_bmp800_480("/root/project1/image/num6.bmp",ax,ay,40,40); 422 | ax+=40; 423 | input_account[i++]='6'; 424 | printf("6\n"); 425 | } 426 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 427 | { 428 | arm6818_bmp800_480("/root/project1/image/num7.bmp",ax,ay,40,40); 429 | ax+=40; 430 | input_account[i++]='7'; 431 | printf("7\n"); 432 | } 433 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 434 | { 435 | arm6818_bmp800_480("/root/project1/image/num8.bmp",ax,ay,40,40); 436 | ax+=40; 437 | input_account[i++]='8'; 438 | printf("8\n"); 439 | } 440 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 441 | { 442 | arm6818_bmp800_480("/root/project1/image/num9.bmp",ax,ay,40,40); 443 | ax+=40; 444 | input_account[i++]='9'; 445 | printf("9\n"); 446 | } 447 | } 448 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 449 | { 450 | printf("Please input Passwd:\n"); 451 | //密码原点 452 | 453 | int px=135; 454 | int py= 250; 455 | int i = 0; 456 | while(1) 457 | { 458 | FLAG2: 459 | read_ts(&ts_x, &ts_y); 460 | //---> 461 | if(ts_x>700&&ts_x<790&&ts_y>380&&ts_y<470) 462 | { 463 | input_passwd[i]='\0'; 464 | printf("Input Passwd is %s\n",input_passwd); 465 | num--; 466 | if(num >0) 467 | { 468 | //校验账号密码是否正确 469 | if((strcmp(account,input_account)==0)&&(strcmp(passwd,input_passwd)==0)) 470 | { 471 | printf("*************************Welcome to this syatem!!!************************\n"); 472 | arm6818_color(0x0000ff00,0,0,480,800); 473 | sleep(1); 474 | Buildwww: 475 | //第二个界面 476 | arm6818_bmp800_480("/root/project1/image/zhongjian.bmp",0,0,480,800); 477 | while(1) 478 | { 479 | read_ts(&ts_x, &ts_y); 480 | if(ts_x>330&&ts_x<460&&ts_y>290&&ts_y<430) 481 | { 482 | //第三个界面 483 | arm6818_bmp800_480("/root/project1/image/right.bmp",0,0,480,800); 484 | while(1) 485 | { 486 | read_ts(&ts_x, &ts_y); 487 | if(ts_x>640&&ts_x<800&&ts_y>160&&ts_y<250) 488 | { 489 | //TODO 监控 490 | 491 | my_camera(); 492 | ts_x=0; 493 | ts_y=0; 494 | 495 | } 496 | if(ts_x>640&&ts_x<800&&ts_y>360&&ts_y<440) 497 | { 498 | printf("------------------------Thank You !!! --------------------\n"); 499 | num=3; 500 | goto Buildwww; 501 | } 502 | 503 | } 504 | } 505 | if(ts_x>120&&ts_x<250&&ts_y>290&&ts_y<430) 506 | { 507 | printf("------------------------Thank You !!! --------------------\n"); 508 | num=3; 509 | goto Build; 510 | } 511 | } 512 | 513 | } 514 | else 515 | { 516 | arm6818_color(0x00ff0000,0,0,480,800); 517 | sleep(1); 518 | arm6818_bmp800_480("/root/project1/image/main.bmp",0,0,480,800); 519 | goto FLAG; 520 | printf("Passwd is error \n!!!"); 521 | } 522 | 523 | } 524 | else 525 | { 526 | if((strcmp(account,input_account)==0)&&(strcmp(passwd,input_passwd)==0)) 527 | { 528 | printf("*************************Welcome to this syatem!!!**********************\n"); 529 | arm6818_color(0x0000ff00,0,0,480,800); 530 | sleep(1); 531 | Buildwwww: 532 | arm6818_bmp800_480("/root/project1/image/zhongjian.bmp",0,0,480,800); 533 | while(1) 534 | { 535 | read_ts(&ts_x, &ts_y); 536 | if(ts_x>330&&ts_x<460&&ts_y>290&&ts_y<430) 537 | { 538 | //第三个界面 539 | arm6818_bmp800_480("/root/project1/image/right.bmp",0,0,480,800); 540 | while(1) 541 | { 542 | 543 | read_ts(&ts_x, &ts_y); 544 | if(ts_x>640&&ts_x<800&&ts_y>160&&ts_y<250) 545 | { 546 | //TODO 监控 547 | 548 | my_camera(); 549 | ts_x=0; 550 | ts_y=0; 551 | 552 | } 553 | if(ts_x>640&&ts_x<800&&ts_y>360&&ts_y<440) 554 | { 555 | printf("------------------------Thank You !!! --------------------\n"); 556 | num=3; 557 | goto Buildwwww; 558 | } 559 | 560 | } 561 | } 562 | if(ts_x>120&&ts_x<250&&ts_y>290&&ts_y<430) 563 | { 564 | printf("------------------------Thank You !!! --------------------\n"); 565 | num=3; 566 | goto Build; 567 | } 568 | 569 | } 570 | } 571 | else 572 | { 573 | printf("**********************DEV IS SHUTDOWN NOW!!!************************\n"); 574 | 575 | arm6818_color(0x00000000,0,0,480,800); 576 | } 577 | 578 | } 579 | 580 | return 0; 581 | } 582 | //<-- 583 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 584 | { 585 | px-=40; 586 | if(px < 0) 587 | { 588 | bzero(input_passwd,sizeof(input_passwd)); 589 | px=135; 590 | i = 0; 591 | goto FLAG2; 592 | } 593 | arm6818_bmp800_480("/root/project1/image/q.bmp",px,py,40,40); 594 | --i; 595 | printf("delete a number!!!\n"); 596 | 597 | } 598 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 599 | { 600 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 601 | px+=40; 602 | input_passwd[i++]='1'; 603 | printf("1\n"); 604 | } 605 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 606 | { 607 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 608 | px+=40; 609 | input_passwd[i++]='2'; 610 | printf("2\n"); 611 | } 612 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 613 | { 614 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 615 | px+=40; 616 | input_passwd[i++]='3'; 617 | printf("3\n"); 618 | } 619 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 620 | { 621 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 622 | px+=40; 623 | input_passwd[i++]='4'; 624 | printf("4\n"); 625 | } 626 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 627 | { 628 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 629 | px+=40; 630 | input_passwd[i++]='5'; 631 | printf("5\n"); 632 | } 633 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 634 | { 635 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 636 | px+=40; 637 | input_passwd[i++]='6'; 638 | printf("6\n"); 639 | } 640 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 641 | { 642 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 643 | px+=40; 644 | input_passwd[i++]='7'; 645 | printf("7\n"); 646 | } 647 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 648 | { 649 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 650 | px+=40; 651 | input_passwd[i++]='8'; 652 | printf("8\n"); 653 | } 654 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 655 | { 656 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 657 | px+=40; 658 | input_passwd[i++]='9'; 659 | printf("9\n"); 660 | } 661 | } 662 | 663 | } 664 | } 665 | else 666 | { 667 | printf("Please input Account !!!\n"); 668 | } 669 | } 670 | 671 | 672 | //3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 673 | pthread_join(pid,NULL); 674 | exit_mmap(); 675 | close_fd(); 676 | 677 | return 0; 678 | } 679 | -------------------------------------------------------------------------------- /Day5/视频监控项目源码/项目源码/编译命令.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/视频监控项目源码/项目源码/编译命令.txt -------------------------------------------------------------------------------- /Day5/频监控系统源码.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码.zip -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/10.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/fanhui.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/fanhui.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/main.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/main.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num0.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num1.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num10.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num10.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num2.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num3.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num4.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num5.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num6.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num7.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num8.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/num9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/num9.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/password.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/password.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/q.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/q.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/q.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/q.png -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/welcome.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/welcome.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/图片素材/zhongjian.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/图片素材/zhongjian.bmp -------------------------------------------------------------------------------- /Day5/频监控系统源码/演示视频/视频监控系统演示.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/演示视频/视频监控系统演示.mp4 -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/Makefile: -------------------------------------------------------------------------------- 1 | main:main.c camera.c 2 | 3 | arm-linux-gcc -w $^ -o $@ -I./jpeg -L./jpeg -ljpeg -lapi_v4l2_arm -L./ -lfont -lpthread 4 | .PHONY:clean 5 | clean: 6 | rm -rf main 7 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/camera.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/camera.c -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/camera.h: -------------------------------------------------------------------------------- 1 | #ifndef __CAMERA_H__ 2 | #define __CAMERA_H__ 3 | 4 | #include 5 | #include "jpeglib.h" 6 | #include "camera.h" 7 | #include "yuyv.h" 8 | 9 | 10 | #define LCD_WIDTH 800 11 | #define LCD_HEIGHT 480 12 | #define FB_SIZE (LCD_WIDTH * LCD_HEIGHT * 4) 13 | 14 | typedef struct VideoBuffer { 15 | void *start; //映射到用户空间的地址 16 | size_t length; //采集到数据的长度 17 | } VideoBuffer1; //存放采集数据的位置 18 | 19 | #define BUFFER_COUNT 4 20 | VideoBuffer1 framebuf[BUFFER_COUNT]; 21 | 22 | //函数声明 23 | extern unsigned long file_size_get(const char *pfile_path); 24 | extern void lcd_close(void); 25 | extern int show_video_data(unsigned int x,unsigned int y,char *pjpg_buf,unsigned int jpg_buf_size); 26 | extern int lcd_draw_jpg(unsigned int x,unsigned int y,const char *pjpg_path); 27 | extern void lcd_draw_point(unsigned int x,unsigned int y, unsigned int color); 28 | extern int mmap_lcd(void); 29 | extern int lcd_open(void); 30 | 31 | #endif -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/font.h: -------------------------------------------------------------------------------- 1 | #ifndef __FONT__ 2 | #define __FONT__ 3 | 4 | extern int Init_Font(void); //显示字体库前先调用本函数进行初始化 5 | 6 | extern void UnInit_Font(void); //程序退出前,调用本函数 7 | 8 | extern int Clean_Area(int X,//x坐标起始点 9 | int Y,//y坐标起始点 10 | int width,//绘制的宽度 11 | int height,//绘制的高度 12 | unsigned long color);//往屏幕指定区域填充颜色 13 | 14 | extern int Display_characterX(unsigned int x,//x坐标起始点 15 | unsigned int y,//y坐标起始点 16 | unsigned char *string,//GB2312 中文字符串 17 | unsigned int color ,//字体颜色值 18 | int size);//字体放大倍数 1~8 19 | #endif -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/api_v4l2.h: -------------------------------------------------------------------------------- 1 | /************************************************* 2 | File name : api_v4l2.h 3 | Create date : 2014-07-01 19:42 4 | Modified date : 2014-07-01 19:42 5 | Author : heqingde 6 | Email : hqd173@163.com 7 | 8 | ***********************************************/ 9 | #ifndef API_V4L2_H_ 10 | #define API_V4L2_H_ 11 | 12 | #define VIDEO_WIDTH 640 13 | #define VIDEO_HEIGHT 480 14 | #define MAX_CAM_RES 32 //camres res 15 | #define BUFFER_COUNT 4 //buffer zone 16 | #define FPS 30 17 | #define MAX_CAM_RES 32 18 | //#define CAMERA_DEVICE "/dev/video1" 19 | 20 | #define exit_error(s)\ 21 | do{\ 22 | printf("%s is error\n",s);\ 23 | return (-1);\ 24 | }while(0) 25 | 26 | 27 | /********************************* 28 | * NAME:VideoBuffer struct 29 | * Function: Describe buffer V4L2 driver assigns and maps 30 | * Member: start: point of buffer 31 | * length: total length of buffer 32 | **********************************/ 33 | typedef struct Video_Buffer 34 | { 35 | void *start; 36 | int length; 37 | }VideoBuffer; 38 | /******************************* 39 | * nan=me :fream_buffer 40 | * Function: save fream 41 | * member: buf :point of buf 42 | * length:total length op buf 43 | ********************************/ 44 | typedef struct Frame_Buffer 45 | { 46 | char buf[1843200]; 47 | int length; 48 | 49 | }FrameBuffer; 50 | /************************************ 51 | *name:CamRes 52 | *Function:CamRes format 53 | *Member: width : format width 54 | *height: format height 55 | */ 56 | typedef struct CamRes 57 | { 58 | int width; 59 | int height; 60 | }CamRes; 61 | /************************************* 62 | *name:CamResList struct 63 | *Function:CamRes format list 64 | *Member: cam_res :struct CamRes 65 | *res_num:camres format number 66 | */ 67 | typedef struct CamResList 68 | { 69 | struct CamRes *cam_res; 70 | int res_num; 71 | }CamResList; 72 | 73 | /************************************* 74 | *name:device_init 75 | *Function:Initial Camera v4l2 76 | */ 77 | int linux_v4l2_device_init(const char *dev); 78 | 79 | /************************************ 80 | *name:start_capturing 81 | *Function: starting Capture Options 82 | */ 83 | int linux_v4l2_start_capturing(); 84 | 85 | /************************************ 86 | *name:stop_capturing 87 | *Function: stop Capture Options 88 | */ 89 | int linux_v4l2_stop_capturing(); 90 | 91 | /************************************ 92 | *name :device_uinit 93 | *Function:uinit device 94 | */ 95 | int linux_v4l2_device_uinit(); 96 | /************************************ 97 | *name :linux_v4l2_get_fream 98 | *Function:save device_stream data; 99 | */ 100 | int linux_v4l2_get_fream(FrameBuffer *freambuf); 101 | #endif /*API_V4L2_H*/ 102 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.h. Generated from jconfig.cfg by configure. */ 2 | /* jconfig.cfg --- source file edited by configure script */ 3 | /* see jconfig.txt for explanations */ 4 | 5 | #define HAVE_PROTOTYPES 1 6 | #define HAVE_UNSIGNED_CHAR 1 7 | #define HAVE_UNSIGNED_SHORT 1 8 | /* #undef void */ 9 | /* #undef const */ 10 | /* #undef CHAR_IS_UNSIGNED */ 11 | #define HAVE_STDDEF_H 1 12 | #define HAVE_STDLIB_H 1 13 | #define HAVE_LOCALE_H 1 14 | /* #undef NEED_BSD_STRINGS */ 15 | /* #undef NEED_SYS_TYPES_H */ 16 | /* #undef NEED_FAR_POINTERS */ 17 | /* #undef NEED_SHORT_EXTERNAL_NAMES */ 18 | /* Define this if you get warnings about undefined structures. */ 19 | /* #undef INCOMPLETE_TYPES_BROKEN */ 20 | 21 | /* Define "boolean" as unsigned char, not int, on Windows systems. */ 22 | #ifdef _WIN32 23 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 24 | typedef unsigned char boolean; 25 | #endif 26 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 27 | #endif 28 | 29 | #ifdef JPEG_INTERNALS 30 | 31 | /* #undef RIGHT_SHIFT_IS_UNSIGNED */ 32 | #define INLINE __inline__ 33 | /* These are for configuring the JPEG memory manager. */ 34 | /* #undef DEFAULT_MAX_MEM */ 35 | /* #undef NO_MKTEMP */ 36 | 37 | #endif /* JPEG_INTERNALS */ 38 | 39 | #ifdef JPEG_CJPEG_DJPEG 40 | 41 | #define BMP_SUPPORTED /* BMP image file format */ 42 | #define GIF_SUPPORTED /* GIF image file format */ 43 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 44 | /* #undef RLE_SUPPORTED */ 45 | #define TARGA_SUPPORTED /* Targa image file format */ 46 | 47 | /* #undef TWO_FILE_COMMANDLINE */ 48 | /* #undef NEED_SIGNAL_CATCHER */ 49 | /* #undef DONT_USE_B_MODE */ 50 | 51 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 52 | /* #undef PROGRESS_REPORT */ 53 | 54 | #endif /* JPEG_CJPEG_DJPEG */ 55 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/jerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jerror.h 3 | * 4 | * Copyright (C) 1994-1997, Thomas G. Lane. 5 | * Modified 1997-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file defines the error and message codes for the JPEG library. 10 | * Edit this file to add new codes, or to translate the message strings to 11 | * some other language. 12 | * A set of error-reporting macros are defined too. Some applications using 13 | * the JPEG library may wish to include this file to get the error codes 14 | * and/or the macros. 15 | */ 16 | 17 | /* 18 | * To define the enum list of message codes, include this file without 19 | * defining macro JMESSAGE. To create a message string table, include it 20 | * again with a suitable JMESSAGE definition (see jerror.c for an example). 21 | */ 22 | #ifndef JMESSAGE 23 | #ifndef JERROR_H 24 | /* First time through, define the enum list */ 25 | #define JMAKE_ENUM_LIST 26 | #else 27 | /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ 28 | #define JMESSAGE(code,string) 29 | #endif /* JERROR_H */ 30 | #endif /* JMESSAGE */ 31 | 32 | #ifdef JMAKE_ENUM_LIST 33 | 34 | typedef enum { 35 | 36 | #define JMESSAGE(code,string) code , 37 | 38 | #endif /* JMAKE_ENUM_LIST */ 39 | 40 | JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ 41 | 42 | /* For maintenance convenience, list is alphabetical by message code name */ 43 | JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") 44 | JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") 45 | JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") 46 | JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") 47 | JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") 48 | JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") 49 | JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") 50 | JMESSAGE(JERR_BAD_DROP_SAMPLING, 51 | "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") 52 | JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") 53 | JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") 54 | JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") 55 | JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") 56 | JMESSAGE(JERR_BAD_LIB_VERSION, 57 | "Wrong JPEG library version: library is %d, caller expects %d") 58 | JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") 59 | JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") 60 | JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") 61 | JMESSAGE(JERR_BAD_PROGRESSION, 62 | "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") 63 | JMESSAGE(JERR_BAD_PROG_SCRIPT, 64 | "Invalid progressive parameters at scan script entry %d") 65 | JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") 66 | JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") 67 | JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") 68 | JMESSAGE(JERR_BAD_STRUCT_SIZE, 69 | "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") 70 | JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") 71 | JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") 72 | JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") 73 | JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") 74 | JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") 75 | JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") 76 | JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") 77 | JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") 78 | JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") 79 | JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") 80 | JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") 81 | JMESSAGE(JERR_EMS_READ, "Read from EMS failed") 82 | JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") 83 | JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") 84 | JMESSAGE(JERR_FILE_READ, "Input file read error") 85 | JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") 86 | JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") 87 | JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") 88 | JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") 89 | JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") 90 | JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") 91 | JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") 92 | JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, 93 | "Cannot transcode due to multiple use of quantization table %d") 94 | JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") 95 | JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") 96 | JMESSAGE(JERR_NOTIMPL, "Not implemented yet") 97 | JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") 98 | JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") 99 | JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") 100 | JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") 101 | JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") 102 | JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") 103 | JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") 104 | JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") 105 | JMESSAGE(JERR_QUANT_COMPONENTS, 106 | "Cannot quantize more than %d color components") 107 | JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") 108 | JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") 109 | JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") 110 | JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") 111 | JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") 112 | JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") 113 | JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") 114 | JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") 115 | JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") 116 | JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") 117 | JMESSAGE(JERR_TFILE_WRITE, 118 | "Write failed on temporary file --- out of disk space?") 119 | JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") 120 | JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") 121 | JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") 122 | JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") 123 | JMESSAGE(JERR_XMS_READ, "Read from XMS failed") 124 | JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") 125 | JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) 126 | JMESSAGE(JMSG_VERSION, JVERSION) 127 | JMESSAGE(JTRC_16BIT_TABLES, 128 | "Caution: quantization tables are too coarse for baseline JPEG") 129 | JMESSAGE(JTRC_ADOBE, 130 | "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") 131 | JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") 132 | JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") 133 | JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") 134 | JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") 135 | JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") 136 | JMESSAGE(JTRC_DRI, "Define Restart Interval %u") 137 | JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") 138 | JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") 139 | JMESSAGE(JTRC_EOI, "End Of Image") 140 | JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") 141 | JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") 142 | JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, 143 | "Warning: thumbnail image size does not match data length %u") 144 | JMESSAGE(JTRC_JFIF_EXTENSION, 145 | "JFIF extension marker: type 0x%02x, length %u") 146 | JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") 147 | JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") 148 | JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") 149 | JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") 150 | JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") 151 | JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") 152 | JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") 153 | JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") 154 | JMESSAGE(JTRC_RST, "RST%d") 155 | JMESSAGE(JTRC_SMOOTH_NOTIMPL, 156 | "Smoothing not supported with nonstandard sampling ratios") 157 | JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") 158 | JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") 159 | JMESSAGE(JTRC_SOI, "Start of Image") 160 | JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") 161 | JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") 162 | JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") 163 | JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") 164 | JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") 165 | JMESSAGE(JTRC_THUMB_JPEG, 166 | "JFIF extension marker: JPEG-compressed thumbnail image, length %u") 167 | JMESSAGE(JTRC_THUMB_PALETTE, 168 | "JFIF extension marker: palette thumbnail image, length %u") 169 | JMESSAGE(JTRC_THUMB_RGB, 170 | "JFIF extension marker: RGB thumbnail image, length %u") 171 | JMESSAGE(JTRC_UNKNOWN_IDS, 172 | "Unrecognized component IDs %d %d %d, assuming YCbCr") 173 | JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") 174 | JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") 175 | JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") 176 | JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") 177 | JMESSAGE(JWRN_BOGUS_PROGRESSION, 178 | "Inconsistent progression sequence for component %d coefficient %d") 179 | JMESSAGE(JWRN_EXTRANEOUS_DATA, 180 | "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") 181 | JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") 182 | JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") 183 | JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") 184 | JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") 185 | JMESSAGE(JWRN_MUST_RESYNC, 186 | "Corrupt JPEG data: found marker 0x%02x instead of RST%d") 187 | JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") 188 | JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") 189 | 190 | #ifdef JMAKE_ENUM_LIST 191 | 192 | JMSG_LASTMSGCODE 193 | } J_MESSAGE_CODE; 194 | 195 | #undef JMAKE_ENUM_LIST 196 | #endif /* JMAKE_ENUM_LIST */ 197 | 198 | /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ 199 | #undef JMESSAGE 200 | 201 | 202 | #ifndef JERROR_H 203 | #define JERROR_H 204 | 205 | /* Macros to simplify using the error and trace message stuff */ 206 | /* The first parameter is either type of cinfo pointer */ 207 | 208 | /* Fatal errors (print message and exit) */ 209 | #define ERREXIT(cinfo,code) \ 210 | ((cinfo)->err->msg_code = (code), \ 211 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 212 | #define ERREXIT1(cinfo,code,p1) \ 213 | ((cinfo)->err->msg_code = (code), \ 214 | (cinfo)->err->msg_parm.i[0] = (p1), \ 215 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 216 | #define ERREXIT2(cinfo,code,p1,p2) \ 217 | ((cinfo)->err->msg_code = (code), \ 218 | (cinfo)->err->msg_parm.i[0] = (p1), \ 219 | (cinfo)->err->msg_parm.i[1] = (p2), \ 220 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 221 | #define ERREXIT3(cinfo,code,p1,p2,p3) \ 222 | ((cinfo)->err->msg_code = (code), \ 223 | (cinfo)->err->msg_parm.i[0] = (p1), \ 224 | (cinfo)->err->msg_parm.i[1] = (p2), \ 225 | (cinfo)->err->msg_parm.i[2] = (p3), \ 226 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 227 | #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ 228 | ((cinfo)->err->msg_code = (code), \ 229 | (cinfo)->err->msg_parm.i[0] = (p1), \ 230 | (cinfo)->err->msg_parm.i[1] = (p2), \ 231 | (cinfo)->err->msg_parm.i[2] = (p3), \ 232 | (cinfo)->err->msg_parm.i[3] = (p4), \ 233 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 234 | #define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ 235 | ((cinfo)->err->msg_code = (code), \ 236 | (cinfo)->err->msg_parm.i[0] = (p1), \ 237 | (cinfo)->err->msg_parm.i[1] = (p2), \ 238 | (cinfo)->err->msg_parm.i[2] = (p3), \ 239 | (cinfo)->err->msg_parm.i[3] = (p4), \ 240 | (cinfo)->err->msg_parm.i[4] = (p5), \ 241 | (cinfo)->err->msg_parm.i[5] = (p6), \ 242 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 243 | #define ERREXITS(cinfo,code,str) \ 244 | ((cinfo)->err->msg_code = (code), \ 245 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 246 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 247 | 248 | #define MAKESTMT(stuff) do { stuff } while (0) 249 | 250 | /* Nonfatal errors (we can keep going, but the data is probably corrupt) */ 251 | #define WARNMS(cinfo,code) \ 252 | ((cinfo)->err->msg_code = (code), \ 253 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 254 | #define WARNMS1(cinfo,code,p1) \ 255 | ((cinfo)->err->msg_code = (code), \ 256 | (cinfo)->err->msg_parm.i[0] = (p1), \ 257 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 258 | #define WARNMS2(cinfo,code,p1,p2) \ 259 | ((cinfo)->err->msg_code = (code), \ 260 | (cinfo)->err->msg_parm.i[0] = (p1), \ 261 | (cinfo)->err->msg_parm.i[1] = (p2), \ 262 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 263 | 264 | /* Informational/debugging messages */ 265 | #define TRACEMS(cinfo,lvl,code) \ 266 | ((cinfo)->err->msg_code = (code), \ 267 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 268 | #define TRACEMS1(cinfo,lvl,code,p1) \ 269 | ((cinfo)->err->msg_code = (code), \ 270 | (cinfo)->err->msg_parm.i[0] = (p1), \ 271 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 272 | #define TRACEMS2(cinfo,lvl,code,p1,p2) \ 273 | ((cinfo)->err->msg_code = (code), \ 274 | (cinfo)->err->msg_parm.i[0] = (p1), \ 275 | (cinfo)->err->msg_parm.i[1] = (p2), \ 276 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 277 | #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ 278 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 279 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ 280 | (cinfo)->err->msg_code = (code); \ 281 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 282 | #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ 283 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 284 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 285 | (cinfo)->err->msg_code = (code); \ 286 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 287 | #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ 288 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 289 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 290 | _mp[4] = (p5); \ 291 | (cinfo)->err->msg_code = (code); \ 292 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 293 | #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ 294 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 295 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 296 | _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ 297 | (cinfo)->err->msg_code = (code); \ 298 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 299 | #define TRACEMSS(cinfo,lvl,code,str) \ 300 | ((cinfo)->err->msg_code = (code), \ 301 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 302 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 303 | 304 | #endif /* JERROR_H */ 305 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/jmorecfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jmorecfg.h 3 | * 4 | * Copyright (C) 1991-1997, Thomas G. Lane. 5 | * Modified 1997-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains additional configuration options that customize the 10 | * JPEG software for special applications or support machine-dependent 11 | * optimizations. Most users will not need to touch this file. 12 | */ 13 | 14 | 15 | /* 16 | * Define BITS_IN_JSAMPLE as either 17 | * 8 for 8-bit sample values (the usual setting) 18 | * 12 for 12-bit sample values 19 | * Only 8 and 12 are legal data precisions for lossy JPEG according to the 20 | * JPEG standard, and the IJG code does not support anything else! 21 | * We do not support run-time selection of data precision, sorry. 22 | */ 23 | 24 | #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ 25 | 26 | 27 | /* 28 | * Maximum number of components (color channels) allowed in JPEG image. 29 | * To meet the letter of the JPEG spec, set this to 255. However, darn 30 | * few applications need more than 4 channels (maybe 5 for CMYK + alpha 31 | * mask). We recommend 10 as a reasonable compromise; use 4 if you are 32 | * really short on memory. (Each allowed component costs a hundred or so 33 | * bytes of storage, whether actually used in an image or not.) 34 | */ 35 | 36 | #define MAX_COMPONENTS 10 /* maximum number of image components */ 37 | 38 | 39 | /* 40 | * Basic data types. 41 | * You may need to change these if you have a machine with unusual data 42 | * type sizes; for example, "char" not 8 bits, "short" not 16 bits, 43 | * or "long" not 32 bits. We don't care whether "int" is 16 or 32 bits, 44 | * but it had better be at least 16. 45 | */ 46 | 47 | /* Representation of a single sample (pixel element value). 48 | * We frequently allocate large arrays of these, so it's important to keep 49 | * them small. But if you have memory to burn and access to char or short 50 | * arrays is very slow on your hardware, you might want to change these. 51 | */ 52 | 53 | #if BITS_IN_JSAMPLE == 8 54 | /* JSAMPLE should be the smallest type that will hold the values 0..255. 55 | * You can use a signed char by having GETJSAMPLE mask it with 0xFF. 56 | */ 57 | 58 | #ifdef HAVE_UNSIGNED_CHAR 59 | 60 | typedef unsigned char JSAMPLE; 61 | #define GETJSAMPLE(value) ((int) (value)) 62 | 63 | #else /* not HAVE_UNSIGNED_CHAR */ 64 | 65 | typedef char JSAMPLE; 66 | #ifdef CHAR_IS_UNSIGNED 67 | #define GETJSAMPLE(value) ((int) (value)) 68 | #else 69 | #define GETJSAMPLE(value) ((int) (value) & 0xFF) 70 | #endif /* CHAR_IS_UNSIGNED */ 71 | 72 | #endif /* HAVE_UNSIGNED_CHAR */ 73 | 74 | #define MAXJSAMPLE 255 75 | #define CENTERJSAMPLE 128 76 | 77 | #endif /* BITS_IN_JSAMPLE == 8 */ 78 | 79 | 80 | #if BITS_IN_JSAMPLE == 12 81 | /* JSAMPLE should be the smallest type that will hold the values 0..4095. 82 | * On nearly all machines "short" will do nicely. 83 | */ 84 | 85 | typedef short JSAMPLE; 86 | #define GETJSAMPLE(value) ((int) (value)) 87 | 88 | #define MAXJSAMPLE 4095 89 | #define CENTERJSAMPLE 2048 90 | 91 | #endif /* BITS_IN_JSAMPLE == 12 */ 92 | 93 | 94 | /* Representation of a DCT frequency coefficient. 95 | * This should be a signed value of at least 16 bits; "short" is usually OK. 96 | * Again, we allocate large arrays of these, but you can change to int 97 | * if you have memory to burn and "short" is really slow. 98 | */ 99 | 100 | typedef short JCOEF; 101 | 102 | 103 | /* Compressed datastreams are represented as arrays of JOCTET. 104 | * These must be EXACTLY 8 bits wide, at least once they are written to 105 | * external storage. Note that when using the stdio data source/destination 106 | * managers, this is also the data type passed to fread/fwrite. 107 | */ 108 | 109 | #ifdef HAVE_UNSIGNED_CHAR 110 | 111 | typedef unsigned char JOCTET; 112 | #define GETJOCTET(value) (value) 113 | 114 | #else /* not HAVE_UNSIGNED_CHAR */ 115 | 116 | typedef char JOCTET; 117 | #ifdef CHAR_IS_UNSIGNED 118 | #define GETJOCTET(value) (value) 119 | #else 120 | #define GETJOCTET(value) ((value) & 0xFF) 121 | #endif /* CHAR_IS_UNSIGNED */ 122 | 123 | #endif /* HAVE_UNSIGNED_CHAR */ 124 | 125 | 126 | /* These typedefs are used for various table entries and so forth. 127 | * They must be at least as wide as specified; but making them too big 128 | * won't cost a huge amount of memory, so we don't provide special 129 | * extraction code like we did for JSAMPLE. (In other words, these 130 | * typedefs live at a different point on the speed/space tradeoff curve.) 131 | */ 132 | 133 | /* UINT8 must hold at least the values 0..255. */ 134 | 135 | #ifdef HAVE_UNSIGNED_CHAR 136 | typedef unsigned char UINT8; 137 | #else /* not HAVE_UNSIGNED_CHAR */ 138 | #ifdef CHAR_IS_UNSIGNED 139 | typedef char UINT8; 140 | #else /* not CHAR_IS_UNSIGNED */ 141 | typedef short UINT8; 142 | #endif /* CHAR_IS_UNSIGNED */ 143 | #endif /* HAVE_UNSIGNED_CHAR */ 144 | 145 | /* UINT16 must hold at least the values 0..65535. */ 146 | 147 | #ifdef HAVE_UNSIGNED_SHORT 148 | typedef unsigned short UINT16; 149 | #else /* not HAVE_UNSIGNED_SHORT */ 150 | typedef unsigned int UINT16; 151 | #endif /* HAVE_UNSIGNED_SHORT */ 152 | 153 | /* INT16 must hold at least the values -32768..32767. */ 154 | 155 | #ifndef XMD_H /* X11/xmd.h correctly defines INT16 */ 156 | typedef short INT16; 157 | #endif 158 | 159 | /* INT32 must hold at least signed 32-bit values. */ 160 | 161 | #ifndef XMD_H /* X11/xmd.h correctly defines INT32 */ 162 | #ifndef _BASETSD_H_ /* Microsoft defines it in basetsd.h */ 163 | #ifndef _BASETSD_H /* MinGW is slightly different */ 164 | #ifndef QGLOBAL_H /* Qt defines it in qglobal.h */ 165 | typedef long INT32; 166 | #endif 167 | #endif 168 | #endif 169 | #endif 170 | 171 | /* Datatype used for image dimensions. The JPEG standard only supports 172 | * images up to 64K*64K due to 16-bit fields in SOF markers. Therefore 173 | * "unsigned int" is sufficient on all machines. However, if you need to 174 | * handle larger images and you don't mind deviating from the spec, you 175 | * can change this datatype. 176 | */ 177 | 178 | typedef unsigned int JDIMENSION; 179 | 180 | #define JPEG_MAX_DIMENSION 65500L /* a tad under 64K to prevent overflows */ 181 | 182 | 183 | /* These macros are used in all function definitions and extern declarations. 184 | * You could modify them if you need to change function linkage conventions; 185 | * in particular, you'll need to do that to make the library a Windows DLL. 186 | * Another application is to make all functions global for use with debuggers 187 | * or code profilers that require it. 188 | */ 189 | 190 | /* a function called through method pointers: */ 191 | #define METHODDEF(type) static type 192 | /* a function used only in its module: */ 193 | #define LOCAL(type) static type 194 | /* a function referenced thru EXTERNs: */ 195 | #define GLOBAL(type) type 196 | /* a reference to a GLOBAL function: */ 197 | #define EXTERN(type) extern type 198 | 199 | 200 | /* This macro is used to declare a "method", that is, a function pointer. 201 | * We want to supply prototype parameters if the compiler can cope. 202 | * Note that the arglist parameter must be parenthesized! 203 | * Again, you can customize this if you need special linkage keywords. 204 | */ 205 | 206 | #ifdef HAVE_PROTOTYPES 207 | #define JMETHOD(type,methodname,arglist) type (*methodname) arglist 208 | #else 209 | #define JMETHOD(type,methodname,arglist) type (*methodname) () 210 | #endif 211 | 212 | 213 | /* Here is the pseudo-keyword for declaring pointers that must be "far" 214 | * on 80x86 machines. Most of the specialized coding for 80x86 is handled 215 | * by just saying "FAR *" where such a pointer is needed. In a few places 216 | * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol. 217 | */ 218 | 219 | #ifndef FAR 220 | #ifdef NEED_FAR_POINTERS 221 | #define FAR far 222 | #else 223 | #define FAR 224 | #endif 225 | #endif 226 | 227 | 228 | /* 229 | * On a few systems, type boolean and/or its values FALSE, TRUE may appear 230 | * in standard header files. Or you may have conflicts with application- 231 | * specific header files that you want to include together with these files. 232 | * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. 233 | */ 234 | 235 | #ifndef HAVE_BOOLEAN 236 | typedef int boolean; 237 | #endif 238 | #ifndef FALSE /* in case these macros already exist */ 239 | #define FALSE 0 /* values of boolean */ 240 | #endif 241 | #ifndef TRUE 242 | #define TRUE 1 243 | #endif 244 | 245 | 246 | /* 247 | * The remaining options affect code selection within the JPEG library, 248 | * but they don't need to be visible to most applications using the library. 249 | * To minimize application namespace pollution, the symbols won't be 250 | * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined. 251 | */ 252 | 253 | #ifdef JPEG_INTERNALS 254 | #define JPEG_INTERNAL_OPTIONS 255 | #endif 256 | 257 | #ifdef JPEG_INTERNAL_OPTIONS 258 | 259 | 260 | /* 261 | * These defines indicate whether to include various optional functions. 262 | * Undefining some of these symbols will produce a smaller but less capable 263 | * library. Note that you can leave certain source files out of the 264 | * compilation/linking process if you've #undef'd the corresponding symbols. 265 | * (You may HAVE to do that if your compiler doesn't like null source files.) 266 | */ 267 | 268 | /* Capability options common to encoder and decoder: */ 269 | 270 | #define DCT_ISLOW_SUPPORTED /* slow but accurate integer algorithm */ 271 | #define DCT_IFAST_SUPPORTED /* faster, less accurate integer method */ 272 | #define DCT_FLOAT_SUPPORTED /* floating-point: accurate, fast on fast HW */ 273 | 274 | /* Encoder capability options: */ 275 | 276 | #define C_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ 277 | #define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 278 | #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ 279 | #define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ 280 | #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ 281 | /* Note: if you selected 12-bit data precision, it is dangerous to turn off 282 | * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit 283 | * precision, so jchuff.c normally uses entropy optimization to compute 284 | * usable tables for higher precision. If you don't want to do optimization, 285 | * you'll have to supply different default Huffman tables. 286 | * The exact same statements apply for progressive JPEG: the default tables 287 | * don't work for progressive mode. (This may get fixed, however.) 288 | */ 289 | #define INPUT_SMOOTHING_SUPPORTED /* Input image smoothing option? */ 290 | 291 | /* Decoder capability options: */ 292 | 293 | #define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ 294 | #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ 295 | #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ 296 | #define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ 297 | #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ 298 | #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ 299 | #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ 300 | #define UPSAMPLE_MERGING_SUPPORTED /* Fast path for sloppy upsampling? */ 301 | #define QUANT_1PASS_SUPPORTED /* 1-pass color quantization? */ 302 | #define QUANT_2PASS_SUPPORTED /* 2-pass color quantization? */ 303 | 304 | /* more capability options later, no doubt */ 305 | 306 | 307 | /* 308 | * Ordering of RGB data in scanlines passed to or from the application. 309 | * If your application wants to deal with data in the order B,G,R, just 310 | * change these macros. You can also deal with formats such as R,G,B,X 311 | * (one extra byte per pixel) by changing RGB_PIXELSIZE. Note that changing 312 | * the offsets will also change the order in which colormap data is organized. 313 | * RESTRICTIONS: 314 | * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats. 315 | * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not 316 | * useful if you are using JPEG color spaces other than YCbCr or grayscale. 317 | * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE 318 | * is not 3 (they don't understand about dummy color components!). So you 319 | * can't use color quantization if you change that value. 320 | */ 321 | 322 | #define RGB_RED 0 /* Offset of Red in an RGB scanline element */ 323 | #define RGB_GREEN 1 /* Offset of Green */ 324 | #define RGB_BLUE 2 /* Offset of Blue */ 325 | #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ 326 | 327 | 328 | /* Definitions for speed-related optimizations. */ 329 | 330 | 331 | /* If your compiler supports inline functions, define INLINE 332 | * as the inline keyword; otherwise define it as empty. 333 | */ 334 | 335 | #ifndef INLINE 336 | #ifdef __GNUC__ /* for instance, GNU C knows about inline */ 337 | #define INLINE __inline__ 338 | #endif 339 | #ifndef INLINE 340 | #define INLINE /* default is to define it as empty */ 341 | #endif 342 | #endif 343 | 344 | 345 | /* On some machines (notably 68000 series) "int" is 32 bits, but multiplying 346 | * two 16-bit shorts is faster than multiplying two ints. Define MULTIPLIER 347 | * as short on such a machine. MULTIPLIER must be at least 16 bits wide. 348 | */ 349 | 350 | #ifndef MULTIPLIER 351 | #define MULTIPLIER int /* type for fastest integer multiply */ 352 | #endif 353 | 354 | 355 | /* FAST_FLOAT should be either float or double, whichever is done faster 356 | * by your compiler. (Note that this type is only used in the floating point 357 | * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.) 358 | * Typically, float is faster in ANSI C compilers, while double is faster in 359 | * pre-ANSI compilers (because they insist on converting to double anyway). 360 | * The code below therefore chooses float if we have ANSI-style prototypes. 361 | */ 362 | 363 | #ifndef FAST_FLOAT 364 | #ifdef HAVE_PROTOTYPES 365 | #define FAST_FLOAT float 366 | #else 367 | #define FAST_FLOAT double 368 | #endif 369 | #endif 370 | 371 | #endif /* JPEG_INTERNAL_OPTIONS */ 372 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/kernel_list.h: -------------------------------------------------------------------------------- 1 | #ifndef __DLIST_H 2 | #define __DLIST_H 3 | 4 | /* This file is from Linux Kernel (include/linux/list.h) 5 | * and modified by simply removing hardware prefetching of list items. 6 | * Here by copyright, credits attributed to wherever they belong. 7 | * Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu) 8 | */ 9 | 10 | /* 11 | * Simple doubly linked list implementation. 12 | * 13 | * Some of the internal functions (“__xxx”) are useful when 14 | * manipulating whole lists rather than single entries, as 15 | * sometimes we already know the next/prev entries and we can 16 | * generate better code by using them directly rather than 17 | * using the generic single-entry routines. 18 | */ 19 | /** 20 | * container_of - cast a member of a structure out to the containing structure 21 | * 22 | * @ptr: the pointer to the member. 23 | * @type: the type of the container struct this is embedded in. 24 | * @member: the name of the member within the struct. 25 | * 26 | */ 27 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 28 | 29 | #define container_of(ptr, type, member) ({ \ 30 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 31 | (type *)( (char *)__mptr - offsetof(type,member) );}) 32 | /* 33 | * These are non-NULL pointers that will result in page faults 34 | * under normal circumstances, used to verify that nobody uses 35 | * non-initialized list entries. 36 | */ 37 | #define LIST_POISON1 ((void *) 0x00100100) 38 | #define LIST_POISON2 ((void *) 0x00200) 39 | 40 | struct list_head { 41 | struct list_head *next; 42 | struct list_head *prev; 43 | }; 44 | 45 | #define LIST_HEAD_INIT(name) { &(name), &(name) } 46 | 47 | #define LIST_HEAD(name) \ 48 | struct list_head name = LIST_HEAD_INIT(name) 49 | 50 | #define INIT_LIST_HEAD(ptr) do { \ 51 | (ptr)->next = (ptr); (ptr)->prev = (ptr); \ 52 | } while (0) 53 | 54 | /* 55 | * Insert a new entry between two known consecutive entries. 56 | * 57 | * This is only for internal list manipulation where we know 58 | * the prev/next entries already! 59 | */ 60 | static inline void __list_add(struct list_head *new, // 要插入的节点 61 | struct list_head *prev,// 前节点 before 62 | struct list_head *next) // 后节点 after 63 | { 64 | next->prev = new; // 后节点的上家为new 65 | new->next = next; 66 | new->prev = prev; 67 | prev->next = new; 68 | } 69 | 70 | /** 71 | * list_add – add a new entry 72 | * @new: new entry to be added 73 | * @head: list head to add it after 74 | * 75 | * Insert a new entry after the specified head. 76 | * This is good for implementing stacks. 77 | */ 78 | static inline void list_add(struct list_head *new, struct list_head *head) 79 | { 80 | __list_add(new, head, head->next); 81 | } 82 | 83 | /** 84 | * list_add_tail – add a new entry 85 | * @new: new entry to be added 86 | * @head: list head to add it before 87 | * 88 | * Insert a new entry before the specified head. 89 | * This is useful for implementing queues. 90 | */ 91 | static inline void list_add_tail(struct list_head *new, struct list_head *head) 92 | { 93 | __list_add(new, head->prev, head); 94 | } 95 | 96 | /* 97 | * Delete a list entry by making the prev/next entries 98 | * point to each other. 99 | * 100 | * This is only for internal list manipulation where we know 101 | * the prev/next entries already! 102 | */ 103 | static inline void __list_del(struct list_head *prev, struct list_head *next) 104 | { 105 | next->prev = prev; 106 | prev->next = next; 107 | } 108 | 109 | /** 110 | * list_del – deletes entry from list. 111 | * @entry: the element to delete from the list. 112 | * Note: list_empty on entry does not return true after this, the entry is in an undefined state. 113 | */ 114 | static inline void list_del(struct list_head *entry) 115 | { 116 | __list_del(entry->prev, entry->next); 117 | entry->next = (void *) 0; 118 | entry->prev = (void *) 0; 119 | } 120 | 121 | /** 122 | * list_del_init – deletes entry from list and reinitialize it. 123 | * @entry: the element to delete from the list. 124 | */ 125 | static inline void list_del_init(struct list_head *entry) 126 | { 127 | __list_del(entry->prev, entry->next); 128 | INIT_LIST_HEAD(entry); 129 | } 130 | 131 | /** 132 | * list_move – delete from one list and add as another’s head 133 | * @list: the entry to move 134 | * @head: the head that will precede our entry 135 | */ 136 | static inline void list_move(struct list_head *list, 137 | struct list_head *head) 138 | { 139 | __list_del(list->prev, list->next); 140 | list_add(list, head); 141 | } 142 | 143 | /** 144 | * list_move_tail – delete from one list and add as another’s tail 145 | * @list: the entry to move 146 | * @head: the head that will follow our entry 147 | */ 148 | static inline void list_move_tail(struct list_head *list, 149 | struct list_head *head) 150 | { 151 | __list_del(list->prev, list->next); 152 | list_add_tail(list, head); 153 | } 154 | 155 | /** 156 | * list_empty – tests whether a list is empty 157 | * @head: the list to test. 158 | */ 159 | static inline int list_empty(struct list_head *head) 160 | { 161 | return head->next == head; 162 | } 163 | 164 | static inline void __list_splice(struct list_head *list, 165 | struct list_head *head) 166 | { 167 | struct list_head *first = list->next; 168 | struct list_head *last = list->prev; 169 | struct list_head *at = head->next; 170 | 171 | first->prev = head; 172 | head->next = first; 173 | 174 | last->next = at; 175 | at->prev = last; 176 | } 177 | 178 | /** 179 | * list_splice – join two lists 180 | * @list: the new list to add. 181 | * @head: the place to add it in the first list. 182 | */ 183 | static inline void list_splice(struct list_head *list, struct list_head *head) 184 | { 185 | if (!list_empty(list)) 186 | __list_splice(list, head); 187 | } 188 | 189 | /** 190 | * list_splice_init – join two lists and reinitialise the emptied list. 191 | * @list: the new list to add. 192 | * @head: the place to add it in the first list. 193 | * 194 | * The list at @list is reinitialised 195 | */ 196 | static inline void list_splice_init(struct list_head *list, 197 | struct list_head *head) 198 | { 199 | if (!list_empty(list)) { 200 | __list_splice(list, head); 201 | INIT_LIST_HEAD(list); 202 | } 203 | } 204 | 205 | /** 206 | * list_entry – get the struct for this entry 207 | * @ptr: the &struct list_head pointer. 208 | * @type: the type of the struct this is embedded in. 209 | * @member: the name of the list_struct within the struct. 210 | */ 211 | #define list_entry(ptr, type, member) \ 212 | ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) 213 | 214 | /** 215 | * list_for_each - iterate over a list 216 | * @pos: the &struct list_head to use as a loop counter. // p 217 | * @head: the head for your list. 218 | */ 219 | #define list_for_each(pos, head) \ 220 | for (pos = (head)->next; pos != (head); \ 221 | pos = pos->next) 222 | /** 223 | * list_for_each_prev - iterate over a list backwards 224 | * @pos: the &struct list_head to use as a loop counter. 225 | * @head: the head for your list. 226 | */ 227 | #define list_for_each_prev(pos, head) \ 228 | for (pos = (head)->prev; pos != (head); \ 229 | pos = pos->prev) 230 | 231 | /** 232 | * list_for_each_safe - iterate over a list safe against removal of list entry 233 | * @pos: the &struct list_head to use as a loop counter. 234 | * @n: another &struct list_head to use as temporary storage 235 | * @head: the head for your list. 236 | */ 237 | #define list_for_each_safe(pos, n, head) \ 238 | for (pos = (head)->next, n = pos->next; pos != (head); \ 239 | pos = n, n = pos->next) 240 | 241 | /** 242 | * list_for_each_entry - iterate over list of given type 243 | * @pos: the type * to use as a loop counter. 244 | * @head: the head for your list. 245 | * @member: the name of the list_struct within the struct. 246 | */ 247 | #define list_for_each_entry(pos, head, member) \ 248 | for (pos = list_entry((head)->next, typeof(*pos), member); \ 249 | &pos->member != (head); \ 250 | pos = list_entry(pos->member.next, typeof(*pos), member)) 251 | 252 | /** 253 | * list_for_each_entry_safe – iterate over list of given type safe against removal of list entry 254 | * @pos: the type * to use as a loop counter. 255 | * @n: another type * to use as temporary storage 256 | * @head: the head for your list. 257 | * @member: the name of the list_struct within the struct. 258 | */ 259 | #define list_for_each_entry_safe(pos, n, head, member) \ 260 | for (pos = list_entry((head)->next, typeof(*pos), member), \ 261 | n = list_entry(pos->member.next, typeof(*pos), member); \ 262 | &pos->member != (head); \ 263 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) 264 | 265 | #endif 266 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/libapi_v4l2_arm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/jpeg/libapi_v4l2_arm.so -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/libjpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/jpeg/libjpeg.so -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/libjpeg.so.8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/jpeg/libjpeg.so.8 -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/libjpeg.so.8.3.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/jpeg/libjpeg.so.8.3.0 -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/jpeg/yuyv.h: -------------------------------------------------------------------------------- 1 | #ifndef __YUYV_H__ 2 | #define __YUYV_H__ 3 | 4 | struct jpg_data 5 | { 6 | unsigned char jpg_data[614400]; //用于存放摄像头数据 7 | int jpg_size; //用于存放摄像头数据大小 8 | }; 9 | 10 | //参数 设备文件的路径 11 | extern int linux_v4l2_yuyv_init(char *dev_name); 12 | 13 | //开始摄像头头捕捉画面 14 | extern int linux_v4l2_start_yuyv_capturing(); 15 | 16 | //读取一帧的内容 获取摄像头采集数据 17 | extern int linux_v4l2_get_yuyv_data (struct jpg_data * jpg_buf); 18 | 19 | //退出摄像头 20 | extern int linux_v4l2_yuyv_quit(); 21 | 22 | #endif -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/libfont.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/libfont.a -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/main -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/main.c: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: BMP_TO_LED.c 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月02日 星期二 00时34分08秒 6 | ************************************************************************/ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "fcntl.h" 16 | #include "camera.h" 17 | #include 18 | #include 19 | #include 20 | #include //struct input_event 21 | 22 | int fd_event0; 23 | int fd_fb0; 24 | int buf_bmp; 25 | int buf_lcd; 26 | int fd_bmp; 27 | int fd_lcd; 28 | int *p_init = NULL; 29 | int *p_mmap = NULL; 30 | 31 | int exit_mmap(void) 32 | { 33 | munmap(p_init, 800*480*4); 34 | p_init = NULL; 35 | return 0; 36 | } 37 | 38 | int open_fb0(void) 39 | { 40 | fd_fb0 = open("/dev/fb0", O_RDWR); 41 | if(fd_fb0 == -1) 42 | { 43 | printf("open /dev/fb0 fail!\n"); 44 | return -1; 45 | } 46 | else{ 47 | printf("fd_fb0 = %d\n", fd_fb0); 48 | } 49 | return 0; 50 | } 51 | 52 | 53 | 54 | int arm6818_color(int color, int coordinate_x, int coordinate_y, int height, int wide) 55 | { 56 | int *p_mmap = NULL; 57 | p_mmap = p_init; 58 | 59 | p_mmap = p_mmap + 800* coordinate_y + coordinate_x; 60 | 61 | int x, y; 62 | for(y=0; y=0 && coordinate.value<800) 107 | { 108 | *coordinate_x = coordinate.value; 109 | } 110 | if(coordinate.type==3 && coordinate.code==1 && coordinate.value>=0 && coordinate.value<480) 111 | { 112 | *coordinate_y = coordinate.value; 113 | } 114 | if(coordinate.type==1 && coordinate.code==330 && coordinate.value==0) 115 | { 116 | break; 117 | } 118 | } 119 | 120 | return 0; 121 | } 122 | void input_pageMAIN() 123 | { 124 | //1)打开LCD屏幕,打开图片。 125 | fd_bmp = open("/root/project1/image/main.bmp",O_RDWR); 126 | fd_lcd = open("/dev/fb0",O_RDWR); 127 | if(fd_bmp < 0 || fd_lcd <0) 128 | { 129 | printf("FAILD !!! BMP Filescip iS %d AND LCD Filescip is %d \n",fd_bmp,fd_lcd); 130 | return -1; 131 | } 132 | 133 | printf("fd_bmp Filescip iS %d \nfd_lcd Filescip is %d \n",fd_bmp,fd_lcd); 134 | int ret = lseek(fd_bmp, 54, SEEK_SET); 135 | if (ret < 0) 136 | { 137 | printf("lseek error %d\n",ret); 138 | return -2; 139 | } 140 | 141 | //2)创建映射通道,将内存中图片的颜色数据通过p_mmap放到LCD屏幕。 142 | 143 | 144 | p_init = mmap(NULL,800 * 480 * 4,PROT_READ | PROT_WRITE,MAP_SHARED,fd_lcd,0); 145 | p_mmap = p_init; 146 | 147 | //2-1)800*480个BMP像素点变成800*480个LCD像素点 148 | 149 | char buf_bmp[800*480*3]; 150 | int buf_lcd[800*480]; 151 | bzero(buf_bmp, sizeof(buf_bmp)); 152 | bzero(buf_lcd, sizeof(buf_lcd)); 153 | 154 | ret = read(fd_bmp, buf_bmp, sizeof(buf_bmp)); 155 | if (ret < 0) 156 | { 157 | printf("read error\n"); 158 | return -3; 159 | } 160 | 161 | char A = 0x00; 162 | int i = 0; 163 | for (i = 0; i<800 * 480; i++) 164 | { 165 | buf_lcd[i] = buf_bmp[i * 3] << 0 | buf_bmp[i * 3 + 1] << 8 | buf_bmp[i * 3 + 2] << 16 | A << 24; 166 | } 167 | 168 | //2-2)颠倒图片 169 | int xx = 0; 170 | int y = 0; 171 | for (xx = 479; xx >= 0; xx--) 172 | { 173 | for (y = 0; y<800; y++) 174 | { 175 | *p_mmap= buf_lcd[xx*800+y]; 176 | p_mmap++; 177 | 178 | } 179 | } 180 | } 181 | 182 | //arm6818_bmp800_480("/root/project/images/0.bmp", 10, 10, 40, 40); 183 | int arm6818_bmp800_480(const char *pathname, int coordinate_x, int coordinate_y, int height, int wide) 184 | { 185 | int fd_bmp = open(pathname, O_RDWR); 186 | if(fd_bmp == -1) 187 | { 188 | printf("open bmp fail!\n"); 189 | return -1; 190 | } 191 | 192 | lseek(fd_bmp, 54, SEEK_SET); 193 | 194 | char bmp_buf[height*wide*3]; 195 | int lcd_buf[height*wide]; 196 | bzero(bmp_buf, sizeof(bmp_buf)); 197 | bzero(lcd_buf, sizeof(lcd_buf)); 198 | 199 | read(fd_bmp, bmp_buf, sizeof(bmp_buf)); 200 | close(fd_bmp); 201 | 202 | int i; 203 | char A = 0x00; 204 | for(i=0; i 278 | int month=0; 279 | 280 | if(strcmp(p_second, "Jan") == 0) month = 1; 281 | else if(strcmp(p_second, "Feb") == 0) month = 2; 282 | else if(strcmp(p_second, "Mar") == 0) month = 3; 283 | else if(strcmp(p_second, "Apr") == 0) month = 4; 284 | else if(strcmp(p_second, "May") == 0) month = 5; 285 | else if(strcmp(p_second, "Jun") == 0) month = 6; 286 | else if(strcmp(p_second, "Jul") == 0) month = 7; 287 | else if(strcmp(p_second, "Aug") == 0) month = 8; 288 | else if(strcmp(p_second, "Sept") == 0) month = 9; 289 | else if(strcmp(p_second, "Oct") == 0) month = 10; 290 | else if(strcmp(p_second, "Nov") == 0) month = 11; 291 | else if(strcmp(p_second, "Dec") == 0) month = 12; 292 | 293 | char str[50]; 294 | bzero(str, sizeof(str)); 295 | sprintf(str, "%s-%d-%s %s", p_five, month, p_third,p_forth); 296 | 297 | //显示 "Jul 4 11:10:00 2019" 字符串 298 | Init_Font(); 299 | 300 | Clean_Area(640,//x坐标起始点 301 | 0,//y坐标起始点 302 | 160,//绘制的宽度 303 | 15,//绘制的高度 304 | 0x00ffffff);//往屏幕指定区域填充黑颜色 305 | 306 | Display_characterX(640,//x坐标起始点 307 | 0,//y坐标起始点 308 | str,//GB2312 中文字符串 309 | 0x00000000 ,//字体白颜色值 310 | 1);//字体放大倍数 1~8 311 | 312 | UnInit_Font(); 313 | sleep(1); 314 | } 315 | pthread_exit(NULL); 316 | } 317 | 318 | 319 | int num = 3; //输入最多次数 320 | int main() 321 | { 322 | pthread_t pid; 323 | pthread_create(&pid,NULL,(void*)task_ser,NULL); 324 | 325 | 326 | Build: 327 | input_pageMAIN(); 328 | int ts_x, ts_y; 329 | 330 | open_ts(); 331 | open_fb0(); 332 | 333 | 334 | //登陆 335 | char account[7]="123456"; 336 | char passwd[7]="123456"; 337 | char input_account[11]; 338 | char input_passwd[11]; 339 | FLAG: 340 | bzero(input_account,sizeof(input_account)); 341 | bzero(input_passwd,sizeof(input_passwd)); 342 | 343 | 344 | while(1) 345 | { 346 | read_ts(&ts_x, &ts_y); 347 | if(ts_x>20&&ts_x<110&&ts_y>150&&ts_y<200) 348 | { 349 | printf("Please input Account:\n"); 350 | 351 | //账号原点 352 | 353 | int ax=135; 354 | int ay= 152; 355 | int i = 0; 356 | while(1) 357 | { 358 | FLAG1: 359 | read_ts(&ts_x, &ts_y); 360 | //--> 361 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 362 | { 363 | input_account[i] = '\0'; 364 | printf("The Account is %s\n",input_account); 365 | break; 366 | } 367 | //<-- 368 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 369 | { 370 | ax-=40; 371 | if(ax < 135) 372 | { 373 | bzero(input_account,sizeof(input_account)); 374 | ax=135; 375 | i=0; 376 | goto FLAG1; 377 | 378 | } 379 | arm6818_bmp800_480("/root/project1/image/q.bmp",ax,ay,40,40); 380 | --i; 381 | printf("delete a number!!!\n"); 382 | 383 | } 384 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 385 | { 386 | arm6818_bmp800_480("/root/project1/image/num1.bmp",ax,ay,40,40); 387 | ax+=40; 388 | input_account[i++]='1'; 389 | printf("1\n"); 390 | } 391 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 392 | { 393 | arm6818_bmp800_480("/root/project1/image/num2.bmp",ax,ay,40,40); 394 | ax+=40; 395 | input_account[i++]='2'; 396 | printf("2\n"); 397 | } 398 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 399 | { 400 | arm6818_bmp800_480("/root/project1/image/num3.bmp",ax,ay,40,40); 401 | ax+=40; 402 | input_account[i++]='3'; 403 | printf("3\n"); 404 | } 405 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 406 | { 407 | arm6818_bmp800_480("/root/project1/image/num4.bmp",ax,ay,40,40); 408 | ax+=40; 409 | input_account[i++]='4'; 410 | printf("4\n"); 411 | } 412 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 413 | { 414 | arm6818_bmp800_480("/root/project1/image/num5.bmp",ax,ay,40,40); 415 | ax+=40; 416 | input_account[i++]='5'; 417 | printf("5\n"); 418 | } 419 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 420 | { 421 | arm6818_bmp800_480("/root/project1/image/num6.bmp",ax,ay,40,40); 422 | ax+=40; 423 | input_account[i++]='6'; 424 | printf("6\n"); 425 | } 426 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 427 | { 428 | arm6818_bmp800_480("/root/project1/image/num7.bmp",ax,ay,40,40); 429 | ax+=40; 430 | input_account[i++]='7'; 431 | printf("7\n"); 432 | } 433 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 434 | { 435 | arm6818_bmp800_480("/root/project1/image/num8.bmp",ax,ay,40,40); 436 | ax+=40; 437 | input_account[i++]='8'; 438 | printf("8\n"); 439 | } 440 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 441 | { 442 | arm6818_bmp800_480("/root/project1/image/num9.bmp",ax,ay,40,40); 443 | ax+=40; 444 | input_account[i++]='9'; 445 | printf("9\n"); 446 | } 447 | } 448 | if(ts_x>20&&ts_x<110&&ts_y>245&&ts_y<395) 449 | { 450 | printf("Please input Passwd:\n"); 451 | //密码原点 452 | 453 | int px=135; 454 | int py= 250; 455 | int i = 0; 456 | while(1) 457 | { 458 | FLAG2: 459 | read_ts(&ts_x, &ts_y); 460 | //---> 461 | if(ts_x>700&&ts_x<790&&ts_y>380&&ts_y<470) 462 | { 463 | input_passwd[i]='\0'; 464 | printf("Input Passwd is %s\n",input_passwd); 465 | num--; 466 | if(num >0) 467 | { 468 | //校验账号密码是否正确 469 | if((strcmp(account,input_account)==0)&&(strcmp(passwd,input_passwd)==0)) 470 | { 471 | printf("*************************Welcome to this syatem!!!************************\n"); 472 | arm6818_color(0x0000ff00,0,0,480,800); 473 | sleep(1); 474 | Buildwww: 475 | //第二个界面 476 | arm6818_bmp800_480("/root/project1/image/zhongjian.bmp",0,0,480,800); 477 | while(1) 478 | { 479 | read_ts(&ts_x, &ts_y); 480 | if(ts_x>330&&ts_x<460&&ts_y>290&&ts_y<430) 481 | { 482 | //第三个界面 483 | arm6818_bmp800_480("/root/project1/image/right.bmp",0,0,480,800); 484 | while(1) 485 | { 486 | read_ts(&ts_x, &ts_y); 487 | if(ts_x>640&&ts_x<800&&ts_y>160&&ts_y<250) 488 | { 489 | //TODO 监控 490 | 491 | my_camera(); 492 | ts_x=0; 493 | ts_y=0; 494 | 495 | } 496 | if(ts_x>640&&ts_x<800&&ts_y>360&&ts_y<440) 497 | { 498 | printf("------------------------Thank You !!! --------------------\n"); 499 | num=3; 500 | goto Buildwww; 501 | } 502 | 503 | } 504 | } 505 | if(ts_x>120&&ts_x<250&&ts_y>290&&ts_y<430) 506 | { 507 | printf("------------------------Thank You !!! --------------------\n"); 508 | num=3; 509 | goto Build; 510 | } 511 | } 512 | 513 | } 514 | else 515 | { 516 | arm6818_color(0x00ff0000,0,0,480,800); 517 | sleep(1); 518 | arm6818_bmp800_480("/root/project1/image/main.bmp",0,0,480,800); 519 | goto FLAG; 520 | printf("Passwd is error \n!!!"); 521 | } 522 | 523 | } 524 | else 525 | { 526 | if((strcmp(account,input_account)==0)&&(strcmp(passwd,input_passwd)==0)) 527 | { 528 | printf("*************************Welcome to this syatem!!!**********************\n"); 529 | arm6818_color(0x0000ff00,0,0,480,800); 530 | sleep(1); 531 | Buildwwww: 532 | arm6818_bmp800_480("/root/project1/image/zhongjian.bmp",0,0,480,800); 533 | while(1) 534 | { 535 | read_ts(&ts_x, &ts_y); 536 | if(ts_x>330&&ts_x<460&&ts_y>290&&ts_y<430) 537 | { 538 | //第三个界面 539 | arm6818_bmp800_480("/root/project1/image/right.bmp",0,0,480,800); 540 | while(1) 541 | { 542 | 543 | read_ts(&ts_x, &ts_y); 544 | if(ts_x>640&&ts_x<800&&ts_y>160&&ts_y<250) 545 | { 546 | //TODO 监控 547 | 548 | my_camera(); 549 | ts_x=0; 550 | ts_y=0; 551 | 552 | } 553 | if(ts_x>640&&ts_x<800&&ts_y>360&&ts_y<440) 554 | { 555 | printf("------------------------Thank You !!! --------------------\n"); 556 | num=3; 557 | goto Buildwwww; 558 | } 559 | 560 | } 561 | } 562 | if(ts_x>120&&ts_x<250&&ts_y>290&&ts_y<430) 563 | { 564 | printf("------------------------Thank You !!! --------------------\n"); 565 | num=3; 566 | goto Build; 567 | } 568 | 569 | } 570 | } 571 | else 572 | { 573 | printf("**********************DEV IS SHUTDOWN NOW!!!************************\n"); 574 | 575 | arm6818_color(0x00000000,0,0,480,800); 576 | } 577 | 578 | } 579 | 580 | return 0; 581 | } 582 | //<-- 583 | else if(ts_x>410&&ts_x<500&&ts_y>380&&ts_y<460) 584 | { 585 | px-=40; 586 | if(px < 0) 587 | { 588 | bzero(input_passwd,sizeof(input_passwd)); 589 | px=135; 590 | i = 0; 591 | goto FLAG2; 592 | } 593 | arm6818_bmp800_480("/root/project1/image/q.bmp",px,py,40,40); 594 | --i; 595 | printf("delete a number!!!\n"); 596 | 597 | } 598 | else if(ts_x>400&&ts_x<500&&ts_y>30&&ts_y<110) 599 | { 600 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 601 | px+=40; 602 | input_passwd[i++]='1'; 603 | printf("1\n"); 604 | } 605 | else if(ts_x>550&&ts_x<650&&ts_y>30&&ts_y<110) 606 | { 607 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 608 | px+=40; 609 | input_passwd[i++]='2'; 610 | printf("2\n"); 611 | } 612 | else if(ts_x>690&&ts_x<790&&ts_y>30&&ts_y<110) 613 | { 614 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 615 | px+=40; 616 | input_passwd[i++]='3'; 617 | printf("3\n"); 618 | } 619 | else if(ts_x>400&&ts_x<500&&ts_y>140&&ts_y<250) 620 | { 621 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 622 | px+=40; 623 | input_passwd[i++]='4'; 624 | printf("4\n"); 625 | } 626 | else if(ts_x>550&&ts_x<650&&ts_y>140&&ts_y<250) 627 | { 628 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 629 | px+=40; 630 | input_passwd[i++]='5'; 631 | printf("5\n"); 632 | } 633 | else if(ts_x>690&&ts_x<790&&ts_y>140&&ts_y<250) 634 | { 635 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 636 | px+=40; 637 | input_passwd[i++]='6'; 638 | printf("6\n"); 639 | } 640 | else if(ts_x>400&&ts_x<500&&ts_y>260&&ts_y<360) 641 | { 642 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 643 | px+=40; 644 | input_passwd[i++]='7'; 645 | printf("7\n"); 646 | } 647 | else if(ts_x>550&&ts_x<650&&ts_y>260&&ts_y<360) 648 | { 649 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 650 | px+=40; 651 | input_passwd[i++]='8'; 652 | printf("8\n"); 653 | } 654 | else if(ts_x>690&&ts_x<790&&ts_y>260&&ts_y<360) 655 | { 656 | arm6818_bmp800_480("/root/project1/image/num10.bmp",px,py,40,40); 657 | px+=40; 658 | input_passwd[i++]='9'; 659 | printf("9\n"); 660 | } 661 | } 662 | 663 | } 664 | } 665 | else 666 | { 667 | printf("Please input Account !!!\n"); 668 | } 669 | } 670 | 671 | 672 | //3)关闭LCD屏幕,关闭图片,释放映射空间的资源。 673 | pthread_join(pid,NULL); 674 | exit_mmap(); 675 | close_fd(); 676 | 677 | return 0; 678 | } 679 | -------------------------------------------------------------------------------- /Day5/频监控系统源码/项目源码/编译命令.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/Vedio_Monitor_System/e2ee5092728e2a1d645eb328e58637561007e926/Day5/频监控系统源码/项目源码/编译命令.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vedio_Monitor_System 2 | 基于CRT(远程访问终端)+ARM(GEC)+Linux+C语言的视频监控系统 3 | -------------------------------------------------------------------------------- /test.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | > File Name: test.cpp 3 | > Author: Hunter 4 | > Mail: hunter.520@qq.com 5 | > Created Time: 2019年07月01日 星期一 03时53分56秒 6 | ************************************************************************/ 7 | 8 | #include 9 | using namespace std; 10 | int main() 11 | { 12 | cout << "Hello World !!! \n"<