亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? libpng.txt

?? 一款最完整的工業組態軟源代碼
?? TXT
?? 第 1 頁 / 共 5 頁
字號:
libpng.txt - A description on how to use and modify libpng

 libpng version 1.2.7 - September 12, 2004
 Updated and distributed by Glenn Randers-Pehrson
 <glennrp@users.sourceforge.net>
 Copyright (c) 1998-2004 Glenn Randers-Pehrson
 For conditions of distribution and use, see copyright
 notice in png.h.

 based on:

 libpng 1.0 beta 6  version 0.96 May 28, 1997
 Updated and distributed by Andreas Dilger
 Copyright (c) 1996, 1997 Andreas Dilger

 libpng 1.0 beta 2 - version 0.88  January 26, 1996
 For conditions of distribution and use, see copyright
 notice in png.h. Copyright (c) 1995, 1996 Guy Eric
 Schalnat, Group 42, Inc.

 Updated/rewritten per request in the libpng FAQ
 Copyright (c) 1995, 1996 Frank J. T. Wojcik
 December 18, 1995 & January 20, 1996

I. Introduction

This file describes how to use and modify the PNG reference library
(known as libpng) for your own use.  There are five sections to this
file: introduction, structures, reading, writing, and modification and
configuration notes for various special platforms.  In addition to this
file, example.c is a good starting point for using the library, as
it is heavily commented and should include everything most people
will need.  We assume that libpng is already installed; see the
INSTALL file for instructions on how to install libpng.

Libpng was written as a companion to the PNG specification, as a way
of reducing the amount of time and effort it takes to support the PNG
file format in application programs.

The PNG specification (second edition), November 2003, is available as
a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at
<http://www.w3.org/TR/2003/REC-PNG-20031110/
The W3C and ISO documents have identical technical content.

The PNG-1.2 specification is available at
<http://www.libpng.org/pub/png/documents/>

The PNG-1.0 specification is available
as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a
W3C Recommendation <http://www.w3.org/TR/REC.png.html>. Some
additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/documents/>.

Other information
about PNG, and the latest version of libpng, can be found at the PNG home
page, <http://www.libpng.org/pub/png/>.

Most users will not have to modify the library significantly; advanced
users may want to modify it more.  All attempts were made to make it as
complete as possible, while keeping the code easy to understand.
Currently, this library only supports C.  Support for other languages
is being considered.

Libpng has been designed to handle multiple sessions at one time,
to be easily modifiable, to be portable to the vast majority of
machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy
to use.  The ultimate goal of libpng is to promote the acceptance of
the PNG file format in whatever way possible.  While there is still
work to be done (see the TODO file), libpng should cover the
majority of the needs of its users.

Libpng uses zlib for its compression and decompression of PNG files.
Further information about zlib, and the latest version of zlib, can
be found at the zlib home page, <http://www.info-zip.org/pub/infozip/zlib/>.
The zlib compression utility is a general purpose utility that is
useful for more than PNG files, and can be used without libpng.
See the documentation delivered with zlib for more details.
You can usually find the source files for the zlib utility wherever you
find the libpng source files.

Libpng is thread safe, provided the threads are using different
instances of the structures.  Each thread should have its own
png_struct and png_info instances, and thus its own image.
Libpng does not protect itself against two threads using the
same instance of a structure.  Note: thread safety may be defeated
by use of some of the MMX assembler code in pnggccrd.c, which is only
compiled when the user defines PNG_THREAD_UNSAFE_OK.

II. Structures

There are two main structures that are important to libpng, png_struct
and png_info.  The first, png_struct, is an internal structure that
will not, for the most part, be used by a user except as the first
variable passed to every libpng function call.

The png_info structure is designed to provide information about the
PNG file.  At one time, the fields of png_info were intended to be
directly accessible to the user.  However, this tended to cause problems
with applications using dynamically loaded libraries, and as a result
a set of interface functions for png_info (the png_get_*() and png_set_*()
functions) was developed.  The fields of png_info are still available for
older applications, but it is suggested that applications use the new
interfaces if at all possible.

Applications that do make direct access to the members of png_struct (except
for png_ptr->jmpbuf) must be recompiled whenever the library is updated,
and applications that make direct access to the members of png_info must
be recompiled if they were compiled or loaded with libpng version 1.0.6,
in which the members were in a different order.  In version 1.0.7, the
members of the png_info structure reverted to the old order, as they were
in versions 0.97c through 1.0.5.  Starting with version 2.0.0, both
structures are going to be hidden, and the contents of the structures will
only be accessible through the png_get/png_set functions.

The png.h header file is an invaluable reference for programming with libpng.
And while I'm on the topic, make sure you include the libpng header file:

#include <png.h>

III. Reading

We'll now walk you through the possible functions to call when reading
in a PNG file sequentially, briefly explaining the syntax and purpose
of each one.  See example.c and png.h for more detail.  While
progressive reading is covered in the next section, you will still
need some of the functions discussed in this section to read a PNG
file.

Setup

You will want to do the I/O initialization(*) before you get into libpng,
so if it doesn't work, you don't have much to undo.  Of course, you
will also want to insure that you are, in fact, dealing with a PNG
file.  Libpng provides a simple check to see if a file is a PNG file.
To use it, pass in the first 1 to 8 bytes of the file to the function
png_sig_cmp(), and it will return 0 if the bytes match the corresponding
bytes of the PNG signature, or nonzero otherwise.  Of course, the more bytes
you pass in, the greater the accuracy of the prediction.

If you are intending to keep the file pointer open for use in libpng,
you must ensure you don't read more than 8 bytes from the beginning
of the file, and you also have to make a call to png_set_sig_bytes_read()
with the number of bytes you read from the beginning.  Libpng will
then only check the bytes (if any) that your program didn't read.

(*): If you are not using the standard I/O functions, you will need
to replace them with custom functions.  See the discussion under
Customizing libpng.


    FILE *fp = fopen(file_name, "rb");
    if (!fp)
    {
        return (ERROR);
    }
    fread(header, 1, number, fp);
    is_png = !png_sig_cmp(header, 0, number);
    if (!is_png)
    {
        return (NOT_PNG);
    }


Next, png_struct and png_info need to be allocated and initialized.  In
order to ensure that the size of these structures is correct even with a
dynamically linked libpng, there are functions to initialize and
allocate the structures.  We also pass the library version, optional
pointers to error handling functions, and a pointer to a data struct for
use by the error functions, if necessary (the pointer and functions can
be NULL if the default error handlers are to be used).  See the section
on Changes to Libpng below regarding the old initialization functions.
The structure allocation functions quietly return NULL if they fail to
create the structure, so your application should check for that.

    png_structp png_ptr = png_create_read_struct
       (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
        user_error_fn, user_warning_fn);
    if (!png_ptr)
        return (ERROR);

    png_infop info_ptr = png_create_info_struct(png_ptr);
    if (!info_ptr)
    {
        png_destroy_read_struct(&png_ptr,
           (png_infopp)NULL, (png_infopp)NULL);
        return (ERROR);
    }

    png_infop end_info = png_create_info_struct(png_ptr);
    if (!end_info)
    {
        png_destroy_read_struct(&png_ptr, &info_ptr,
          (png_infopp)NULL);
        return (ERROR);
    }

If you want to use your own memory allocation routines,
define PNG_USER_MEM_SUPPORTED and use
png_create_read_struct_2() instead of png_create_read_struct():

    png_structp png_ptr = png_create_read_struct_2
       (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr,
        user_error_fn, user_warning_fn, (png_voidp)
        user_mem_ptr, user_malloc_fn, user_free_fn);

The error handling routines passed to png_create_read_struct()
and the memory alloc/free routines passed to png_create_struct_2()
are only necessary if you are not using the libpng supplied error
handling and memory alloc/free functions.

When libpng encounters an error, it expects to longjmp back
to your routine.  Therefore, you will need to call setjmp and pass
your png_jmpbuf(png_ptr).  If you read the file from different
routines, you will need to update the jmpbuf field every time you enter
a new routine that will call a png_*() function.

See your documentation of setjmp/longjmp for your compiler for more
information on setjmp/longjmp.  See the discussion on libpng error
handling in the Customizing Libpng section below for more information
on the libpng error handling.  If an error occurs, and libpng longjmp's
back to your setjmp, you will want to call png_destroy_read_struct() to
free any memory.

    if (setjmp(png_jmpbuf(png_ptr)))
    {
        png_destroy_read_struct(&png_ptr, &info_ptr,
           &end_info);
        fclose(fp);
        return (ERROR);
    }

If you would rather avoid the complexity of setjmp/longjmp issues,
you can compile libpng with PNG_SETJMP_NOT_SUPPORTED, in which case
errors will result in a call to PNG_ABORT() which defaults to abort().

Now you need to set up the input code.  The default for libpng is to
use the C function fread().  If you use this, you will need to pass a
valid FILE * in the function png_init_io().  Be sure that the file is
opened in binary mode.  If you wish to handle reading data in another
way, you need not call the png_init_io() function, but you must then
implement the libpng I/O methods discussed in the Customizing Libpng
section below.

    png_init_io(png_ptr, fp);

If you had previously opened the file and read any of the signature from
the beginning in order to see if this was a PNG file, you need to let
libpng know that there are some bytes missing from the start of the file.

    png_set_sig_bytes(png_ptr, number);

Setting up callback code

You can set up a callback function to handle any unknown chunks in the
input stream. You must supply the function

    read_chunk_callback(png_ptr ptr,
         png_unknown_chunkp chunk);
    {
       /* The unknown chunk structure contains your
          chunk data: */
           png_byte name[5];
           png_byte *data;
           png_size_t size;
       /* Note that libpng has already taken care of
          the CRC handling */

       /* put your code here.  Return one of the
          following: */

       return (-n); /* chunk had an error */
       return (0); /* did not recognize */
       return (n); /* success */
    }

(You can give your function another name that you like instead of
"read_chunk_callback")

To inform libpng about your function, use

    png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr,
        read_chunk_callback);

This names not only the callback function, but also a user pointer that
you can retrieve with

    png_get_user_chunk_ptr(png_ptr);

At this point, you can set up a callback function that will be
called after each row has been read, which you can use to control
a progress meter or the like.  It's demonstrated in pngtest.c.
You must supply a function

    void read_row_callback(png_ptr ptr, png_uint_32 row,
       int pass);
    {
      /* put your code here */
    }

(You can give it another name that you like instead of "read_row_callback")

To inform libpng about your function, use

    png_set_read_status_fn(png_ptr, read_row_callback);

Width and height limits

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级欧美三级| 久久国产精品一区二区| 欧美性高清videossexo| 国产精品剧情在线亚洲| 欧美在线看片a免费观看| 亚洲视频综合在线| 欧美性猛交xxxxxxxx| 精品一二三四区| 精品日韩在线一区| 国产成+人+日韩+欧美+亚洲| 久久久一区二区三区捆绑**| 春色校园综合激情亚洲| 秋霞影院一区二区| 亚洲精品中文字幕乱码三区| 欧美偷拍一区二区| 精品中文字幕一区二区小辣椒| 精品国产一二三| 91小视频免费观看| 久久精品久久综合| 亚洲大片免费看| 久久精品视频在线看| 欧美日韩中文精品| av一区二区三区| 激情深爱一区二区| 日韩精品久久久久久| 中文字幕综合网| 国产午夜一区二区三区| 欧美写真视频网站| 91传媒视频在线播放| 成人高清av在线| 国产宾馆实践打屁股91| 激情伊人五月天久久综合| 一区二区三区在线观看国产| 久久精品夜夜夜夜久久| 欧美一三区三区四区免费在线看 | 日韩欧美中文一区| 粉嫩一区二区三区性色av| 日韩精品视频网站| 5566中文字幕一区二区电影| 成人激情文学综合网| 成人丝袜视频网| 日韩欧美国产麻豆| 在线不卡中文字幕播放| 日韩综合一区二区| 91麻豆精品国产91久久久久久| 亚洲人成网站精品片在线观看| 国产精品69久久久久水密桃| 国产精品美女一区二区在线观看| 国产一二三精品| 亚洲欧美激情插 | 自拍偷在线精品自拍偷无码专区| 成人av在线网| 亚洲小说春色综合另类电影| 欧美日韩国产高清一区二区三区| 三级成人在线视频| 久久久久久9999| 91麻豆swag| 老汉av免费一区二区三区| 国产午夜亚洲精品不卡| 91国偷自产一区二区三区观看| 一卡二卡欧美日韩| 久久久国产综合精品女国产盗摄| 成人夜色视频网站在线观看| 亚洲激情自拍视频| 欧美激情在线观看视频免费| 色婷婷综合久久久中文一区二区| 日欧美一区二区| 亚洲免费视频中文字幕| 欧美精品一区二区久久婷婷| av一区二区不卡| 日韩视频国产视频| 午夜影视日本亚洲欧洲精品| 欧美日韩一二三| 欧美午夜精品久久久久久孕妇| 欧美日韩综合在线| 日韩午夜精品电影| 中文字幕在线免费不卡| 中文字幕av一区 二区| 一区二区三区成人| 免费高清视频精品| 99久久99久久精品国产片果冻| 欧美日韩一区二区电影| 精品88久久久久88久久久| 欧美日韩一区二区三区免费看| 日韩一区精品字幕| 久久99精品一区二区三区| 日韩影院在线观看| 麻豆精品蜜桃视频网站| 精品在线免费视频| 成人手机在线视频| 97精品久久久久中文字幕| 成人免费看的视频| 91美女在线看| 91精品国产品国语在线不卡| 51午夜精品国产| 精品久久久久久久久久久久久久久久久| 91麻豆精品国产91久久久久久久久| 欧美精品一卡二卡| 国产女人aaa级久久久级| 亚洲美女在线国产| 日本午夜一本久久久综合| 精品一区二区在线免费观看| 国产激情一区二区三区四区| 91日韩在线专区| 欧美一级淫片007| 亚洲日本成人在线观看| 日韩 欧美一区二区三区| 99久久婷婷国产综合精品| 欧美日本在线观看| 国产精品天美传媒| 美国精品在线观看| 欧美午夜一区二区三区免费大片| 中文字幕一区二区三区色视频| 日韩国产在线一| 一本色道**综合亚洲精品蜜桃冫| 久久伊99综合婷婷久久伊| 麻豆中文一区二区| 2023国产一二三区日本精品2022| 国产精品入口麻豆九色| 欧美成人免费网站| 欧美精品一区二区三| 久久男人中文字幕资源站| 日韩欧美二区三区| 亚洲一区二区三区视频在线| 日韩成人一级片| 丁香激情综合国产| 日韩视频免费直播| 亚洲电影中文字幕在线观看| 国产大陆a不卡| 久久久久国产精品厨房| 日本不卡一区二区| 在线播放欧美女士性生活| 自拍偷自拍亚洲精品播放| 成人网在线免费视频| 国产精品高潮久久久久无| 国产黄色成人av| 国产欧美日韩激情| 99久久精品费精品国产一区二区| 国产欧美视频一区二区三区| 国产精品一二三| 国产精品拍天天在线| 91片在线免费观看| 日日骚欧美日韩| 国产亚洲精品中文字幕| 色综合网站在线| 日韩成人dvd| 亚洲特黄一级片| 欧美高清精品3d| 99久久国产免费看| 亚洲观看高清完整版在线观看| 欧美精品色综合| 不卡av免费在线观看| 午夜精品123| 亚洲欧美日韩国产另类专区| 91精品啪在线观看国产60岁| 国产91在线观看丝袜| 亚洲成人午夜影院| 国产精品久久久久久久久果冻传媒| 欧洲视频一区二区| 国产一区二区三区黄视频| 亚洲精品菠萝久久久久久久| 国产女人aaa级久久久级| 91精品国产综合久久蜜臀| 一本久久a久久精品亚洲| 国产成人午夜99999| 日韩激情视频网站| 亚洲成人7777| 亚洲成人av在线电影| 亚洲精品视频在线看| 欧美国产日韩a欧美在线观看| 欧美日韩国产高清一区| 欧洲日韩一区二区三区| 色综合网色综合| 欧美日韩国产色站一区二区三区| 菠萝蜜视频在线观看一区| 大胆欧美人体老妇| 成人av在线影院| 色欧美乱欧美15图片| 91福利社在线观看| 欧美精品乱码久久久久久| 欧美日韩国产一区| 欧美www视频| 国产欧美精品一区二区色综合朱莉| 26uuu欧美| 亚洲精品视频在线| 青青草精品视频| 成人精品鲁一区一区二区| 91首页免费视频| 制服视频三区第一页精品| 精品国产91乱码一区二区三区| 欧美成人激情免费网| 国产精品美女久久久久久久久| 亚洲同性同志一二三专区| 视频一区二区欧美| eeuss影院一区二区三区| 欧美日韩精品久久久| 国产欧美日韩三区| 亚洲成人自拍偷拍| 91视频91自| 久久久久久久久99精品|