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 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

View File

@ -1,3 +1,4 @@
# makefile for libpng on Acorn RISCOS
# Project: libpng # 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. # 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

24
png.h
View File

@ -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,8 +34,9 @@
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
@ -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));

View File

@ -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

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 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

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

View File

@ -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,14 +948,16 @@ 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
to flush the compressor */ to flush the compressor */
@ -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);