jpeg 交叉编译以及接口的使用
来源:互联网 发布:网上 电脑软件 编辑:程序博客网 时间:2024/05/08 07:01
使用jpeg版本:jpegsrc.v9a.tar.gz
configure参数:./configure --prefix=/usr/local/jpeglib_arm/ --host=arm-none-linux-gnueabi
之后make; make install
调用jpeg接口
/*将bgr数据转换为jpg图像存储filename: 生成的jpg文件名width height:传入bmp file 的宽和高pBGRBuffer:传入bgr数据*/int convert_to_jpg(char *filename, int width, int height, unsigned char *pBGRBuffer){FILE *fJpg;struct jpeg_compress_struct cinfo;struct jpeg_error_mgr jerr;JSAMPROW row_pointer[1];int row_stride;cinfo.err = jpeg_std_error(&jerr);jpeg_create_compress(&cinfo);fJpg = fopen(filename, "wb");if(fJpg == NULL){debugE("Cannot open file %s\n", filename);return -1;}jpeg_stdio_dest(&cinfo, fJpg);cinfo.image_width = width;cinfo.image_height = height;cinfo.input_components = 3;cinfo.in_color_space = JCS_RGB;jpeg_set_defaults(&cinfo);jpeg_set_quality(&cinfo, 30, TRUE);jpeg_start_compress(&cinfo, TRUE);row_stride = cinfo.image_width * 3;/* JSAMPLEs per row in image_buffer */while (cinfo.next_scanline < cinfo.image_height) {/* jpeg_write_scanlines expects an array of pointers to scanlines. * Here the array is only one element long, but you could pass * more than one scanline at a time if that's more convenient. *///row_pointer[0] = & pBMPBuffer[cinfo.next_scanline * row_stride];row_pointer[0] = &pBGRBuffer[row_stride*(cinfo.image_height - cinfo.next_scanline - 1)];(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);}jpeg_finish_compress(&cinfo);jpeg_destroy_compress(&cinfo);fclose(fJpg);return 0;}
0 0
- jpeg 交叉编译以及接口的使用
- JPEG的交叉编译
- JPEG Lib的交叉编译
- ubuntu下JPEG的交叉编译
- 交叉编译jpeg
- jpeg-6b交叉编译
- cygwin的安装使用以及交叉编译环境的搭建
- Libosip/libeXosip 交叉编译以及在DM6467的使用
- linux 交叉编译 tcpdump以及tcpdump的使用
- QWT编译以及交叉编译的问题
- vs2013 win10 编译libjpeg以及使用CImg加载jpeg图片
- SDL以及扩展库的交叉编译
- 为qt-embedded添加jpeg库的交叉编译方法for arm
- 为qt-embedded添加jpeg库的交叉编译方法for arm
- opencv2.0移植过程中zlib,jpeg,png库的交叉编译
- OpenCV 2.0移植过程中zlib,jpeg,png库的交叉编译
- opencv2.0移植过程中zlib,jpeg,png库的交叉编译
- 【Linux开发】为qt-embedded添加jpeg库的交叉编译方法for arm
- APMServ 80端口被占用的最全面的解决方法
- Python读写文件
- node.js笔记(一)入门
- 智慧城市
- 点击navigationitem上的按钮,弹出view,类似弹出菜单
- jpeg 交叉编译以及接口的使用
- ListView动画效果
- 我的Java开发学习之旅------>Java经典面试题
- Longest Substring Without Repeating Characters
- dec加密
- Android平台网络常用命令
- 程序员面试:电话面试问答Top 50
- 80端口被NT kernel & System 占用pid 4
- linux 内核poll/select/epoll实现剖析