Imported from libpng-1.00.tar
This commit is contained in:
parent
4922b1b6e9
commit
397100eb8a
8
CHANGES
8
CHANGES
@ -268,11 +268,3 @@ version 1.00 [March 7, 1998]
|
|||||||
changed some typedefs (s_start, etc.) in pngrutil.c
|
changed some typedefs (s_start, etc.) in pngrutil.c
|
||||||
fixed dimensions of "short_months" array in pngwrite.c
|
fixed dimensions of "short_months" array in pngwrite.c
|
||||||
Replaced ansi2knr.c with the one from jpeg-v6
|
Replaced ansi2knr.c with the one from jpeg-v6
|
||||||
version 1.0.0 [March 8, 1998]
|
|
||||||
Changed name from 1.00 to 1.0.0 (Adam Costello)
|
|
||||||
Added smakefile.ppc (with SCOPTIONS.ppc) for Amiga PPC (Andreas Kleinert)
|
|
||||||
version 1.0.1 [March 9, 1998]
|
|
||||||
Fixed three bugs in pngrtran.c to make gamma+background handling consistent
|
|
||||||
(Greg Roelofs)
|
|
||||||
Changed format of the PNG_LIBPNG_VER integer to xyyyzzzz instead of xyz
|
|
||||||
for major, minor, and bugfix releases. This is 10000001L. (Adam Costello)
|
|
||||||
|
10
INSTALL
10
INSTALL
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Installing libpng version 1.0.1 March 9, 1998
|
Installing libpng version 1.00 March 7, 1998
|
||||||
|
|
||||||
Before installing libpng, you must first install zlib. zlib
|
Before installing libpng, you must first install zlib. zlib
|
||||||
can usually be found wherever you got libpng. zlib can be
|
can usually be found wherever you got libpng. zlib can be
|
||||||
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
|
|||||||
version of zlib that's installed.
|
version of zlib that's installed.
|
||||||
|
|
||||||
You can rename the directories that you downloaded (they
|
You can rename the directories that you downloaded (they
|
||||||
might be called "libpng-1.0.1 or "lpng100" and "zlib-1.1.1"
|
might be called "libpng-1.00 or "lpng100" and "zlib-1.1.1"
|
||||||
or "zlib111") so that you have directories called "zlib" and "libpng".
|
or "zlib111") so that you have directories called "zlib" and "libpng".
|
||||||
|
|
||||||
Your directory structure should look like this:
|
Your directory structure should look like this:
|
||||||
@ -44,13 +44,11 @@ include
|
|||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile
|
makefile.sgi => Silicon Graphics IRIX makefile
|
||||||
makefile.sun => Sun makefile
|
makefile.sun => Sun makefile
|
||||||
makefile.s2x => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0)
|
makefile.s2x => Solaris 2.X makefile (gcc, creates libpng.so.2.1.00)
|
||||||
makefile.lnx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0)
|
makefile.lnx => Linux/ELF makefile (gcc, creates libpng.so.2.1.00)
|
||||||
makefile.mip => MIPS makefile
|
makefile.mip => MIPS makefile
|
||||||
makefile.aco => Acorn makefile
|
makefile.aco => Acorn makefile
|
||||||
makefile.ama => Amiga makefile
|
makefile.ama => Amiga makefile
|
||||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
|
||||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
|
||||||
makefile.atr => Atari makefile
|
makefile.atr => Atari makefile
|
||||||
makefile.bor => Borland makefile
|
makefile.bor => Borland makefile
|
||||||
build.bat => MS-DOS batch file for Borland compiler
|
build.bat => MS-DOS batch file for Borland compiler
|
||||||
|
8
README
8
README
@ -1,4 +1,4 @@
|
|||||||
README for libpng 1.0.1 (shared library 2.1)
|
README for libpng 1.00 (shared library 2.1)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
@ -161,13 +161,11 @@ Files in this distribution:
|
|||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile
|
makefile.sgi => Silicon Graphics IRIX makefile
|
||||||
makefile.sun => Sun makefile
|
makefile.sun => Sun makefile
|
||||||
makefile.s2x => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0)
|
makefile.s2x => Solaris 2.X makefile (gcc, creates libpng.so.2.1.00)
|
||||||
makefile.lnx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0)
|
makefile.lnx => Linux/ELF makefile (gcc, creates libpng.so.2.1.00)
|
||||||
makefile.mip => MIPS makefile
|
makefile.mip => MIPS makefile
|
||||||
makefile.aco => Acorn makefile
|
makefile.aco => Acorn makefile
|
||||||
makefile.ama => Amiga makefile
|
makefile.ama => Amiga makefile
|
||||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
|
||||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
|
||||||
makefile.atr => Atari makefile
|
makefile.atr => Atari makefile
|
||||||
makefile.bor => Borland makefile
|
makefile.bor => Borland makefile
|
||||||
build.bat => MS-DOS batch file for Borland compiler
|
build.bat => MS-DOS batch file for Borland compiler
|
||||||
|
10
example.c
10
example.c
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
/* Check to see if a file is a PNG file using png_sig_cmp(). Returns
|
/* Check to see if a file is a PNG file using png_check_sig(). Returns
|
||||||
* non-zero if the image is a PNG, and 0 if it isn't a PNG.
|
* non-zero if the image is a PNG, and 0 if it isn't a PNG.
|
||||||
*
|
*
|
||||||
* If this call is successful, and you are going to keep the file open,
|
* If this call is successful, and you are going to keep the file open,
|
||||||
@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
* Many applications already read the first 2 or 4 bytes from the start
|
* 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
|
* 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
|
* to pass the bytes to png_check_sig() or even skip that if you know
|
||||||
* you have a PNG file, and call png_set_sig_bytes().
|
* you have a PNG file, and call png_set_sig_bytes().
|
||||||
*/
|
*/
|
||||||
#define PNG_BYTES_TO_CHECK 4
|
#define PNG_BYTES_TO_CHECK 4
|
||||||
@ -46,7 +46,7 @@ int check_if_png(char *file_name, FILE **fp)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */
|
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */
|
||||||
return(png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK));
|
return(png_check_sig(buf, PNG_BYTES_TO_CHECK));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a PNG file. You may want to return an error code if the read
|
/* Read a PNG file. You may want to return an error code if the read
|
||||||
@ -92,7 +92,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate/initialize the memory for image information. REQUIRED. */
|
/* Allocate/initialize the memory for image information. REQUIRED. */
|
||||||
info_ptr = png_create_info_struct(png_ptr);
|
info_ptr = png_create_info_struct();
|
||||||
if (info_ptr == NULL)
|
if (info_ptr == NULL)
|
||||||
{
|
{
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -127,7 +127,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
|
|||||||
#endif no_streams /* Use only one I/O method! */
|
#endif no_streams /* Use only one I/O method! */
|
||||||
|
|
||||||
/* If we have already read some of the signature */
|
/* If we have already read some of the signature */
|
||||||
png_set_sig_bytes(png_ptr, sig_read);
|
png_set_sig_bytes_read(png_ptr, sig_read);
|
||||||
|
|
||||||
/* The call to png_read_info() gives us all of the information from the
|
/* The call to png_read_info() gives us all of the information from the
|
||||||
* PNG file before the first IDAT (image data chunk). REQUIRED
|
* PNG file before the first IDAT (image data chunk). REQUIRED
|
||||||
|
12
libpng.3
12
libpng.3
@ -1,4 +1,4 @@
|
|||||||
.TH LIBPNG 3 "March 9, 1998"
|
.TH LIBPNG 3 "March 7, 1998"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library
|
libpng \- Portable Network Graphics (PNG) Reference Library
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -396,7 +396,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.0.1 March 9, 1998
|
libpng version 1.00 March 7, 1998
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alumni.rpi.edu>
|
<randeg@alumni.rpi.edu>
|
||||||
Copyright (c) 1998, Glenn Randers-Pehrson
|
Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
@ -2301,13 +2301,13 @@ the first widely used release:
|
|||||||
[should have been 2.0.95]
|
[should have been 2.0.95]
|
||||||
0.96 ("1.0 beta 6") 0.96 0.96
|
0.96 ("1.0 beta 6") 0.96 0.96
|
||||||
[should have been 2.0.96]
|
[should have been 2.0.96]
|
||||||
0.97b ("1.00.97 beta 7") 1.00.97 1.0.1
|
0.97b ("1.00.97 beta 7") 1.00.97 1.0.0
|
||||||
[should have been 2.0.97]
|
[should have been 2.0.97]
|
||||||
0.97c 0.97 2.0.97
|
0.97c 0.97 2.0.97
|
||||||
0.98 0.98 2.0.98
|
0.98 0.98 2.0.98
|
||||||
0.99 0.99 2.0.99
|
0.99 0.99 2.0.99
|
||||||
0.99a-m 0.99 2.0.99
|
0.99a-g 0.99 2.0.99
|
||||||
1.0.1 1.00 2.1.0
|
1.0 1.00 2.1.0
|
||||||
|
|
||||||
Henceforth the source version will match the shared-library minor
|
Henceforth the source version will match the shared-library minor
|
||||||
and patch numbers; the shared-library major version number will be
|
and patch numbers; the shared-library major version number will be
|
||||||
@ -2365,7 +2365,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.0.1 (March 9, 1998):
|
Libpng version 1.00 (March 7, 1998):
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (randeg@alumni.rpi.edu).
|
Currently maintained by Glenn Randers-Pehrson (randeg@alumni.rpi.edu).
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.0.1 March 9, 1998
|
libpng version 1.00 March 7, 1998
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<randeg@alumni.rpi.edu>
|
<randeg@alumni.rpi.edu>
|
||||||
Copyright (c) 1998, Glenn Randers-Pehrson
|
Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.TH LIBPNGPF 3 "March 9, 1998"
|
.TH LIBPNGPF 3 "March 7, 1998"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library
|
libpng \- Portable Network Graphics (PNG) Reference Library
|
||||||
(private functions)
|
(private functions)
|
||||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "March 9, 1998"
|
.TH PNG 5 "March 7, 1998"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
6
png.c
6
png.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
@ -16,7 +16,7 @@
|
|||||||
/* Version information for C files. This had better match the version
|
/* Version information for C files. This had better match the version
|
||||||
* string defined in png.h.
|
* string defined in png.h.
|
||||||
*/
|
*/
|
||||||
char png_libpng_ver[6] = "1.0.1";
|
char png_libpng_ver[5] = "1.00";
|
||||||
|
|
||||||
/* Place to hold the signature string for a PNG file. */
|
/* Place to hold the signature string for a PNG file. */
|
||||||
png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||||
|
27
png.h
27
png.h
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see the COPYRIGHT NOTICE below.
|
* For conditions of distribution and use, see the COPYRIGHT NOTICE below.
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998 Glenn Randers-Pehrson
|
* Copyright (c) 1998 Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
*
|
*
|
||||||
@ -23,12 +23,12 @@
|
|||||||
* 0.90 ("1.0 beta 4") 0.90 0.90 [should have been 2.0.90]
|
* 0.90 ("1.0 beta 4") 0.90 0.90 [should have been 2.0.90]
|
||||||
* 0.95 ("1.0 beta 5") 0.95 0.95 [should have been 2.0.95]
|
* 0.95 ("1.0 beta 5") 0.95 0.95 [should have been 2.0.95]
|
||||||
* 0.96 ("1.0 beta 6") 0.96 0.96 [should have been 2.0.96]
|
* 0.96 ("1.0 beta 6") 0.96 0.96 [should have been 2.0.96]
|
||||||
* 0.97b ("1.00.97 beta 7") 1.00.97 1.0.1 [should have been 2.0.97]
|
* 0.97b ("1.00.97 beta 7") 1.00.97 1.0.0 [should have been 2.0.97]
|
||||||
* 0.97c 0.97 2.0.97
|
* 0.97c 0.97 2.0.97
|
||||||
* 0.98 0.98 2.0.98
|
* 0.98 0.98 2.0.98
|
||||||
* 0.99 0.99 2.0.99
|
* 0.99 0.99 2.0.99
|
||||||
* 0.99a-m 0.99 2.0.99
|
* 0.99a-i 0.99 2.0.99
|
||||||
* 1.0.1 1.00 2.1.0
|
* 1.00 1.00 2.1.0
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library minor
|
* Henceforth the source version will match the shared-library minor
|
||||||
* and patch numbers; the shared-library major version number will be
|
* and patch numbers; the shared-library major version number will be
|
||||||
@ -112,20 +112,19 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.0.1"
|
#define PNG_LIBPNG_VER_STRING "1.00"
|
||||||
|
|
||||||
/* careful here. At one time, I wanted to use 082, but that would be octal.
|
/* careful here. At one time, I wanted to use 082, but that would be octal.
|
||||||
* We must not include leading blanks.
|
* Version 1.0 will be 100 here, etc.
|
||||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here. From
|
*/
|
||||||
* version 1.0.1 it's xxxyyyzzzzL, where x=major, y=minor, z-bugfix*/
|
#define PNG_LIBPNG_VER 100
|
||||||
#define PNG_LIBPNG_VER 10000001L
|
|
||||||
|
|
||||||
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
|
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
|
||||||
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
|
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
|
||||||
/* Version information for C files, stored in png.c. This had better match
|
/* Version information for C files, stored in png.c. This had better match
|
||||||
* the version above.
|
* the version above.
|
||||||
*/
|
*/
|
||||||
extern char png_libpng_ver[6];
|
extern char png_libpng_ver[5];
|
||||||
|
|
||||||
/* Structures to facilitate easy interlacing. See png.c for more details */
|
/* Structures to facilitate easy interlacing. See png.c for more details */
|
||||||
extern int FARDATA png_pass_start[7];
|
extern int FARDATA png_pass_start[7];
|
||||||
@ -1484,11 +1483,11 @@ extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
|
|||||||
#define PNG_GAMMA 0x2000
|
#define PNG_GAMMA 0x2000
|
||||||
#define PNG_GRAY_TO_RGB 0x4000
|
#define PNG_GRAY_TO_RGB 0x4000
|
||||||
#define PNG_FILLER 0x8000
|
#define PNG_FILLER 0x8000
|
||||||
#define PNG_PACKSWAP 0x1.0.1L
|
#define PNG_PACKSWAP 0x10000L
|
||||||
#define PNG_SWAP_ALPHA 0x20000L
|
#define PNG_SWAP_ALPHA 0x20000L
|
||||||
#define PNG_STRIP_ALPHA 0x40000L
|
#define PNG_STRIP_ALPHA 0x40000L
|
||||||
#define PNG_INVERT_ALPHA 0x80000L
|
#define PNG_INVERT_ALPHA 0x80000L
|
||||||
#define PNG_USER_TRANSFORM 0x1.0.10L
|
#define PNG_USER_TRANSFORM 0x100000L
|
||||||
|
|
||||||
/* flags for png_create_struct */
|
/* flags for png_create_struct */
|
||||||
#define PNG_STRUCT_PNG 0x0001
|
#define PNG_STRUCT_PNG 0x0001
|
||||||
@ -1517,7 +1516,7 @@ extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
|
|||||||
#define PNG_FLAG_FREE_TRANS 0x2000
|
#define PNG_FLAG_FREE_TRANS 0x2000
|
||||||
#define PNG_FLAG_FREE_HIST 0x4000
|
#define PNG_FLAG_FREE_HIST 0x4000
|
||||||
#define PNG_FLAG_HAVE_CHUNK_HEADER 0x8000L
|
#define PNG_FLAG_HAVE_CHUNK_HEADER 0x8000L
|
||||||
#define PNG_FLAG_WROTE_tIME 0x1.0.1L
|
#define PNG_FLAG_WROTE_tIME 0x10000L
|
||||||
|
|
||||||
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
|
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
|
||||||
PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Any machine specific code is near the front of this file, so if you
|
/* Any machine specific code is near the front of this file, so if you
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* pngerror.c - stub functions for i/o and memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file provides a location for all error handling. Users which
|
* This file provides a location for all error handling. Users which
|
||||||
* need special error handling are expected to write replacement functions
|
* need special error handling are expected to write replacement functions
|
||||||
|
8
pngget.c
8
pngget.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
@ -259,14 +259,14 @@ float
|
|||||||
png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
||||||
{
|
{
|
||||||
return ((float)png_get_x_offset_microns(png_ptr, info_ptr)
|
return ((float)png_get_x_offset_microns(png_ptr, info_ptr)
|
||||||
*.03937/1.0.100. +.5)
|
*.03937/1000000. +.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
||||||
{
|
{
|
||||||
return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
|
return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
|
||||||
*.03937/1.0.100. +.5)
|
*.03937/1000000. +.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_READ_pHYs_SUPPORTED)
|
#if defined(PNG_READ_pHYs_SUPPORTED)
|
||||||
|
4
pngmem.c
4
pngmem.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file provides a location for all memory allocation. Users which
|
* This file provides a location for all memory allocation. Users which
|
||||||
* need special memory handling are expected to modify the code in this file
|
* need special memory handling are expected to modify the code in this file
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file contains routines that an application calls directly to
|
* This file contains routines that an application calls directly to
|
||||||
* read a PNG file or stream.
|
* read a PNG file or stream.
|
||||||
|
4
pngrio.c
4
pngrio.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file provides a location for all input. Users which need
|
* This file provides a location for all input. Users which need
|
||||||
* special handling are expected to write a function which has the same
|
* special handling are expected to write a function which has the same
|
||||||
|
83
pngrtran.c
83
pngrtran.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file contains functions optionally called by an application
|
* This file contains functions optionally called by an application
|
||||||
* in order to tell libpng how to handle data when reading a PNG.
|
* in order to tell libpng how to handle data when reading a PNG.
|
||||||
@ -665,8 +665,7 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
||||||
{
|
{
|
||||||
#if defined(PNG_READ_EXPAND_SUPPORTED)
|
#if defined(PNG_READ_EXPAND_SUPPORTED)
|
||||||
/* GRR BUG #1: was (png_ptr->transformations & !PNG_EXPAND) */
|
if (png_ptr->transformations & !PNG_EXPAND)
|
||||||
if (!(png_ptr->transformations & PNG_EXPAND))
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* invert the alpha channel (in tRNS) unless the pixels are
|
/* invert the alpha channel (in tRNS) unless the pixels are
|
||||||
@ -713,65 +712,41 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double g, gs;
|
double g;
|
||||||
|
|
||||||
/*
|
g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
||||||
GRR BUG #3: inconsistent with handling of full RGBA below
|
|
||||||
g = 1.0 / png_ptr->background_gamma;
|
|
||||||
gs = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
|
||||||
*/
|
|
||||||
switch (png_ptr->background_gamma_type)
|
|
||||||
{
|
|
||||||
case PNG_BACKGROUND_GAMMA_SCREEN:
|
|
||||||
g = (png_ptr->screen_gamma);
|
|
||||||
gs = 1.0;
|
|
||||||
break;
|
|
||||||
case PNG_BACKGROUND_GAMMA_FILE:
|
|
||||||
g = 1.0 / (png_ptr->gamma);
|
|
||||||
gs = 1.0 / (png_ptr->gamma * png_ptr->screen_gamma);
|
|
||||||
break;
|
|
||||||
case PNG_BACKGROUND_GAMMA_UNIQUE:
|
|
||||||
g = 1.0 / (png_ptr->background_gamma);
|
|
||||||
gs = 1.0 / (png_ptr->background_gamma *
|
|
||||||
png_ptr->screen_gamma);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g = 1.0; /* back_1 */
|
|
||||||
gs = 1.0; /* back */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (png_ptr->background_gamma_type==PNG_BACKGROUND_GAMMA_SCREEN||
|
||||||
/*
|
fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
|
||||||
GRR BUG #2: This creates self-inconsistent images--fully
|
|
||||||
transparent and fully opaque look fine, but translucent
|
|
||||||
pixels are wrong (too bright if XV's code can be trusted).
|
|
||||||
Commenting it out makes an internally self-consistent
|
|
||||||
image, but still not consistent with RGBA version of same
|
|
||||||
thing (again, too bright in XV).
|
|
||||||
png_ptr->background_gamma_type==PNG_BACKGROUND_GAMMA_SCREEN||
|
|
||||||
*/
|
|
||||||
fabs(gs - 1.0) < PNG_GAMMA_THRESHOLD)
|
|
||||||
{
|
{
|
||||||
back.red = (png_byte)png_ptr->background.red;
|
back.red = (png_byte)png_ptr->background.red;
|
||||||
back.green = (png_byte)png_ptr->background.green;
|
back.green = (png_byte)png_ptr->background.green;
|
||||||
back.blue = (png_byte)png_ptr->background.blue;
|
back.blue = (png_byte)png_ptr->background.blue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
back.red = (png_byte)(pow(
|
back.red =
|
||||||
(double)png_ptr->background.red/255, gs) * 255.0 + .5);
|
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||||
back.green = (png_byte)(pow(
|
255.0 + 0.5);
|
||||||
(double)png_ptr->background.green/255, gs) * 255.0 + .5);
|
back.green =
|
||||||
back.blue = (png_byte)(pow(
|
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||||
(double)png_ptr->background.blue/255, gs) * 255.0 + .5);
|
255.0 + 0.5);
|
||||||
|
back.blue =
|
||||||
|
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||||
|
255.0 + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
back_1.red = (png_byte)(pow(
|
g = 1.0 / png_ptr->background_gamma;
|
||||||
(double)png_ptr->background.red/255, g) * 255.0 + .5);
|
|
||||||
back_1.green = (png_byte)(pow(
|
back_1.red =
|
||||||
(double)png_ptr->background.green/255, g) * 255.0 + .5);
|
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||||
back_1.blue = (png_byte)(pow(
|
255.0 + 0.5);
|
||||||
(double)png_ptr->background.blue/255, g) * 255.0 + .5);
|
back_1.green =
|
||||||
|
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||||
|
255.0 + 0.5);
|
||||||
|
back_1.blue =
|
||||||
|
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||||
|
255.0 + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
|
24
pngrutil.c
24
pngrutil.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 0.99
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file contains routines which are only called from within
|
* This file contains routines which are only called from within
|
||||||
* libpng itself during the course of reading an image.
|
* libpng itself during the course of reading an image.
|
||||||
@ -436,7 +436,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
#endif /* PNG_READ_sRGB_SUPPORTED */
|
#endif /* PNG_READ_sRGB_SUPPORTED */
|
||||||
|
|
||||||
file_gamma = (float)igamma / (float)1.0.10.0;
|
file_gamma = (float)igamma / (float)100000.0;
|
||||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||||
png_ptr->gamma = file_gamma;
|
png_ptr->gamma = file_gamma;
|
||||||
#endif
|
#endif
|
||||||
@ -549,11 +549,11 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
white_x = (float)val / (float)1.0.10.0;
|
white_x = (float)val / (float)100000.0;
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
white_y = (float)val / (float)1.0.10.0;
|
white_y = (float)val / (float)100000.0;
|
||||||
|
|
||||||
if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||
|
if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||
|
||||||
white_x + white_y > 1.0)
|
white_x + white_y > 1.0)
|
||||||
@ -565,11 +565,11 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
red_x = (float)val / (float)1.0.10.0;
|
red_x = (float)val / (float)100000.0;
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
red_y = (float)val / (float)1.0.10.0;
|
red_y = (float)val / (float)100000.0;
|
||||||
|
|
||||||
if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 ||
|
if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 ||
|
||||||
red_x + red_y > 1.0)
|
red_x + red_y > 1.0)
|
||||||
@ -581,11 +581,11 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
green_x = (float)val / (float)1.0.10.0;
|
green_x = (float)val / (float)100000.0;
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
green_y = (float)val / (float)1.0.10.0;
|
green_y = (float)val / (float)100000.0;
|
||||||
|
|
||||||
if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 ||
|
if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 ||
|
||||||
green_x + green_y > 1.0)
|
green_x + green_y > 1.0)
|
||||||
@ -597,11 +597,11 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
blue_x = (float)val / (float)1.0.10.0;
|
blue_x = (float)val / (float)100000.0;
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, 4);
|
png_crc_read(png_ptr, buf, 4);
|
||||||
val = png_get_uint_32(buf);
|
val = png_get_uint_32(buf);
|
||||||
blue_y = (float)val / (float)1.0.10.0;
|
blue_y = (float)val / (float)100000.0;
|
||||||
|
|
||||||
if (blue_x < (float)0 || blue_x > (float)0.8 || blue_y < (float)0 ||
|
if (blue_x < (float)0 || blue_x > (float)0.8 || blue_y < (float)0 ||
|
||||||
blue_y > (float)0.8 || blue_x + blue_y > (float)1.0)
|
blue_y > (float)0.8 || blue_x + blue_y > (float)1.0)
|
||||||
@ -694,7 +694,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
|
|
||||||
#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
|
#if defined(PNG_READ_gAMA_SUPPORTED) && defined(PNG_READ_GAMMA_SUPPORTED)
|
||||||
if ((info_ptr->valid & PNG_INFO_gAMA))
|
if ((info_ptr->valid & PNG_INFO_gAMA))
|
||||||
if((png_uint_32)(png_ptr->gamma*(float)1.0.10.+.5) != (png_uint_32)45000L)
|
if((png_uint_32)(png_ptr->gamma*(float)100000.+.5) != (png_uint_32)45000L)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Ignoring incorrect gAMA value when sRGB is also present");
|
"Ignoring incorrect gAMA value when sRGB is also present");
|
||||||
|
4
pngset.c
4
pngset.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* The functions here are used during reads to store data from the file
|
* The functions here are used during reads to store data from the file
|
||||||
* into the info struct, and during writes to store application data
|
* into the info struct, and during writes to store application data
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This program reads in a PNG image, writes it out again, and then
|
* This program reads in a PNG image, writes it out again, and then
|
||||||
* compares the two files. If the files are identical, this shows that
|
* compares the two files. If the files are identical, this shows that
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
|
4
pngwio.c
4
pngwio.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*
|
*
|
||||||
* This file provides a location for all output. Users which need
|
* This file provides a location for all output. Users which need
|
||||||
* special handling are expected to write functions which have the same
|
* special handling are expected to write functions which have the same
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* get internal access to png.h */
|
/* get internal access to png.h */
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
|
26
pngwutil.c
26
pngwutil.c
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/* pngwutil.c - utilities to write a PNG file
|
/* pngwutil.c - utilities to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.0.1
|
* libpng 1.00
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||||
* Copyright (c) 1998, Glenn Randers-Pehrson
|
* Copyright (c) 1998, Glenn Randers-Pehrson
|
||||||
* March 9, 1998
|
* March 7, 1998
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_INTERNAL
|
#define PNG_INTERNAL
|
||||||
@ -340,8 +340,8 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
|
|||||||
png_byte buf[4];
|
png_byte buf[4];
|
||||||
|
|
||||||
png_debug(1, "in png_write_gAMA\n");
|
png_debug(1, "in png_write_gAMA\n");
|
||||||
/* file_gamma is saved in 1/1.0.100ths */
|
/* file_gamma is saved in 1/100,000ths */
|
||||||
igamma = (png_uint_32)(file_gamma * 1.0.10.0 + 0.5);
|
igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf, igamma);
|
png_save_uint_32(buf, igamma);
|
||||||
png_write_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
|
png_write_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
|
||||||
}
|
}
|
||||||
@ -426,16 +426,16 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
|
|||||||
png_byte buf[32];
|
png_byte buf[32];
|
||||||
|
|
||||||
png_debug(1, "in png_write_cHRM\n");
|
png_debug(1, "in png_write_cHRM\n");
|
||||||
/* each value is saved int 1/1.0.100ths */
|
/* each value is saved int 1/100,000ths */
|
||||||
if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||
|
if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 ||
|
||||||
white_x + white_y > 1.0)
|
white_x + white_y > 1.0)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Invalid cHRM white point specified");
|
png_warning(png_ptr, "Invalid cHRM white point specified");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemp = (png_uint_32)(white_x * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(white_x * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf, itemp);
|
png_save_uint_32(buf, itemp);
|
||||||
itemp = (png_uint_32)(white_y * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(white_y * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 4, itemp);
|
png_save_uint_32(buf + 4, itemp);
|
||||||
|
|
||||||
if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 ||
|
if (red_x < 0 || red_x > 0.8 || red_y < 0 || red_y > 0.8 ||
|
||||||
@ -444,9 +444,9 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
|
|||||||
png_warning(png_ptr, "Invalid cHRM red point specified");
|
png_warning(png_ptr, "Invalid cHRM red point specified");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemp = (png_uint_32)(red_x * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(red_x * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 8, itemp);
|
png_save_uint_32(buf + 8, itemp);
|
||||||
itemp = (png_uint_32)(red_y * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(red_y * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 12, itemp);
|
png_save_uint_32(buf + 12, itemp);
|
||||||
|
|
||||||
if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 ||
|
if (green_x < 0 || green_x > 0.8 || green_y < 0 || green_y > 0.8 ||
|
||||||
@ -455,9 +455,9 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
|
|||||||
png_warning(png_ptr, "Invalid cHRM green point specified");
|
png_warning(png_ptr, "Invalid cHRM green point specified");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemp = (png_uint_32)(green_x * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(green_x * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 16, itemp);
|
png_save_uint_32(buf + 16, itemp);
|
||||||
itemp = (png_uint_32)(green_y * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(green_y * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 20, itemp);
|
png_save_uint_32(buf + 20, itemp);
|
||||||
|
|
||||||
if (blue_x < 0 || blue_x > 0.8 || blue_y < 0 || blue_y > 0.8 ||
|
if (blue_x < 0 || blue_x > 0.8 || blue_y < 0 || blue_y > 0.8 ||
|
||||||
@ -466,9 +466,9 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
|
|||||||
png_warning(png_ptr, "Invalid cHRM blue point specified");
|
png_warning(png_ptr, "Invalid cHRM blue point specified");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemp = (png_uint_32)(blue_x * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(blue_x * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 24, itemp);
|
png_save_uint_32(buf + 24, itemp);
|
||||||
itemp = (png_uint_32)(blue_y * 1.0.10.0 + 0.5);
|
itemp = (png_uint_32)(blue_y * 100000.0 + 0.5);
|
||||||
png_save_uint_32(buf + 28, itemp);
|
png_save_uint_32(buf + 28, itemp);
|
||||||
|
|
||||||
png_write_chunk(png_ptr, png_cHRM, buf, (png_size_t)32);
|
png_write_chunk(png_ptr, png_cHRM, buf, (png_size_t)32);
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
OPTIMIZE
|
|
||||||
OPTPEEP
|
|
||||||
OPTTIME
|
|
||||||
OPTSCHED
|
|
||||||
AUTOREGISTER
|
|
||||||
PARMS=REGISTERS
|
|
||||||
INCLUDEDIR=hlp:ppc/include
|
|
@ -24,7 +24,7 @@ RANLIB=ranlib
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0
|
PNGMIN = 1.00
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng.so*, and png.h
|
# where make install puts libpng.a, libpng.so*, and png.h
|
||||||
|
@ -23,7 +23,7 @@ RANLIB=echo
|
|||||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||||
# have to change it.
|
# have to change it.
|
||||||
PNGMAJ = 2
|
PNGMAJ = 2
|
||||||
PNGMIN = 1.0
|
PNGMIN = 1.00
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# where make install puts libpng.a, libpng.so*, and png.h
|
# where make install puts libpng.a, libpng.so*, and png.h
|
||||||
|
@ -14,12 +14,15 @@ O=.obj
|
|||||||
E=.exe
|
E=.exe
|
||||||
|
|
||||||
# variables
|
# variables
|
||||||
OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O)
|
OBJS1 = png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O)
|
||||||
|
pngwutil$(O)
|
||||||
OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O)
|
OBJS2 = pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O)
|
||||||
OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
|
OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
|
||||||
OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O)
|
OBJSL1 = +png$(O) +pngset$(O) +pngget$(O) +pngrutil$(O) +pngtrans$(O)
|
||||||
OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O) +pngerror$(O)
|
OBJSL2 = +pngwutil$(O) +pngmem$(O) +pngpread$(O) +pngread$(O)
|
||||||
OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O)
|
+pngerror$(O)
|
||||||
|
OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O)
|
||||||
|
+pngwio$(O)
|
||||||
|
|
||||||
all: libpng.lib pngtest.exe
|
all: libpng.lib pngtest.exe
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Makefile for libpng
|
# Makefile for libpng
|
||||||
# Watcom 10a and later 32-bit protected mode flat memory model
|
# Watcom 10a+ 32-bit protected mode flat memory model
|
||||||
|
|
||||||
# Adapted by Pawel Mrochen, based on makefile.msc
|
# Adapted by Pawel Mrochen, based on makefile.msc
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
# To use, do "wmake -f makefile.wat"
|
# To use, do "wmake -f makefile.wat"
|
||||||
|
|
||||||
# ------------- Watcom 10a and later -------------
|
# ------------- Watcom 10a+ -------------
|
||||||
MODEL=-mf
|
MODEL=-mf
|
||||||
CFLAGS= $(MODEL) -fpi87 -fp5 -5r -oaeilmnrt -s -zp4 -i=..\zlib
|
CFLAGS= $(MODEL) -fpi87 -fp5 -5r -oaeilmnrt -s -zp4 -i=..\zlib
|
||||||
CC=wcc386
|
CC=wcc386
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
# Amiga powerUP (TM) Makefile
|
|
||||||
# makefile for libpng and SAS C V6.58/7.00 PPC compiler
|
|
||||||
# Copyright (C) 1998 by Andreas R. Kleinert
|
|
||||||
|
|
||||||
CC = scppc
|
|
||||||
CFLAGS = NOSTKCHK NOSINT OPTIMIZE OPTGO OPTPEEP OPTINLOCAL OPTINL IDIR /zlib \
|
|
||||||
OPTLOOP OPTRDEP=8 OPTDEP=8 OPTCOMP=8
|
|
||||||
LIBNAME = libpng.a
|
|
||||||
AR = ppc-amigaos-ar
|
|
||||||
AR_FLAGS = cr
|
|
||||||
RANLIB = ppc-amigaos-ranlib
|
|
||||||
LDFLAGS = -r -o
|
|
||||||
LDLIBS = ../zlib/libzip.a LIB:scppc.a
|
|
||||||
LN = ppc-amigaos-ld
|
|
||||||
RM = delete quiet
|
|
||||||
MKDIR = makedir
|
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o pngread.o \
|
|
||||||
pngerror.o pngpread.o pngwrite.o pngrtran.o pngwtran.o pngrio.o pngwio.o pngmem.o
|
|
||||||
|
|
||||||
all: $(LIBNAME) pngtest
|
|
||||||
|
|
||||||
$(LIBNAME): $(OBJS)
|
|
||||||
$(AR) $(AR_FLAGS) $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
pngtest: pngtest.o $(LIBNAME)
|
|
||||||
$(LN) $(LDFLAGS) pngtest LIB:c_ppc.o pngtest.o $(LIBNAME) $(LDLIBS) \
|
|
||||||
LIB:end.o
|
|
Reference in New Issue
Block a user