image.c
来自「有关嵌入式的摄像头视频采集的论文」· C语言 代码 · 共 27 行
C
27 行
#include <stdio.h>#include "image.h"struct image *image_new(int width, int height){ struct image *img = (struct image*)malloc(sizeof(struct image)); if(img) { img->width = width; img->height = height; img->bufsize = width*height*3; img->buf = (char *)malloc(img->bufsize); if(!img->bufsize) { free(img); img = NULL; } } return img;}void image_delete(struct image *img){ free(img->buf);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?