mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.0.1e.tar
This commit is contained in:
85
libpng.3
85
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "May 21, 1998"
|
||||
.TH LIBPNG 3 "June 6, 1998"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.1e - June 6, 1998
|
||||
.SH SYNOPSIS
|
||||
|
||||
#include <png.h>
|
||||
@@ -27,11 +27,19 @@ png_structp png_create_read_struct (png_const_charp
|
||||
user_png_ver, voidp error_ptr, png_error_ptr error_fn,
|
||||
png_error_ptr warn_fn);
|
||||
|
||||
png_create_read_struct_2(png_const_charp user_png_ver,
|
||||
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr
|
||||
warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn,
|
||||
png_free_ptr free_fn)
|
||||
|
||||
png_structp png_create_write_struct (png_const_charp
|
||||
user_png_ver, voidp error_ptr, png_error_ptr error_fn,
|
||||
png_error_ptr warn_fn);
|
||||
|
||||
void png_debug_free (png_structp png_ptr, png_voidp ptr);
|
||||
png_structp png_create_write_struct_2(png_const_charp
|
||||
user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
|
||||
png_error_ptr warn_fn, png_voidp mem_ptr,
|
||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
||||
|
||||
png_voidp png_debug_malloc (png_structp png_ptr, png_uint_32
|
||||
size);
|
||||
@@ -49,6 +57,8 @@ void png_error (png_structp png_ptr, png_const_charp error);
|
||||
|
||||
void png_free (png_structp png_ptr, png_voidp ptr);
|
||||
|
||||
void png_free_default(png_structp png_ptr, png_voidp ptr)
|
||||
|
||||
png_byte png_get_bit_depth (png_structp png_ptr, png_infop
|
||||
info_ptr);
|
||||
|
||||
@@ -80,6 +90,11 @@ info_ptr, double *file_gamma);
|
||||
png_uint_32 png_get_hIST (png_structp png_ptr, png_infop
|
||||
info_ptr, png_uint_16p *hist);
|
||||
|
||||
png_uint_32 png_get_IHDR (png_structp png_ptr, png_infop
|
||||
info_ptr, png_uint_32 *width, png_uint_32 *height, int
|
||||
*bit_depth, int *color_type, int *interlace_type, int
|
||||
*compression_type, int *filter_type);
|
||||
|
||||
png_uint_32 png_get_image_height (png_structp png_ptr,
|
||||
png_infop info_ptr);
|
||||
|
||||
@@ -91,10 +106,7 @@ info_ptr);
|
||||
|
||||
png_voidp png_get_io_ptr (png_structp png_ptr);
|
||||
|
||||
png_uint_32 png_get_IHDR (png_structp png_ptr, png_infop
|
||||
info_ptr, png_uint_32 *width, png_uint_32 *height, int
|
||||
*bit_depth, int *color_type, int *interlace_type, int
|
||||
*compression_type, int *filter_type);
|
||||
png_voidp png_get_mem_ptr(png_structp png_ptr)
|
||||
|
||||
png_uint_32 png_get_oFFs (png_structp png_ptr, png_infop
|
||||
info_ptr, png_uint_32 *offset_x, png_uint_32 *offset_y, int
|
||||
@@ -168,6 +180,9 @@ void png_init_io (png_structp png_ptr, FILE *fp);
|
||||
|
||||
png_voidp png_malloc (png_structp png_ptr, png_uint_32 size);
|
||||
|
||||
png_voidp png_malloc_default(png_structp png_ptr,
|
||||
png_uint_32 size)
|
||||
|
||||
voidp png_memcpy (png_voidp s1, png_voidp s2, png_size_t size);
|
||||
|
||||
png_voidp png_memcpy_check (png_structp png_ptr, png_voidp s1,
|
||||
@@ -276,6 +291,9 @@ png_uint_32 width, png_uint_32 height, int bit_depth, int
|
||||
color_type, int interlace_type, int compression_type, int
|
||||
filter_type);
|
||||
|
||||
void png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr,
|
||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
||||
|
||||
void png_set_oFFs (png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 offset_x, png_uint_32 offset_y, int unit_type);
|
||||
|
||||
@@ -302,10 +320,10 @@ void png_set_read_fn (png_structp png_ptr, png_voidp io_ptr,
|
||||
png_rw_ptr read_data_fn);
|
||||
|
||||
void png_set_read_status_fn (png_structp png_ptr, png_read_status_ptr
|
||||
read_row_fn);
|
||||
read_row_fn);
|
||||
|
||||
void png_set_read_user_transform_fn (png_structp png_ptr,
|
||||
png_user_transform_ptr read_user_transform_fn);
|
||||
png_user_transform_ptr read_user_transform_fn);
|
||||
|
||||
void png_set_rgb_to_gray (png_structp png_ptr);
|
||||
|
||||
@@ -344,10 +362,10 @@ void png_set_write_fn (png_structp png_ptr, png_voidp io_ptr,
|
||||
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn);
|
||||
|
||||
void png_set_write_status_fn (png_structp png_ptr, png_write_status_ptr
|
||||
write_row_fn);
|
||||
write_row_fn);
|
||||
|
||||
void png_set_write_user_transform_fn (png_structp png_ptr,
|
||||
png_user_transform_ptr write_user_transform_fn);
|
||||
png_user_transform_ptr write_user_transform_fn);
|
||||
|
||||
int png_sig_cmp (png_bytep sig, png_size_t start, png_size_t
|
||||
num_to_check);
|
||||
@@ -375,7 +393,7 @@ void png_write_destroy_info (png_infop info_ptr);
|
||||
void png_write_end (png_structp png_ptr, png_infop info_ptr);
|
||||
|
||||
void png_write_flush (png_structp png_ptr);
|
||||
|
||||
|
||||
void png_write_image (png_structp png_ptr, png_bytepp image);
|
||||
|
||||
void png_write_info (png_structp png_ptr, png_infop info_ptr);
|
||||
@@ -396,7 +414,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.1d May 21, 1998
|
||||
libpng version 1.0.1e - June 6, 1998
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alumni.rpi.edu>
|
||||
Copyright (c) 1998, Glenn Randers-Pehrson
|
||||
@@ -560,10 +578,21 @@ on Changes to Libpng below regarding the old initialization functions.
|
||||
return;
|
||||
}
|
||||
|
||||
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():
|
||||
|
||||
The error handling routines passed to png_create_read_struct() are only
|
||||
necessary if you are not using the libpng supplied error handling
|
||||
functions. When libpng encounters an error, it expects to longjmp back
|
||||
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 the
|
||||
jmpbuf field of your png_struct. If you read the file from different
|
||||
routines, you will need to update the jmpbuf field every time you enter
|
||||
@@ -1454,6 +1483,15 @@ both "png_ptr"; you can call them anything you like, such as
|
||||
return;
|
||||
}
|
||||
|
||||
If you want to use your own memory allocation routines,
|
||||
define PNG_USER_MEM_SUPPORTED and use
|
||||
png_create_write_struct_2() instead of png_create_read_struct():
|
||||
|
||||
png_structp png_ptr = png_create_write_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);
|
||||
|
||||
After you have these structures, you will need to set up the
|
||||
error handling. When libpng encounters an error, it expects to
|
||||
longjmp() back to your routine. Therefore, you will need to call
|
||||
@@ -2001,14 +2039,15 @@ time, instead of calling the png_init_io() function. These functions
|
||||
also provide a void pointer that can be retrieved via the function
|
||||
png_get_io_ptr(). For example:
|
||||
|
||||
png_set_read_fn(png_structp png_ptr,
|
||||
voidp io_ptr, png_rw_ptr read_data_fn)
|
||||
png_set_read_fn(png_structp read_ptr,
|
||||
voidp read_io_ptr, png_rw_ptr read_data_fn)
|
||||
|
||||
png_set_write_fn(png_structp png_ptr,
|
||||
voidp io_ptr, png_rw_ptr write_data_fn,
|
||||
png_set_write_fn(png_structp write_ptr,
|
||||
voidp write_io_ptr, png_rw_ptr write_data_fn,
|
||||
png_flush_ptr output_flush_fn);
|
||||
|
||||
voidp io_ptr = png_get_io_ptr(png_ptr);
|
||||
voidp read_io_ptr = png_get_io_ptr(read_ptr);
|
||||
voidp write_io_ptr = png_get_io_ptr(write_ptr);
|
||||
|
||||
The replacement I/O functions should have prototypes as follows:
|
||||
|
||||
@@ -2020,7 +2059,7 @@ The replacement I/O functions should have prototypes as follows:
|
||||
|
||||
Supplying NULL for the read, write, or flush functions sets them back
|
||||
to using the default C stream functions. It is an error to read from
|
||||
a write stream, and vice versa.
|
||||
a write stream, and vice versa.
|
||||
|
||||
Error handling in libpng is done through png_error() and png_warning().
|
||||
Errors handled through png_error() are fatal, meaning that png_error()
|
||||
@@ -2374,7 +2413,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.0.1d May 21, 1998:
|
||||
Libpng version 1.0.1e - June 6, 1998:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (randeg@alumni.rpi.edu).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user