[libpng16] Fix confusion between "adopted" and "adapted" in new comments.

Glenn thought the "adopted" were typos and changed them all to "adapted".
This reverts the spelling and adds parenthetical comments when each
word first appears in png.h.
This commit is contained in:
Glenn Randers-Pehrson 2012-09-04 20:16:25 -05:00
parent 329d033d25
commit 933bc842ac
2 changed files with 18 additions and 17 deletions

29
png.c
View File

@ -749,13 +749,13 @@ png_get_copyright(png_const_structrp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.6.0beta30 - September 4, 2012" PNG_STRING_NEWLINE \ "libpng version 1.6.0beta30 - September 5, 2012" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.6.0beta30 - September 4, 2012\ return "libpng version 1.6.0beta30 - September 5, 2012\
Copyright (c) 1998-2012 Glenn Randers-Pehrson\ Copyright (c) 1998-2012 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@ -1995,10 +1995,11 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
return profile_error(png_ptr, colorspace, name, temp, return profile_error(png_ptr, colorspace, name, temp,
"invalid signature"); "invalid signature");
/* Currently the PCS illuminant/adapted white point are required to be D50, /* Currently the PCS illuminant/adopted white point (the computational
* white point) are required to be D50,
* however the profile contains a record of the illuminant so perhaps ICC * however the profile contains a record of the illuminant so perhaps ICC
* expects to be able to change this in the future (despite the rationale in * expects to be able to change this in the future (despite the rationale in
* the introduction for using a fixed PCS adapted white.) Consequently the * the introduction for using a fixed PCS adopted white.) Consequently the
* following is just a warning. * following is just a warning.
*/ */
if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0) if (memcmp(profile+68, D50_nCIEXYZ, 12) != 0)
@ -2338,9 +2339,9 @@ png_invert_matrix(png_const_icc_matrixrp m, png_icc_matrixrp o)
static int static int
png_icc_find_wtpt(png_const_structrp png_ptr, png_const_charp name, png_icc_find_wtpt(png_const_structrp png_ptr, png_const_charp name,
png_const_bytep profile, png_icc_vectorrp adapted_white_point) png_const_bytep profile, png_icc_vectorrp adapted_white_point)
/* The mediaWhitePointTag contains an adapted white point expressed as XYZ /* The mediaWhitePointTag contains an adapted white point (the observer
* tristimulus values, it is always adapted to the PCS illuminant (but is XYZ * white point) expressed as XYZ tristimulus values. It is always adapted
* even when the PCS is PCSLAB encoded.) * to the PCS illuminant (but is XYZ even when the PCS is PCSLAB encoded.)
*/ */
{ {
png_uint_32 tag_length; png_uint_32 tag_length;
@ -2371,7 +2372,7 @@ png_icc_find_wtpt(png_const_structrp png_ptr, png_const_charp name,
temp == 0x73706163 /* 'spac' */) && temp == 0x73706163 /* 'spac' */) &&
memcmp(profile+68, tag+8, 12) != 0) memcmp(profile+68, tag+8, 12) != 0)
(void)profile_error(png_ptr, NULL, name, temp, (void)profile_error(png_ptr, NULL, name, temp,
"media white point differs from image adapted white"); "media white point differs from image adopted white");
(*adapted_white_point)[0] = png_get_int_32(tag+ 8); (*adapted_white_point)[0] = png_get_int_32(tag+ 8);
(*adapted_white_point)[1] = png_get_int_32(tag+12); (*adapted_white_point)[1] = png_get_int_32(tag+12);
@ -2437,10 +2438,10 @@ png_icc_find_chad(png_const_structrp png_ptr, png_const_charp name,
* colorant values. * colorant values.
* *
* All of the methods for determining the cHRM values depend on * All of the methods for determining the cHRM values depend on
* reversing the adaptatation to the PCS adapted white (D50); this is * reversing the adaptatation to the PCS adopted white (D50); this is
* because in all cases one or other PCS value has to be used. * because in all cases one or other PCS value has to be used.
* *
* This routine determines if 'chad' tag is present (if not the adapted white * This routine determines if 'chad' tag is present (if not the adopted white
* of the scene is D50 and no adaptation was performed) and returns the * of the scene is D50 and no adaptation was performed) and returns the
* inverted matrix. * inverted matrix.
*/ */
@ -2515,7 +2516,7 @@ png_icc_set_cHRM_from_chrm(png_const_structrp png_ptr,
* the PCS white, however the white point, which tells us the relative * the PCS white, however the white point, which tells us the relative
* intensity of the colorants, is not given. We can get the white point from * intensity of the colorants, is not given. We can get the white point from
* the mediaWhitePointTag value, which should be present in all profiles, * the mediaWhitePointTag value, which should be present in all profiles,
* however this is adapted to the PCS illuminated/adapted white, so must be * however this is adapted to the PCS illuminated/adopted white, so must be
* unadapted. * unadapted.
*/ */
{ {
@ -2593,7 +2594,7 @@ png_icc_set_cHRM_from_chrm(png_const_structrp png_ptr,
{ {
/* For the perfect reflector 'Y' shall be normalized /* For the perfect reflector 'Y' shall be normalized
* to 1,0 (see ICC 2010 4.14, XYZNumber), but this is * to 1,0 (see ICC 2010 4.14, XYZNumber), but this is
* the media white point (not the adapted white) * the media white point (not the adopted white)
* adapted to the PCS illuminant, so Y might be some * adapted to the PCS illuminant, so Y might be some
* other value, this sanity check is mainly to avoid * other value, this sanity check is mainly to avoid
* integer overflow. * integer overflow.
@ -2771,7 +2772,7 @@ png_icc_set_cHRM_from_endpoints(png_const_structrp png_ptr,
png_XYZ cHRM_XYZ; png_XYZ cHRM_XYZ;
/* Now we have colorant XYZ values in their unadapted form /* Now we have colorant XYZ values in their unadapted form
* (i.e. implicitly with an adapted white of the media). * (i.e. implicitly with an adopted white of the media).
* This is what PNG uses for cHRM, but they need to be * This is what PNG uses for cHRM, but they need to be
* converted to the libpng structure. * converted to the libpng structure.
* *
@ -3029,7 +3030,7 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace,
case 0x63686164: /* 'chad' - chromaticAdaptationTag */ case 0x63686164: /* 'chad' - chromaticAdaptationTag */
/* The tag must be a 9 element array of s15Fixed16ArrayType, the tag /* The tag must be a 9 element array of s15Fixed16ArrayType, the tag
* is optional, if absent it indicates that the original adapted * is optional, if absent it indicates that the original adapted
* white was the same as the PCS adapted white - D50. * white was the same as the PCS adopted white - D50.
*/ */
if (tag_length != 44) if (tag_length != 44)
(void)profile_error(png_ptr, NULL, name, tag_start, (void)profile_error(png_ptr, NULL, name, tag_start,

View File

@ -147,11 +147,11 @@ typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
/* The profile description and copyright must be present in all valid ICC /* The profile description and copyright must be present in all valid ICC
* profiles, however libpng does not use them so absence is just reported as * profiles, however libpng does not use them so absence is just reported as
* a warning. The media white point should be present too, but if it isn't * a warning. The media white point should be present too, but if it isn't
* all we lose is the ability to know if it differs from the adapted white * all we lose is the ability to know if it differs from the adopted white
* (i.e. the information that the device maxima are actually colored; * (i.e. the information that the device maxima are actually colored;
* a non-white substrate for a printer, or an uncorrected scan for example.) * a non-white substrate for a printer, or an uncorrected scan for example.)
* The chromaticAdaptationTag tells us that the adapted white of the original * The chromaticAdaptationTag tells us that the adopted white of the original
* differs from the PCS adapted white (which is identical to the PCS * differs from the PCS adopted white (which is identical to the PCS
* illuminant and should always be D50). * illuminant and should always be D50).
*/ */
# define PNG_ICC_profileDescriptionTag 0x00000010U /* required */ # define PNG_ICC_profileDescriptionTag 0x00000010U /* required */