png++依赖于libpng库,libpng库依赖于zlib库,这3个库的版本要一致才可以,同时代码要稍作修改才能安装,具体见文件中的说明文档。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-09-17 16:35 png++
目录 0 2018-09-17 16:35 png++lpng1253
文件 2082 2018-09-17 16:35 png++lpng1253ANNOUNCE
文件 140937 2018-09-17 16:35 png++lpng1253CHANGES
文件 7918 2018-09-17 16:35 png++lpng1253CMakeLists.txt
文件 446 2018-09-17 16:35 png++lpng1253configure
目录 0 2018-09-17 16:35 png++lpng1253contrib
目录 0 2018-09-17 16:35 png++lpng1253contribgregbook
文件 18332 2018-09-17 16:35 png++lpng1253contribgregbookCOPYING
文件 2423 2018-09-17 16:35 png++lpng1253contribgregbookLICENSE
文件 4035 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.mingw32
文件 3070 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.sgi
文件 4142 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.unx
文件 3448 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.w32
文件 3689 2018-09-17 16:35 png++lpng1253contribgregbookmakevms.com
文件 7987 2018-09-17 16:35 png++lpng1253contribgregbookREADME
文件 10176 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng.c
文件 3348 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng.h
文件 25417 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng2.c
文件 4063 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng2.h
文件 5603 2018-09-17 16:35 png++lpng1253contribgregbook
eadppm.c
文件 23595 2018-09-17 16:35 png++lpng1253contribgregbook
png-win.c
文件 31680 2018-09-17 16:35 png++lpng1253contribgregbook
png-x.c
文件 46534 2018-09-17 16:35 png++lpng1253contribgregbook
png2-win.c
文件 84395 2018-09-17 16:35 png++lpng1253contribgregbook
png2-x.c
文件 12901 2018-09-17 16:35 png++lpng1253contribgregbook oucan.png
文件 31903 2018-09-17 16:35 png++lpng1253contribgregbookwpng.c
文件 13181 2018-09-17 16:35 png++lpng1253contribgregbookwritepng.c
文件 4370 2018-09-17 16:35 png++lpng1253contribgregbookwritepng.h
目录 0 2018-09-17 16:35 png++lpng1253contribpngminim
目录 0 2018-09-17 16:35 png++lpng1253contribpngminimdecoder
............此处省略1309个文件信息
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.2.37 [June 4 2009]
* This file has been placed in the public domain by the authors.
* Maintained 1998-2010 Glenn Randers-Pehrson
* Maintained 1996 1997 Andreas Dilger)
* Written 1995 1996 Guy Eric Schalnat Group 42 Inc.)
*/
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng.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.
*/
#include “png.h“
/* The png_jmpbuf() macro used in error handling became available in
* libpng version 1.0.6. If you want to be able to run your code with older
* versions of libpng you must define the macro yourself (but only if it
* is not already defined by libpng!).
*/
#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
#endif
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
* returns zero if the image is a PNG and nonzero if it isn‘t a PNG.
*
* The function check_if_png() shown here but not used returns nonzero (true)
* if the file can be opened and is a PNG 0 (false) otherwise.
*
* If this call is successful and you are going to keep the file open
* you should call png_set_sig_bytes(png_ptr PNG_BYTES_TO_CHECK); once
* you have created the png_ptr so that libpng knows your application
* has read that many bytes from the start of the file. Make sure you
* don‘t call png_set_sig_bytes() with more than 8 bytes read or give it
* an incorrect number of bytes read or you will either have read too
* many bytes (your fault) or you are telling libpng to read the wrong
* number of magic bytes (also your fault).
*
* Many applications already read the first 2 or 4 bytes from the start
* of the image to determine the file type so it would be easiest just
* to pass the bytes to png_sig_cmp() or even skip that if you know
* you have a PNG file and call png_set_sig_bytes().
*/
#define PNG_BYTES_TO_CHECK 4
int check_if_png(char *file_name FILE **fp)
{
char buf[PNG_BYTES_TO_CHECK];
/* Open the prospective PNG file. */
if ((*fp = fopen(file_name “rb“)) == NULL)
return 0;
/* Read in some of the signature bytes */
if (fread(buf 1 PNG_BYTES_TO_CHECK *fp) != PNG_BYTES_TO_CHECK)
return 0;
/* Compare the first
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-09-17 16:35 png++
目录 0 2018-09-17 16:35 png++lpng1253
文件 2082 2018-09-17 16:35 png++lpng1253ANNOUNCE
文件 140937 2018-09-17 16:35 png++lpng1253CHANGES
文件 7918 2018-09-17 16:35 png++lpng1253CMakeLists.txt
文件 446 2018-09-17 16:35 png++lpng1253configure
目录 0 2018-09-17 16:35 png++lpng1253contrib
目录 0 2018-09-17 16:35 png++lpng1253contribgregbook
文件 18332 2018-09-17 16:35 png++lpng1253contribgregbookCOPYING
文件 2423 2018-09-17 16:35 png++lpng1253contribgregbookLICENSE
文件 4035 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.mingw32
文件 3070 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.sgi
文件 4142 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.unx
文件 3448 2018-09-17 16:35 png++lpng1253contribgregbookMakefile.w32
文件 3689 2018-09-17 16:35 png++lpng1253contribgregbookmakevms.com
文件 7987 2018-09-17 16:35 png++lpng1253contribgregbookREADME
文件 10176 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng.c
文件 3348 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng.h
文件 25417 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng2.c
文件 4063 2018-09-17 16:35 png++lpng1253contribgregbook
eadpng2.h
文件 5603 2018-09-17 16:35 png++lpng1253contribgregbook
eadppm.c
文件 23595 2018-09-17 16:35 png++lpng1253contribgregbook
png-win.c
文件 31680 2018-09-17 16:35 png++lpng1253contribgregbook
png-x.c
文件 46534 2018-09-17 16:35 png++lpng1253contribgregbook
png2-win.c
文件 84395 2018-09-17 16:35 png++lpng1253contribgregbook
png2-x.c
文件 12901 2018-09-17 16:35 png++lpng1253contribgregbook oucan.png
文件 31903 2018-09-17 16:35 png++lpng1253contribgregbookwpng.c
文件 13181 2018-09-17 16:35 png++lpng1253contribgregbookwritepng.c
文件 4370 2018-09-17 16:35 png++lpng1253contribgregbookwritepng.h
目录 0 2018-09-17 16:35 png++lpng1253contribpngminim
目录 0 2018-09-17 16:35 png++lpng1253contribpngminimdecoder
............此处省略1309个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)