[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/xfns.c
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/src/xfns.c |
Date: |
Sun, 25 May 2003 13:46:34 -0400 |
Index: emacs/src/xfns.c
diff -c emacs/src/xfns.c:1.581 emacs/src/xfns.c:1.582
*** emacs/src/xfns.c:1.581 Sat May 24 18:09:34 2003
--- emacs/src/xfns.c Sun May 25 13:46:34 2003
***************
*** 7579,7586 ****
png_byte channels;
png_uint_32 row_bytes;
int transparent_p;
! double screen_gamma, image_gamma;
! int intent;
struct png_memory_storage tbr; /* Data to be read */
/* Find out what file to load. */
--- 7579,7585 ----
png_byte channels;
png_uint_32 row_bytes;
int transparent_p;
! double screen_gamma;
struct png_memory_storage tbr; /* Data to be read */
/* Find out what file to load. */
***************
*** 7719,7737 ****
screen_gamma = (f->gamma ? 1 / f->gamma / 0.45455 : 2.2);
#if 0 /* Avoid double gamma correction for PNG images. */
! /* Tell the PNG lib to handle gamma correction for us. */
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
! if (png_get_sRGB (png_ptr, info_ptr, &intent))
! /* The libpng documentation says this is right in this case. */
! png_set_gamma (png_ptr, screen_gamma, 0.45455);
! else
#endif
! if (png_get_gAMA (png_ptr, info_ptr, &image_gamma))
! /* Image contains gamma information. */
! png_set_gamma (png_ptr, screen_gamma, image_gamma);
! else
! /* Use the standard default for the image gamma. */
! png_set_gamma (png_ptr, screen_gamma, 0.45455);
#endif /* if 0 */
/* Handle alpha channel by combining the image with a background
--- 7718,7739 ----
screen_gamma = (f->gamma ? 1 / f->gamma / 0.45455 : 2.2);
#if 0 /* Avoid double gamma correction for PNG images. */
! { /* Tell the PNG lib to handle gamma correction for us. */
! int intent;
! double image_gamma;
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
! if (png_get_sRGB (png_ptr, info_ptr, &intent))
! /* The libpng documentation says this is right in this case. */
! png_set_gamma (png_ptr, screen_gamma, 0.45455);
! else
#endif
! if (png_get_gAMA (png_ptr, info_ptr, &image_gamma))
! /* Image contains gamma information. */
! png_set_gamma (png_ptr, screen_gamma, image_gamma);
! else
! /* Use the standard default for the image gamma. */
! png_set_gamma (png_ptr, screen_gamma, 0.45455);
! }
#endif /* if 0 */
/* Handle alpha channel by combining the image with a background