Fixed point APIs are now supported throughout (no missing APIs).
  Internal fixed point arithmetic support exists for all internal floating
    point operations.
  sCAL validates the floating point strings it is passed.
  Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2
  Two new APIs exist to get the number of passes without turning on the
    PNG_INTERLACE transform and to get the number of rows in the current
    pass.
  A new test program, pngvalid.c, validates the gamma code.
  Errors in the 16 bit gamma correction (overflows) have been corrected.
  cHRM chunk testing is done consistently (previously the floating point
    API bypassed it, because the test really didn't work on FP, now the test
    is performed on the actual values to be stored in the PNG file so it
    works in the FP case too.)
  Most floating point APIs now simply call the fixed point APIs after
    converting the values to the fixed point form used in the PNG file.
  The standard headers no longer include zlib.h, which is currently only
    required for pngstruct.h and can therefore be internal.
  (Patches by John Bowler)
This commit is contained in:
Glenn Randers-Pehrson
2010-07-29 17:39:14 -05:00
parent d7aa6aa916
commit 31aee0d0c0
44 changed files with 4989 additions and 1723 deletions

View File

@@ -1,5 +1,5 @@
Makefiles for libpng version 1.5.0beta36 - July 24, 2010
Makefiles for libpng version 1.5.0beta36 - July 29, 2010
pnglibconf.h => Stores configuration settings
makefile.linux => Linux/ELF makefile

View File

@@ -1,5 +1,5 @@
# DJGPP (DOS gcc) makefile for libpng
# Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson
# Copyright (C) 2002, 2006, 2009-2010 Glenn Randers-Pehrson
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
#
# This code is released under the libpng license.

View File

@@ -50,8 +50,14 @@ OBJS3=pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
all: test
# see scripts/pnglibconf.mak for more options
# to support watcom calling conventions it is necessary to set PNG_API_RULE to 2
# in pnglibconf.h - copy scripts/pnglibconf.h, delete the first line and change
# the definition of PNG_API_RULE from 0 to 2.
#
# If you know how to do this with the Watcom build system please supply a patch
# for this makefile to the PNG implementation list.
pnglibconf.h: scripts/pnglibconf.h
cp scripts/pnglibconf.h $@
@echo please copy scripts/pnglibconf.h and change PNG_API_RULE to 2
png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
$(CC) $(CFLAGS) $*.c $(ERRFILE)

View File

@@ -1,7 +1,7 @@
#!/bin/awk -f
# scripts/options.awk - library build configuration control
#
# last changed in libpng version 1.5.0 - July 24, 2010
# last changed in libpng version 1.5.0 - July 29, 2010
#
# Copyright (c) 1998-2010 Glenn Randers-Pehrson
#

View File

@@ -6,7 +6,7 @@
#
com pnglibconf.h - library build configuration
com
com libpng version PNGLIB_VERSION - last changed on July 24, 2010
com libpng version PNGLIB_VERSION - last changed on July 29, 2010
com
com Copyright (c) 1998-2010 Glenn Randers-Pehrson
com
@@ -134,6 +134,17 @@ logunsupported = 1
@# include "pngusr.h"
@#endif
# This is a special fixup for the Watcom C compiler on Windows, which has
# multiple procedure call standards. Unless PNG_API_RULE is set explicitly
# (i.e. if it is not defined at this point) it will be forced to '2' here when
# using Watcom. This indicates to the other header files that Watcom behaviour
# is required where appropriate.
@#ifdef __WATCOMC__
@# ifndef PNG_API_RULE
@# define PNG_API_RULE 2 /* Use Watcom calling conventions */
@# endif
@#endif
# Note that PNG_USR_CONFIG only has an effect when building
# pnglibconf.h
setting USER_CONFIG requires USER_PRIVATEBUILD USER_DLLFNAME_POSTFIX
@@ -166,8 +177,14 @@ option WRITE_INT_FUNCTIONS disabled
option WRITE enables WRITE_INT_FUNCTIONS
# Generic options - affect both read and write.
option WARNINGS
option BENIGN_ERRORS
option MNG_FEATURES
# Arithmetic options, the first is the big switch that chooses between internal
# floating and fixed point arithmetic implementations - it does not affect any
# APIs. The second two (the _POINT settings) switch off individual APIs.
option FLOATING_ARITHMETIC
option FLOATING_POINT enables ok_math
option FIXED_POINT enables ok_math
@@ -287,8 +304,8 @@ option SEQUENTIAL_READ requires READ
option READ_COMPOSITE_NODIV requires READ
= NO_READ_COMPOSITE_NODIV PNG_NO_READ_COMPOSITED_NODIV
# Inch conversions: not switched on by default
option INCH_CONVERSIONS requires FLOATING_POINT
# Inch conversions
option INCH_CONVERSIONS
= INCH_CONVERSIONS PNG_INCH_CONVERSIONS
# IN DEVELOPMENT
@@ -319,6 +336,8 @@ option WRITE_USER_TRANSFORM requires WRITE_TRANSFORMS
# trouble if left undefined
option WRITE_INTERLACING requires WRITE
# The following depends, internally, on WEIGHT_SHIFT and COST_SHIFT
# where are set below.
option WRITE_WEIGHTED_FILTER requires WRITE FLOATING_POINT
option WRITE_FLUSH requires WRITE
@@ -349,6 +368,81 @@ option WRITE_ANCILLARY_CHUNKS requires WRITE
option READ_TEXT requires READ_ANCILLARY_CHUNKS enables TEXT
option WRITE_TEXT requires WRITE_ANCILLARY_CHUNKS enables TEXT
# Moved to pnglibconf.h at libpng-1.5.0
# Feature support: in 1.4 this was in pngconf.h, but the following
# features have no affect on the libpng API. Add library
# only features to the end of this list. Add features that
# affect the API above. (Note: the list of chunks follows
# the library-only settings.)
#
# BUILD TIME ONLY OPTIONS
# These options do not affect the API but rather alter how the
# API is implemented, they get recorded in pnglibconf.h, but
# can't be changed by the application.
# Check the correctness of cHRM chunks
option CHECK_cHRM requires cHRM
#
# Artificially align memory - the code typically aligns to 8 byte
# boundaries if this is switched on, it's a small waste of space
# but can help (in theory) on some architectures. Only affects
# internal structures. Added at libpng 1.4.0
option ALIGN_MEMORY
# Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING
# See png[wr]util.c, normally this should always be *on*
option POINTER_INDEXING
# Other defines for things like memory and the like can go here.
# BUILD TIME SETTINGS
# Like build time options these do not affect the API, but they
# may be useful to applications because they record details of
# how the API will behave particularly with regard to overall
# accuracy.
# This controls how fine the quantizing gets. As this allocates
# a largish chunk of memory (32K), those who are not as concerned
# with quantizing quality can decrease some or all of these.
setting QUANTIZE_RED_BITS default 5
setting QUANTIZE_GREEN_BITS default 5
setting QUANTIZE_BLUE_BITS default 5
# This controls how fine the gamma correction becomes when you
# are only interested in 8 bits anyway. Increasing this value
# results in more memory being used, and more pow() functions
# being called to fill in the gamma tables. Don't set this value
# less then 8, and even that may not work (I haven't tested it).
setting MAX_GAMMA_8 default 11
# This controls how much a difference in gamma we can tolerate before
# we actually start doing gamma conversion, it's a fixed point value,
# so the default below is 0.05, meaning libpng ignores corrections in
# the range 0.95 to 1.05
setting GAMMA_THRESHOLD_FIXED default 5000
# Scaling factor for filter heuristic weighting calculations
setting WEIGHT_SHIFT default 8
setting COST_SHIFT default 3
# Precision to use when converting a floating point value to a PNG
# extension format string in an sCAL chunk (only relevant if the
# floating point API is enabled)
setting sCAL_PRECISION default 5
# This is the size of the compression buffer, and thus the size of
# an IDAT chunk. Make this whatever size you feel is best for your
# machine. One of these will be allocated per png_struct. When this
# is full, it writes the data to the disk, and does some other
# calculations. Making this an extremely small size may slow
# the library down, but you may want to experiment to determine
# where it becomes significant, if you are concerned with memory
# usage. Note that zlib allocates at least 32Kb also. For readers,
# this describes the size of the buffer available to read the data in.
# Unless this gets smaller than the size of a row (compressed),
# it should not make much difference how big this is.
setting ZBUF_SIZE default 8192
# Ancillary chunks
chunk bKGD
chunk cHRM
@@ -389,13 +483,8 @@ option WRITE_UNKNOWN_CHUNKS requires WRITE
option HANDLE_AS_UNKNOWN
option GET_INT_32 requires READ
# png_get_int_32 is required by the ancillary chunks oFFs and pCAL
option READ_oFFs enables GET_INT_32
option READ_pCAL enables GET_INT_32
option SAVE_INT_32 requires WRITE
# Likewise for png_save_int_32
# png_save_int_32 is required by the ancillary chunks oFFs and pCAL
option WRITE_oFFs enables SAVE_INT_32
option WRITE_pCAL enables SAVE_INT_32

View File

@@ -1,7 +1,7 @@
/* libpng-1.5.0beta36 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
/* last changed in libpng version 1.5.0 - July 24, 2010 */
/* last changed in libpng version 1.5.0 - July 29, 2010 */
/* Copyright (c) 1998-2010 Glenn Randers-Pehrson */
@@ -15,20 +15,33 @@
#ifndef PNGLCONF_H
#define PNGLCONF_H
/* settings */
#define PNG_MAX_GAMMA_8 11
#define PNG_CALLOC_SUPPORTED
#define PNG_QUANTIZE_RED_BITS 5
#define PNG_USER_WIDTH_MAX 1000000L
#define PNG_QUANTIZE_GREEN_BITS 5
#define PNG_API_RULE 0
#define PNG_QUANTIZE_BLUE_BITS 5
#define PNG_USER_CHUNK_CACHE_MAX 0
#define PNG_USER_HEIGHT_MAX 1000000L
#define PNG_sCAL_PRECISION 5
#define PNG_COST_SHIFT 3
#define PNG_WEIGHT_SHIFT 8
#define PNG_USER_CHUNK_MALLOC_MAX 0
#define PNG_DEFAULT_READ_MACROS 1
#define PNG_ZBUF_SIZE 8192
#define PNG_GAMMA_THRESHOLD_FIXED 5000
/* end of settings */
/* options */
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
#define PNG_WARNINGS_SUPPORTED
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
#define PNG_WRITE_SUPPORTED
#define PNG_WRITE_INTERLACING_SUPPORTED
#define PNG_EASY_ACCESS_SUPPORTED
#define PNG_ALIGN_MEMORY_SUPPORTED
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_USER_LIMITS_SUPPORTED
#define PNG_FIXED_POINT_SUPPORTED
@@ -112,7 +125,6 @@
#define PNG_WRITE_BGR_SUPPORTED
#define PNG_USER_CHUNKS_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_GET_INT_32_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED
#define PNG_WRITE_bKGD_SUPPORTED
@@ -144,6 +156,7 @@
#define PNG_READ_zTXt_SUPPORTED
#define PNG_gAMA_SUPPORTED
#define PNG_pCAL_SUPPORTED
#define PNG_CHECK_cHRM_SUPPORTED
#define PNG_tIME_SUPPORTED
#define PNG_pHYs_SUPPORTED
#define PNG_READ_iTXt_SUPPORTED

View File

@@ -217,3 +217,13 @@ EXPORTS
png_save_uint_32 @205
png_save_int_32 @206
png_save_uint_16 @207
png_set_gamma_fixed @208
png_set_filter_heuristics_fixed @209
png_get_pixel_aspect_ratio_fixed @210
png_get_x_offset_inches_fixed @211
png_get_y_offset_inches_fixed @212
png_set_sCAL_fixed @213
png_get_sCAL_fixed @214
png_get_num_passes @215
png_get_num_rows @216
png_set_background_fixed @217

View File

@@ -1,7 +1,7 @@
/* pngwin.dfn - define format of pngwin.def
*
* Last changed in libpng version 1.5.0 [July 24, 2010]
* Last changed in libpng version 1.5.0 [July 29, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
*
* This code is released under the libpng license.

View File

@@ -1,7 +1,7 @@
/* sym.dfn - define format of libpng.sym
*
* Last changed in libpng version 1.5.0 [July 24, 2010]
* Last changed in libpng version 1.5.0 [July 29, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
*
* This code is released under the libpng license.

View File

@@ -213,3 +213,13 @@ EXPORTS
png_save_uint_32 @205
png_save_int_32 @206
png_save_uint_16 @207
png_set_gamma_fixed @208
png_set_filter_heuristics_fixed @209
png_get_pixel_aspect_ratio_fixed @210
png_get_x_offset_inches_fixed @211
png_get_y_offset_inches_fixed @212
png_set_sCAL_fixed @213
png_get_sCAL_fixed @214
png_get_num_passes @215
png_get_num_rows @216
png_set_background_fixed @217

View File

@@ -1,7 +1,7 @@
/* symbols.dfn - find all exported symbols
*
* Last changed in libpng version 1.5.0 [July 24, 2010]
* Last changed in libpng version 1.5.0 [July 29, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
*
* This code is released under the libpng license.

View File

@@ -1,7 +1,7 @@
/* vers.dfn - define format of libpng.vers
*
* Last changed in libpng version 1.5.0 [July 24, 2010]
* Last changed in libpng version 1.5.0 [July 29, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
*
* This code is released under the libpng license.