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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? libpng.txt

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩理论在线观看| 日韩免费性生活视频播放| 亚洲一区二区在线免费看| 制服丝袜亚洲网站| www.在线成人| 国产一区二区三区黄视频| 国产精品理论片| 日韩精品资源二区在线| 色综合久久久久综合99| 久久99久久99精品免视看婷婷 | 亚洲超碰精品一区二区| 欧美精品一区二区久久久| 91丨porny丨户外露出| 国内精品不卡在线| 青娱乐精品视频| 亚洲国产cao| 亚洲精品乱码久久久久久久久| 久久精品一区二区三区不卡牛牛 | 亚洲最快最全在线视频| 日本一区二区视频在线观看| 日韩一本二本av| 欧美猛男gaygay网站| 在线这里只有精品| 成人美女在线观看| 美女视频网站黄色亚洲| 舔着乳尖日韩一区| 日韩精品色哟哟| 午夜国产精品一区| 日韩电影在线观看电影| 午夜精品一区二区三区电影天堂| 亚洲丝袜精品丝袜在线| 一区二区三区中文字幕精品精品| 国产精品网站在线播放| 国产精品久久久久精k8| 日本一区二区三区四区| 国产视频一区二区在线观看| 中文字幕乱码亚洲精品一区| 欧美韩日一区二区三区四区| 国产精品久久久久一区二区三区| 国产精品欧美久久久久无广告 | 国产网红主播福利一区二区| 国产日韩欧美一区二区三区乱码| 国产精品亲子乱子伦xxxx裸| 亚洲乱码国产乱码精品精98午夜 | 免费成人av在线| caoporn国产精品| 欧美日韩国产bt| 久久久高清一区二区三区| 亚洲丝袜制服诱惑| 久久 天天综合| 色噜噜狠狠色综合欧洲selulu| 91亚洲精华国产精华精华液| 91女人视频在线观看| 欧美三级在线看| 国产精品狼人久久影院观看方式| 亚洲一区视频在线| 丁香啪啪综合成人亚洲小说 | 中文字幕一区在线观看| 天堂久久久久va久久久久| 国产99久久久国产精品免费看| 欧美午夜电影网| 国产精品免费视频一区| 日本91福利区| 欧美久久婷婷综合色| ...av二区三区久久精品| 精品一区二区三区香蕉蜜桃| 欧美中文字幕亚洲一区二区va在线| 国产清纯在线一区二区www| 日韩精品高清不卡| 欧美色精品在线视频| 亚洲人吸女人奶水| 成人av在线观| 国产精品不卡一区二区三区| 国产成人福利片| 国产欧美日韩久久| 国产精品一二三区| 中文一区在线播放| 大胆亚洲人体视频| 国产亚洲精久久久久久| 日韩在线观看一区二区| 91麻豆精品国产91久久久久| 亚洲视频一区在线观看| 久久精品国产一区二区三| 日韩免费电影网站| 国产美女精品一区二区三区| 精品少妇一区二区三区| 久久99精品久久久久| 久久九九久久九九| 一本色道久久综合亚洲91| 亚洲一本大道在线| 欧美成人精品1314www| 国产成人免费在线视频| 最近日韩中文字幕| 7777精品伊人久久久大香线蕉经典版下载 | 国产99久久久久| 亚洲精品久久久蜜桃| 欧美日韩小视频| 国产精品一区二区在线观看网站 | 在线免费观看日韩欧美| 五月天欧美精品| 亚洲国产高清不卡| 91.麻豆视频| 成人精品国产免费网站| 亚洲国产一区二区在线播放| 精品日韩一区二区三区| 一本久道中文字幕精品亚洲嫩| 亚洲成人在线网站| 国产欧美日韩精品在线| 日韩免费看网站| 欧美色国产精品| 国产成人午夜精品5599 | 欧美在线观看你懂的| 日韩福利视频导航| 日韩一区有码在线| 精品剧情在线观看| 欧美日韩不卡在线| 色综合一个色综合亚洲| 久久成人免费电影| 午夜久久久久久| 亚洲精品乱码久久久久| 国产午夜精品久久久久久免费视 | 91女神在线视频| 99热精品一区二区| 97精品国产露脸对白| 春色校园综合激情亚洲| 成人免费视频一区二区| 国产99精品国产| 成人午夜视频免费看| 九九九久久久精品| 韩国v欧美v亚洲v日本v| 美国精品在线观看| 蜜臀久久99精品久久久久久9| 亚洲二区在线视频| 午夜精品福利一区二区三区av| 亚洲欧美一区二区久久| 亚洲视频网在线直播| 一区二区三区鲁丝不卡| 亚洲激情自拍偷拍| 亚洲v日本v欧美v久久精品| 日韩精品一区第一页| 青青草国产成人av片免费 | 三级欧美韩日大片在线看| 午夜精品久久一牛影视| 老鸭窝一区二区久久精品| 亚洲欧洲成人精品av97| 国产精品每日更新在线播放网址| 亚洲欧洲精品天堂一级| 亚洲超碰精品一区二区| 九九**精品视频免费播放| av中文一区二区三区| 欧美日韩dvd在线观看| 欧美不卡在线视频| 亚洲女同女同女同女同女同69| 视频一区在线播放| 成人小视频在线| 欧美男人的天堂一二区| 国产拍揄自揄精品视频麻豆| 亚洲视频在线观看一区| 日本不卡视频在线观看| 一本一本久久a久久精品综合麻豆| 欧美久久久久久久久久| 日韩码欧中文字| 国产一区二区福利视频| 欧美亚洲国产bt| 久久久久久久久伊人| 日韩激情一二三区| 在线观看日韩电影| 中日韩av电影| 国产成人欧美日韩在线电影| 91.麻豆视频| 奇米精品一区二区三区在线观看一 | 亚洲一区av在线| www.亚洲精品| 中文字幕一区二区三区av| 国产成人欧美日韩在线电影| 久久亚洲综合av| 美女脱光内衣内裤视频久久网站| 欧美亚洲丝袜传媒另类| 中文字幕佐山爱一区二区免费| 国产aⅴ精品一区二区三区色成熟| 在线电影一区二区三区| 日日夜夜免费精品| 在线播放欧美女士性生活| 婷婷成人综合网| 色猫猫国产区一区二在线视频| 久久九九99视频| youjizz久久| 亚洲综合精品久久| 欧美日韩在线播| 香蕉久久夜色精品国产使用方法| 在线免费不卡视频| 一区二区三区中文字幕精品精品| 欧美在线观看一二区| 日日骚欧美日韩| 欧美成人女星排名| 国产一区不卡视频| 中文字幕在线一区免费| 欧美午夜精品久久久久久超碰 | 欧美日韩国产影片| 国产在线精品一区二区|