资源简介
可以解码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个文件信息
相关资源
- 红外线通信技术,红外编码解码
- stm32做的红外遥控解码程序
- 上海交大计算机图形学课程视频31集
- ISOMETR图标生成器教程(mp4视频教程)
- OSG 72集视频教程和资料140620
- PNG加密解密工具73383
- 基于FPGA的sdi视频传输工程(k7_sdi_rx
- 郭天祥ARM9视频教程
- 2017款解码软件v1.0.0.6
- 一种红外遥控编解码仿真
- 曼彻斯特编解码_同步QuartusII工程
- L-Z编码L-Z解码
- QT,JPEG解码源代码(已完成)
- vc URL编解码类
- vc编写中国象棋详细源码注释并附有视
- 视频处理控件TVideoGrabber.v6.7.5.For.Del
- 视频会议,VC视频会议源码.
- 液晶显示器VGA视频接口及显示规范
- 2019最新黑马程序员前端39期全套视频
- 千锋elasticsearch视频教程带笔记
- 基于Linux、QT的视频监控系统的设计与
- VS1053B编解码器的VDR分布式声音采集卡
- 233网校视频器2018最新绿色版
- ETC中FM0解码器的设计
- 网络视频嗅探器
- 视频嗅探器 任意视频
- ts格式视频
- 易语言版迅雷视频转换器源码
- 基于Blackfin的无线IP视频监控解决方案
- 天津市卫生局视频会议系统规划建设
评论
共有 条评论