[libpng15] Revised example.c to illustrate use of PNG_DEFAULT_sRGB and

PNG_GAMMA_MAC_18 as parameters for png_set_gamma().  These have been available
since libpng-1.5.4.
This commit is contained in:
Glenn Randers-Pehrson
2013-06-25 18:50:55 -05:00
parent fb8831d19a
commit 67859c8fcb
3 changed files with 14 additions and 8 deletions

View File

@@ -259,9 +259,9 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* If we don't have another value */
else
{
screen_gamma = 2.2; /* A good guess for a PC monitor in a dimly
lit room */
screen_gamma = 1.7 or 1.0; /* A good guess for Mac systems */
screen_gamma = PNG_DEFAULT_sRGB; /* A good guess for a PC monitor
in a dimly lit room */
screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac systems */
}
/* Tell libpng to handle the gamma conversion for you. The final call
@@ -273,7 +273,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
int intent;
if (png_get_sRGB(png_ptr, info_ptr, &intent))
png_set_gamma(png_ptr, screen_gamma, 0.45455);
png_set_gamma(png_ptr, screen_gamma, PNG_DEFAULT_sRGB);
else
{
double image_gamma;