diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2011-10-06 21:37:47 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2011-10-06 21:37:47 -0500 |
commit | 4daae301744199a01f2c506a239b8d20576e6b37 (patch) | |
tree | 31b1bedf941ecd70ecbe9fa5aad911ff7149daa6 /example.c | |
parent | d5bc89ef11cc5e857c312076dfa2d744519d6099 (diff) | |
download | libpng-4daae301744199a01f2c506a239b8d20576e6b37.tar.gz |
[libpng15] #ifdef out png_progressive_combine_row() when interlacing is
not supported.
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2,7 +2,7 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.6 [(PENDING RELEASE)] * This file has been placed in the public domain by the authors. * Maintained 1998-2011 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) @@ -341,11 +341,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ /* Add filler (or alpha) byte (before/after each RGB triplet) */ png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Turn on interlace handling. REQUIRED if you are not using * png_read_image(). To see how to handle interlacing passes, * see the png_read_row() method below: */ number_passes = png_set_interlace_handling(png_ptr); +#else + number_passes = 1; +#endif /* PNG_READ_INTERLACING_SUPPORTED */ + /* Optional call to gamma correct and add the background to the palette * and update info structure. REQUIRED if you are expecting libpng to @@ -527,6 +532,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, */ png_bytep old_row = ((png_bytep *)our_data)[row_num]; +#ifdef PNG_READ_INTERLACING_SUPPORTED /* If both rows are allocated then copy the new row * data to the corresponding row data. */ @@ -555,6 +561,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, * to pass the current row as new_row, and the function will combine * the old row and the new row. */ +#endif /* PNG_READ_INTERLACING_SUPPORTED */ } end_callback(png_structp png_ptr, png_infop info) |