diff options
author | Joseph Wen <josephwen@google.com> | 2010-08-20 10:42:22 +0800 |
---|---|---|
committer | Joseph Wen <josephwen@google.com> | 2010-09-09 14:34:59 +0800 |
commit | 4ce0ee15f268e0161438b4133936cb2826f7fd50 (patch) | |
tree | f0b3cdddc334160b246feb13d557503cb29cbe08 /pngrio.c | |
parent | 1c5f8c054976e6a55f07375508858044d7f4c6aa (diff) | |
download | external_libpng-4ce0ee15f268e0161438b4133936cb2826f7fd50.zip external_libpng-4ce0ee15f268e0161438b4133936cb2826f7fd50.tar.gz external_libpng-4ce0ee15f268e0161438b4133936cb2826f7fd50.tar.bz2 |
Add the feature of tile-based decoding to PNG.
There is a relevant patch to the change in zlib:
https://android-git.corp.google.com/g/#change,63173
Change-Id: I617b8740a50af0d75df9f49fa6b88dd2decb36dd
Diffstat (limited to 'pngrio.c')
-rw-r--r-- | pngrio.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -38,7 +38,22 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) (*(png_ptr->read_data_fn))(png_ptr, data, length); else png_error(png_ptr, "Call to NULL read function"); + +#ifdef PNG_INDEX_SUPPORTED + png_ptr->total_data_read += length; +#endif +} + +#ifdef PNG_INDEX_SUPPORTED +void /* PRIVATE */ +png_seek_data(png_structp png_ptr, png_uint_32 offset) +{ + if (png_ptr->seek_data_fn != NULL) + (*(png_ptr->seek_data_fn))(png_ptr, offset); + else + png_error(png_ptr, "Call to NULL seek function"); } +#endif #ifdef PNG_STDIO_SUPPORTED /* This is the function that does the actual reading of data. If you are @@ -177,4 +192,14 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_ptr->output_flush_fn = NULL; #endif } + +#ifdef PNG_INDEX_SUPPORTED +void PNGAPI +png_set_seek_fn(png_structp png_ptr, png_seek_ptr seek_data_fn) +{ + if (png_ptr == NULL) + return; + png_ptr->seek_data_fn = seek_data_fn; +} +#endif #endif /* PNG_READ_SUPPORTED */ |