[master] Ported functions from libpng-1.4.0rc01:

png_calloc(), png_get_io_state(),
    png_get_io_chunk_name(), png_set_premultiply_alpha, and
    png_do_read_premultiply_alpha().
This commit is contained in:
Glenn Randers-Pehrson
2009-10-29 23:47:05 -05:00
parent bc2ab12f99
commit 4b14b35208
17 changed files with 626 additions and 48 deletions

View File

@@ -1506,11 +1506,6 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
{
if (png_ptr == NULL || info_ptr == NULL)
return;
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
/* Invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
png_set_invert_alpha(png_ptr);
#endif
/* Write the file header information. */
png_write_info(png_ptr, info_ptr);
@@ -1570,6 +1565,18 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
png_set_packswap(png_ptr);
#endif
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
/* Invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
png_set_invert_alpha(png_ptr);
#endif
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
/* Invert the alpha channel from opacity to transparency */
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
png_set_invert_alpha(png_ptr);
#endif
/* ----------------------- end of transformations ------------------- */
/* Write the bits */