Imported from libpng-0.89c.tar
This commit is contained in:
parent
e5a37797b4
commit
c21f90c334
2
makefile
2
makefile
@ -13,7 +13,7 @@ RANLIB=echo
|
|||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
|
||||||
OBJS = png.o pngrcb.o pngrutil.o pngtrans.o pngwutil.o \
|
OBJS = png.o pngrcb.o pngrutil.o pngtrans.o pngwutil.o \
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o
|
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||||
|
|
||||||
all: libpng.a pngtest
|
all: libpng.a pngtest
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# makefile for libpng on Acorn RISCOS
|
||||||
# Project: libpng
|
# Project: libpng
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# gcc/DOS makefile for libpng
|
# DJGPP (DOS gcc) makefile for libpng
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
# For conditions of distribution and use, see copyright notice in png.h
|
||||||
|
|
28
png.h
28
png.h
@ -5,15 +5,16 @@
|
|||||||
May 25, 1996
|
May 25, 1996
|
||||||
|
|
||||||
Note: This is a beta version. It reads and writes valid files
|
Note: This is a beta version. It reads and writes valid files
|
||||||
on the platforms I have, but it has had limited portability
|
on the platforms I have, and has had a wide testing program.
|
||||||
testing. Furthermore, you may have to modify the
|
You may have to modify the includes below to get it to work on
|
||||||
includes below to get it to work on your system, and you
|
your system, and you may have to supply the correct compiler
|
||||||
may have to supply the correct compiler flags in the makefile.
|
flags in the makefile, if you can't find a makefile suitable for
|
||||||
Read the readme.txt for more information, and how to contact
|
your operating system/compiler combination. Read the libpng.txt
|
||||||
me if you have any problems, or if you want your compiler/
|
for more information, and how to contact me if you have any
|
||||||
platform to be supported in the next official libpng release.
|
problems, or if you want your compiler/platform to be supported
|
||||||
|
in the next official libpng release.
|
||||||
|
|
||||||
See readme.txt for more information
|
See libpng.txt for more information
|
||||||
|
|
||||||
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||||
Contributing Authors:
|
Contributing Authors:
|
||||||
@ -33,17 +34,18 @@
|
|||||||
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
and Group 42, Inc. disclaim all warranties, expressed or implied,
|
||||||
including, without limitation, the warranties of merchantability and of
|
including, without limitation, the warranties of merchantability and of
|
||||||
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
fitness for any purpose. The Contributing Authors and Group 42, Inc.
|
||||||
assume no liability for damages, direct or consequential, which may
|
assume no liability for direct, indirect, incidental, special, exemplary,
|
||||||
result from the use of the PNG Reference Library.
|
or consequential damages, which may result from the use of the PNG
|
||||||
|
Reference Library, even if advised of the possibility of such damage.
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute this
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
source code, or portions hereof, for any purpose, without fee, subject
|
source code, or portions hereof, for any purpose, without fee, subject
|
||||||
to the following restrictions:
|
to the following restrictions:
|
||||||
1. The origin of this source code must not be misrepresented.
|
1. The origin of this source code must not be misrepresented.
|
||||||
2. Altered versions must be plainly marked as such and must not be
|
2. Altered versions must be plainly marked as such and must not be
|
||||||
misrepresented as being the original source.
|
misrepresented as being the original source.
|
||||||
3. This Copyright notice may not be removed or altered from any source or
|
3. This Copyright notice may not be removed or altered from any source or
|
||||||
altered source distribution.
|
altered source distribution.
|
||||||
|
|
||||||
The Contributing Authors and Group 42, Inc. specifically permit, without
|
The Contributing Authors and Group 42, Inc. specifically permit, without
|
||||||
fee, and encourage the use of this source code as a component to
|
fee, and encourage the use of this source code as a component to
|
||||||
@ -763,7 +765,7 @@ extern void * png_realloc PNGARG((png_structp png_ptr, void * ptr,
|
|||||||
extern void png_free PNGARG((png_structp png_ptr, void * ptr));
|
extern void png_free PNGARG((png_structp png_ptr, void * ptr));
|
||||||
|
|
||||||
/* allocate memory for an internal libpng struct */
|
/* allocate memory for an internal libpng struct */
|
||||||
extern voidp png_create_struct PNGARG((uInt type));
|
extern png_voidp png_create_struct PNGARG((uInt type));
|
||||||
|
|
||||||
/* free memory from internal libpng struct */
|
/* free memory from internal libpng struct */
|
||||||
extern void png_destroy_struct PNGARG((voidp struct_ptr));
|
extern void png_destroy_struct PNGARG((voidp struct_ptr));
|
||||||
|
2
pngmem.c
2
pngmem.c
@ -221,7 +221,7 @@ png_create_struct(uInt type)
|
|||||||
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)
|
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)
|
||||||
#else
|
#else
|
||||||
# if defined(_MSC_VER) && defined(MAXSEG_64K)
|
# if defined(_MSC_VER) && defined(MAXSEG_64K)
|
||||||
if ((struct_ptr = (png_voidp)halloc(size)) != NULL)
|
if ((struct_ptr = (png_voidp)halloc(size,1)) != NULL)
|
||||||
# else
|
# else
|
||||||
if ((struct_ptr = (png_voidp)malloc(size)) != NULL)
|
if ((struct_ptr = (png_voidp)malloc(size)) != NULL)
|
||||||
# endif
|
# endif
|
||||||
|
BIN
pngtest.png
BIN
pngtest.png
Binary file not shown.
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.3 KiB |
@ -8,8 +8,6 @@ for 0.9
|
|||||||
|
|
||||||
after 1.0
|
after 1.0
|
||||||
overlaying one image on top of another
|
overlaying one image on top of another
|
||||||
make pull reader use push reader internally to reduce code, and
|
|
||||||
increase amount of image read in an error situation
|
|
||||||
optional palette creation
|
optional palette creation
|
||||||
histogram creation
|
histogram creation
|
||||||
text conversion between different code types
|
text conversion between different code types
|
||||||
|
10
pngwrite.c
10
pngwrite.c
@ -409,16 +409,6 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
|||||||
|
|
||||||
/* find a filter if necessary, filter the row and write it out */
|
/* find a filter if necessary, filter the row and write it out */
|
||||||
png_write_find_filter(png_ptr, &(png_ptr->row_info));
|
png_write_find_filter(png_ptr, &(png_ptr->row_info));
|
||||||
|
|
||||||
/* trade current and prev rows so next filter references are correct */
|
|
||||||
if (png_ptr->prev_row)
|
|
||||||
{
|
|
||||||
png_bytep tptr;
|
|
||||||
|
|
||||||
tptr = png_ptr->prev_row;
|
|
||||||
png_ptr->prev_row = png_ptr->row_buf;
|
|
||||||
png_ptr->row_buf = tptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
|
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
|
||||||
|
23
pngwutil.c
23
pngwutil.c
@ -912,6 +912,7 @@ png_write_finish_row(png_structp png_ptr)
|
|||||||
|
|
||||||
/* next row */
|
/* next row */
|
||||||
png_ptr->row_number++;
|
png_ptr->row_number++;
|
||||||
|
|
||||||
/* see if we are done */
|
/* see if we are done */
|
||||||
if (png_ptr->row_number < png_ptr->num_rows)
|
if (png_ptr->row_number < png_ptr->num_rows)
|
||||||
return;
|
return;
|
||||||
@ -947,13 +948,15 @@ png_write_finish_row(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* reset the row above the image for the next pass */
|
/* reset the row above the image for the next pass */
|
||||||
if (png_ptr->prev_row)
|
|
||||||
png_memset(png_ptr->prev_row, 0, (((png_uint_32)png_ptr->usr_channels *
|
|
||||||
(png_uint_32)png_ptr->usr_bit_depth * png_ptr->width + 7) >> 3) + 1);
|
|
||||||
|
|
||||||
/* if we have more data to get, go get it */
|
|
||||||
if (png_ptr->pass < 7)
|
if (png_ptr->pass < 7)
|
||||||
|
{
|
||||||
|
if (png_ptr->prev_row)
|
||||||
|
png_memset(png_ptr->prev_row, 0,
|
||||||
|
(((png_uint_32)png_ptr->usr_channels *
|
||||||
|
(png_uint_32)png_ptr->usr_bit_depth *
|
||||||
|
png_ptr->width + 7) >> 3) + 1);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we get here, we've just written the last row, so we need
|
/* if we get here, we've just written the last row, so we need
|
||||||
@ -1345,6 +1348,16 @@ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row)
|
|||||||
/* repeat until all data has been compressed */
|
/* repeat until all data has been compressed */
|
||||||
} while (png_ptr->zstream->avail_in);
|
} while (png_ptr->zstream->avail_in);
|
||||||
|
|
||||||
|
/* swap the current and previous rows */
|
||||||
|
if (png_ptr->prev_row)
|
||||||
|
{
|
||||||
|
png_bytep tptr;
|
||||||
|
|
||||||
|
tptr = png_ptr->prev_row;
|
||||||
|
png_ptr->prev_row = png_ptr->row_buf;
|
||||||
|
png_ptr->row_buf = tptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* finish row - updates counters and flushes zlib if last row */
|
/* finish row - updates counters and flushes zlib if last row */
|
||||||
png_write_finish_row(png_ptr);
|
png_write_finish_row(png_ptr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user