资源简介
可以解码png图片,通过配置格式,可以将png成功解码成rgb格式
代码片段和文件信息
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.6.3 [July 18 2013]
* Maintained 1998-2013 Glenn Randers-Pehrson
* Maintained 1996 1997 Andreas Dilger)
* Written 1995 1996 Guy Eric Schalnat Group 42 Inc.)
* To the extent possible under law the authors have waived
* all copyright and related or neighboring rights to this file.
* This work is published from: United States.
*/
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng-manual.txt is much more verbose then this. If you have not
* read it do so first. This was designed to be a starting point of an
* implementation. This is not officially part of libpng is hereby placed
* in the public domain and therefore does not require a copyright notice.
*
* This file does not currently compile because it is missing certain
* parts like allocating memory to hold an image. You will have to
* supply these parts to get it to compile. For an example of a minimal
* working PNG reader/writer see pngtest.c included in this distribution;
* see also the programs in the contrib directory.
*/
/* The simple but restricted approach to reading a PNG file or data stream
* just requires two function calls as in the following complete program.
* Writing a file just needs one function call so long as the data has an
* appropriate layout.
*
* The following code reads PNG image data from a file and writes it in a
* potentially new format to a new file. While this code will compile there is
* minimal (insufficient) error checking; for a more realistic version look at
* contrib/examples/pngtopng.c
*/
#include
#include
#include
#include
#include
#include
int main(int argc const char **argv)
{
if (argc == 3)
{
png_image image; /* The control structure used by libpng */
/* Initialize the ‘png_image‘ structure. */
memset(&image 0 (sizeof image));
image.version = PNG_IMAGE_VERSION;
/* The first argument is the file to read: */
if (png_image_begin_read_from_file(&image argv[1]))
{
png_bytep buffer;
/* Set the format in which to read the PNG file; this code chooses a
* simple sRGB format with a non-associated alpha channel adequate to
* store most images.
*/
image.format = PNG_FORMAT_RGBA;
/* Now allocate enough memory to hold the image in this format; the
* PNG_IMAGE_SIZE macro uses the information about the image (width
* height and format) stored in ‘image‘.
*/
buffer = malloc(PNG_IMAGE_SIZE(image));
/* If enough memory was available read the image in the desired format
* then write the result out to the new file. ‘background‘ is not
* nec
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-09 23:07 lpng165\
目录 0 2013-09-14 20:18 lpng165\lpng165\
文件 906 2013-09-14 20:18 lpng165\lpng165\ANNOUNCE
文件 238428 2013-09-14 20:18 lpng165\lpng165\CHANGES
文件 13441 2013-09-14 20:18 lpng165\lpng165\CMakeLists.txt
文件 811 2013-09-14 20:18 lpng165\lpng165\configure
目录 0 2013-09-14 20:18 lpng165\lpng165\contrib\
目录 0 2013-09-14 20:18 lpng165\lpng165\contrib\examples\
文件 4704 2011-11-25 20:25 lpng165\lpng165\contrib\examples\iccfrompng.c
文件 15258 2013-03-07 12:10 lpng165\lpng165\contrib\examples\pngpixel.c
文件 2890 2012-09-01 06:29 lpng165\lpng165\contrib\examples\pngtopng.c
文件 982 2011-11-25 20:25 lpng165\lpng165\contrib\examples\README.txt
目录 0 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\
文件 18437 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\COPYING
文件 2423 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\LICENSE
文件 4035 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\Makefile.mingw32
文件 3070 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\Makefile.sgi
文件 4142 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\Makefile.unx
文件 3447 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\Makefile.w32
文件 3687 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\makevms.com
文件 8033 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\README
文件 10328 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\readpng.c
文件 3348 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\readpng.h
文件 18069 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\readpng2.c
文件 3916 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\readpng2.h
文件 5603 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\readppm.c
文件 24504 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\rpng-win.c
文件 31692 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\rpng-x.c
文件 46622 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\rpng2-win.c
文件 83451 2013-09-14 20:18 lpng165\lpng165\contrib\gregbook\rpng2-x.c
文件 12901 1997-04-09 02:34 lpng165\lpng165\contrib\gregbook\toucan.png
............此处省略231个文件信息
相关资源
- H5视频播放工具hls.js
- 红外目标跟踪测试视频
- 手机视频监控IOS
- 全国二等奖“华为杯”第十四届中国
- 最全解码测试h264测试文件包
- 于争 博士 cadence视频教程工程
- GBT28181-2016公共安全视频监控联网系统
- 提取获取网页中的视频和MP3
- 电商淘宝、天猫、拼多多商品图片视
- Qt+Opencv-PCA人脸识别+视频
- OID编解码工具
- 收音机调频立体声解码集成电路应用
- 适合后台管理的1700多个png格式的ext
- XILINX官方HLS视频课程学习总结 .pdf
- 批量修改视频MD5值绿色版
- 全球抖音解析采集软件1.5.zip259000
- 金盾加密视频的提取教程+工具.rar
- 网站视频主持人代码及使用方法
- 视频万能解码器让系统自带的Windows
- webRTC+socketio+SpringBoot视频及文字聊天
- guns文档v5.1(2018-10-17更新的完整版)
- pdf417编码和解码
- openmeetings-5.0.0-M1二次开发参考文档.
- qt视频播放器
- opencv网络摄像头功能和文件传输功能
- 智慧农业视频监控系统解决方案设计
- VC_视频捕捉与帧处理
- hi3516a音频解码音频编解码库
- weizmann视频数据库
- capture video
评论
共有 条评论