Imported from libpng-0.89c.tar

This commit is contained in:
Guy Schalnat 1996-06-17 16:24:45 -05:00 committed by Glenn Randers-Pehrson
parent e5a37797b4
commit c21f90c334
9 changed files with 37 additions and 33 deletions

View File

@ -13,7 +13,7 @@ RANLIB=echo
prefix=/usr/local
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
all: libpng.a pngtest

View File

@ -1,3 +1,4 @@
# makefile for libpng on Acorn RISCOS
# Project: libpng

View File

@ -1,4 +1,4 @@
# gcc/DOS makefile for libpng
# DJGPP (DOS gcc) makefile for libpng
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h

28
png.h
View File

@ -5,15 +5,16 @@
May 25, 1996
Note: This is a beta version. It reads and writes valid files
on the platforms I have, but it has had limited portability
testing. Furthermore, you may have to modify the
includes below to get it to work on your system, and you
may have to supply the correct compiler flags in the makefile.
Read the readme.txt for more information, and how to contact
me if you have any problems, or if you want your compiler/
platform to be supported in the next official libpng release.
on the platforms I have, and has had a wide testing program.
You may have to modify the includes below to get it to work on
your system, and you may have to supply the correct compiler
flags in the makefile, if you can't find a makefile suitable for
your operating system/compiler combination. Read the libpng.txt
for more information, and how to contact me if you have any
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.
Contributing Authors:
@ -33,17 +34,18 @@
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for damages, direct or consequential, which may
result from the use of the PNG Reference Library.
assume no liability for direct, indirect, incidental, special, exemplary,
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
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
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
altered source distribution.
altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
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));
/* 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 */
extern void png_destroy_struct PNGARG((voidp struct_ptr));

View File

@ -221,7 +221,7 @@ png_create_struct(uInt type)
if ((struct_ptr = (png_voidp)farmalloc(size)) != NULL)
#else
# 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
if ((struct_ptr = (png_voidp)malloc(size)) != NULL)
# endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -8,8 +8,6 @@ for 0.9
after 1.0
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
histogram creation
text conversion between different code types

View File

@ -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 */
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)

View File

@ -912,6 +912,7 @@ png_write_finish_row(png_structp png_ptr)
/* next row */
png_ptr->row_number++;
/* see if we are done */
if (png_ptr->row_number < png_ptr->num_rows)
return;
@ -947,13 +948,15 @@ png_write_finish_row(png_structp png_ptr)
}
/* 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->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;
}
}
/* 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 */
} 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 */
png_write_finish_row(png_ptr);