mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Revised png_get_int_16() to be similar to png_get_int_32().
This commit is contained in:
parent
4009a76e97
commit
48dc6ebf5c
1
ANNOUNCE
1
ANNOUNCE
@ -321,6 +321,7 @@ version 1.5.0beta38 [July 31, 2010]
|
|||||||
safe but uncast assignments to shorter integers. Also added a zlib
|
safe but uncast assignments to shorter integers. Also added a zlib
|
||||||
VStudio release library project because the latest zlib Official Windows
|
VStudio release library project because the latest zlib Official Windows
|
||||||
build does not include such a thing.
|
build does not include such a thing.
|
||||||
|
Revised png_get_int_16() to be similar to png_get_int_32().
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
1
CHANGES
1
CHANGES
@ -2803,6 +2803,7 @@ version 1.5.0beta38 [July 31, 2010]
|
|||||||
safe but uncast assignments to shorter integers. Also added a zlib
|
safe but uncast assignments to shorter integers. Also added a zlib
|
||||||
VStudio release library project because the latest zlib Official Windows
|
VStudio release library project because the latest zlib Official Windows
|
||||||
build does not include such a thing.
|
build does not include such a thing.
|
||||||
|
Revised png_get_int_16() to be similar to png_get_int_32().
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
23
png.h
23
png.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.5.0beta38 - July 30, 2010
|
* libpng version 1.5.0beta38 - July 31, 2010
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@ -11,7 +11,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.5.0beta38 - July 30, 2010: Glenn
|
* libpng versions 0.97, January 1998, through 1.5.0beta38 - July 31, 2010: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -172,7 +172,7 @@
|
|||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
*
|
*
|
||||||
* libpng versions 1.2.6, August 15, 2004, through 1.5.0beta38, July 30, 2010, are
|
* libpng versions 1.2.6, August 15, 2004, through 1.5.0beta38, July 31, 2010, are
|
||||||
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individual added to the list of Contributing Authors:
|
* with the following individual added to the list of Contributing Authors:
|
||||||
@ -284,7 +284,7 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* July 30, 2010
|
* July 31, 2010
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
@ -348,7 +348,7 @@
|
|||||||
/* 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.5.0beta38"
|
#define PNG_LIBPNG_VER_STRING "1.5.0beta38"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.5.0beta38 - July 30, 2010\n"
|
" libpng version 1.5.0beta38 - July 31, 2010\n"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 15
|
#define PNG_LIBPNG_VER_SONUM 15
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 15
|
#define PNG_LIBPNG_VER_DLLNUM 15
|
||||||
@ -1295,11 +1295,9 @@ PNG_EXPORT(void,png_set_filter,(png_structp png_ptr, int method, int filters),,
|
|||||||
PNG_FP_EXPORT(void,png_set_filter_heuristics,(png_structp png_ptr,
|
PNG_FP_EXPORT(void,png_set_filter_heuristics,(png_structp png_ptr,
|
||||||
int heuristic_method, int num_weights, png_doublep filter_weights,
|
int heuristic_method, int num_weights, png_doublep filter_weights,
|
||||||
png_doublep filter_costs),,68);
|
png_doublep filter_costs),,68);
|
||||||
#if 0 /* TO DO */
|
|
||||||
PNG_FIXED_EXPORT(void,png_set_filter_heuristics_fixed,(png_structp png_ptr,
|
PNG_FIXED_EXPORT(void,png_set_filter_heuristics_fixed,(png_structp png_ptr,
|
||||||
int heuristic_method, int num_weights, png_fixed_point_p filter_weights,
|
int heuristic_method, int num_weights, png_fixed_point_p filter_weights,
|
||||||
png_fixed_point_p filter_costs),,209);
|
png_fixed_point_p filter_costs),,209);
|
||||||
#endif
|
|
||||||
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
|
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
|
||||||
|
|
||||||
/* Heuristic used for row filter selection. These defines should NOT be
|
/* Heuristic used for row filter selection. These defines should NOT be
|
||||||
@ -1607,10 +1605,8 @@ PNG_EXPORT(png_uint_32,png_get_y_pixels_per_meter,(png_structp png_ptr,
|
|||||||
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
|
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
|
||||||
PNG_FP_EXPORT(float,png_get_pixel_aspect_ratio,(png_structp png_ptr,
|
PNG_FP_EXPORT(float,png_get_pixel_aspect_ratio,(png_structp png_ptr,
|
||||||
png_infop info_ptr),,125);
|
png_infop info_ptr),,125);
|
||||||
#if 0 /* TO DO */
|
|
||||||
PNG_FIXED_EXPORT(png_fixed_point,png_get_pixel_aspect_ratio_fixed,
|
PNG_FIXED_EXPORT(png_fixed_point,png_get_pixel_aspect_ratio_fixed,
|
||||||
(png_structp png_ptr, png_infop info_ptr),,210);
|
(png_structp png_ptr, png_infop info_ptr),,210);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
|
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
|
||||||
PNG_EXPORT(png_int_32,png_get_x_offset_pixels,(png_structp png_ptr,
|
PNG_EXPORT(png_int_32,png_get_x_offset_pixels,(png_structp png_ptr,
|
||||||
@ -1820,19 +1816,24 @@ PNG_EXPORT(void,png_set_tRNS,(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#ifdef PNG_sCAL_SUPPORTED
|
#ifdef PNG_sCAL_SUPPORTED
|
||||||
PNG_FP_EXPORT(png_uint_32,png_get_sCAL,(png_structp png_ptr, png_infop info_ptr,
|
PNG_FP_EXPORT(png_uint_32,png_get_sCAL,(png_structp png_ptr, png_infop info_ptr,
|
||||||
int *unit, double *width, double *height),,168);
|
int *unit, double *width, double *height),,168);
|
||||||
|
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||||
|
/* NOTE: this API is currently implemented using floating point arithmetic,
|
||||||
|
* consequently it can only be used on systems with floating point support.
|
||||||
|
* In any case the range of values supported by png_fixed_point is small and it
|
||||||
|
* is highly recommended that png_get_sCAL_s be used instead.
|
||||||
|
*/
|
||||||
PNG_FIXED_EXPORT(png_uint_32,png_get_sCAL_fixed,(png_structp png_ptr,
|
PNG_FIXED_EXPORT(png_uint_32,png_get_sCAL_fixed,(png_structp png_ptr,
|
||||||
png_infop info_ptr, int *unit, png_fixed_point *width,
|
png_infop info_ptr, int *unit, png_fixed_point *width,
|
||||||
png_fixed_point *height),,214);
|
png_fixed_point *height),,214);
|
||||||
|
#endif
|
||||||
PNG_EXPORT(png_uint_32,png_get_sCAL_s,(png_structp png_ptr,
|
PNG_EXPORT(png_uint_32,png_get_sCAL_s,(png_structp png_ptr,
|
||||||
png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight),,169);
|
png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight),,169);
|
||||||
|
|
||||||
PNG_FP_EXPORT(void,png_set_sCAL,(png_structp png_ptr, png_infop info_ptr,
|
PNG_FP_EXPORT(void,png_set_sCAL,(png_structp png_ptr, png_infop info_ptr,
|
||||||
int unit, double width, double height),,170);
|
int unit, double width, double height),,170);
|
||||||
#if 0 /* TO DO */
|
|
||||||
PNG_FIXED_EXPORT(void,png_set_sCAL_fixed,(png_structp png_ptr,
|
PNG_FIXED_EXPORT(void,png_set_sCAL_fixed,(png_structp png_ptr,
|
||||||
png_infop info_ptr, int unit, png_fixed_point width,
|
png_infop info_ptr, int unit, png_fixed_point width,
|
||||||
png_fixed_point height), ,213);
|
png_fixed_point height), ,213);
|
||||||
#endif
|
|
||||||
PNG_EXPORT(void,png_set_sCAL_s,(png_structp png_ptr, png_infop info_ptr,
|
PNG_EXPORT(void,png_set_sCAL_s,(png_structp png_ptr, png_infop info_ptr,
|
||||||
int unit, png_charp swidth, png_charp sheight),,171);
|
int unit, png_charp swidth, png_charp sheight),,171);
|
||||||
#endif /* PNG_sCAL_SUPPORTED */
|
#endif /* PNG_sCAL_SUPPORTED */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.5.0beta38 - July 30, 2010
|
* libpng version 1.5.0beta38 - July 31, 2010
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* Last changed in libpng version 1.5.0 - July 30, 2010
|
* Last changed in libpng version 1.5.0 - July 31, 2010
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* Last changed in libpng version 1.5.0 - July 30, 2010
|
* Last changed in libpng version 1.5.0 - July 31, 2010
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
|
23
pngpriv.h
23
pngpriv.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngpriv.h - private declarations for use inside libpng
|
/* pngpriv.h - private declarations for use inside libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.5.0beta38 - July 30, 2010
|
* libpng version 1.5.0beta38 - July 31, 2010
|
||||||
* 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) 1998-2010 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -87,7 +87,7 @@
|
|||||||
#ifndef PNG_ERROR_TEXT_SUPPORTED
|
#ifndef PNG_ERROR_TEXT_SUPPORTED
|
||||||
# define png_error(s1,s2) png_err(s1)
|
# define png_error(s1,s2) png_err(s1)
|
||||||
# define png_chunk_error(s1,s2) png_err(s1)
|
# define png_chunk_error(s1,s2) png_err(s1)
|
||||||
# define png_fixed_error(s1,s2,s3) png_err(s1)
|
# define png_fixed_error(s1,s2) png_err(s1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PNG_EXTERN
|
#ifndef PNG_EXTERN
|
||||||
@ -392,7 +392,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
|
#ifdef PNG_FIXED_POINT_MACRO_SUPPORTED
|
||||||
#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
|
#define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\
|
||||||
((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s, fp),0))
|
((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0))
|
||||||
#else
|
#else
|
||||||
PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
|
PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp,
|
||||||
png_const_charp text));
|
png_const_charp text));
|
||||||
@ -1029,22 +1029,30 @@ PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr, png_voidp ptr,
|
|||||||
|
|
||||||
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
|
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
|
||||||
PNG_EXTERN void png_fixed_error PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_fixed_error PNGARG((png_structp png_ptr,
|
||||||
png_const_charp name, double value));
|
png_const_charp name)) PNG_NORETURN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ASCII to FP interfaces, currently only implemented if sCAL
|
/* ASCII to FP interfaces, currently only implemented if sCAL
|
||||||
* support is required.
|
* support is required.
|
||||||
*/
|
*/
|
||||||
#if defined(PNG_READ_sCAL_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
#if defined(PNG_READ_sCAL_SUPPORTED)
|
||||||
/* MAX_DIGITS is actually the maximum number of characters in an sCAL
|
/* MAX_DIGITS is actually the maximum number of characters in an sCAL
|
||||||
* width or height, derived from the precision (number of significant
|
* width or height, derived from the precision (number of significant
|
||||||
* digits - a build time settable option) and assumpitions about the
|
* digits - a build time settable option) and assumpitions about the
|
||||||
* maximum ridiculous exponent.
|
* maximum ridiculous exponent.
|
||||||
*/
|
*/
|
||||||
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
|
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
|
||||||
|
|
||||||
|
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||||
PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
|
PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
|
||||||
png_size_t size, double fp, unsigned precision));
|
png_size_t size, double fp, unsigned precision));
|
||||||
#endif /* READ_sCAL && FLOATING_POINT */
|
#endif /* FLOATING_POINT */
|
||||||
|
|
||||||
|
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||||
|
PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr,
|
||||||
|
png_charp ascii, png_size_t size, png_fixed_point fp));
|
||||||
|
#endif /* FIXED_POINT */
|
||||||
|
#endif /* READ_sCAL */
|
||||||
|
|
||||||
#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
|
#if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED)
|
||||||
/* An internal API to validate the format of a floating point number.
|
/* An internal API to validate the format of a floating point number.
|
||||||
@ -1119,7 +1127,8 @@ PNG_EXTERN int png_check_fp_number PNGARG((png_charp string, png_size_t size,
|
|||||||
PNG_EXTERN int png_check_fp_string PNGARG((png_charp string, png_size_t size));
|
PNG_EXTERN int png_check_fp_string PNGARG((png_charp string, png_size_t size));
|
||||||
#endif /* pCAL || sCAL */
|
#endif /* pCAL || sCAL */
|
||||||
|
|
||||||
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
|
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
|
||||||
|
defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED)
|
||||||
/* Added at libpng version 1.5.0 */
|
/* Added at libpng version 1.5.0 */
|
||||||
/* This is a utility to provide a*times/div (rounded) and indicate
|
/* This is a utility to provide a*times/div (rounded) and indicate
|
||||||
* if there is an overflow. The result is a boolean - false (0)
|
* if there is an overflow. The result is a boolean - false (0)
|
||||||
|
@ -88,8 +88,9 @@ png_get_int_32)(png_bytep buf)
|
|||||||
png_uint_16 (PNGAPI
|
png_uint_16 (PNGAPI
|
||||||
png_get_uint_16)(png_bytep buf)
|
png_get_uint_16)(png_bytep buf)
|
||||||
{
|
{
|
||||||
png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) +
|
png_uint_16 i =
|
||||||
(png_uint_16)(*(buf + 1)));
|
((png_uint_32)(*buf) << 8) +
|
||||||
|
((png_uint_32)(*(buf + 1)));
|
||||||
|
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* Last changed in libpng version 1.5.0 - July 30, 2010
|
* Last changed in libpng version 1.5.0 - July 31, 2010
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user