compression code unification

Unify the compression code so that inflate calls are localized to a common
routine.  Ground work for filter selection support.  Minor API changes to use
void* not byte* for data parameters.  Unification of some of the compression
code with the decompression code; IDAT_size replaces IDAT_read_size and
zbuffer_size, IDAT reading and writing is no longer controlled by the size of
the compression buffer.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-11-30 13:39:49 -08:00
parent 6bbc74d880
commit 4792c8a751
15 changed files with 609 additions and 537 deletions

View File

@@ -31,11 +31,16 @@
*/
void /* PRIVATE */
png_write_data(png_structrp png_ptr, png_const_bytep data, png_size_t length)
png_write_data(png_structrp png_ptr, png_const_voidp data, png_size_t length)
{
/* NOTE: write_data_fn must not change the buffer! */
/* NOTE: write_data_fn must not change the buffer!
* This cast is required because of the API; changing the type of the
* callback would require every app to change the callback and that change
* would have to be conditional on the libpng version.
*/
if (png_ptr->rw_data_fn != NULL )
png_ptr->rw_data_fn(png_ptr, png_constcast(png_bytep, data), length);
png_ptr->rw_data_fn(png_ptr,
png_constcast(png_bytep,png_voidcast(png_const_bytep,data)), length);
else
png_app_error(png_ptr, "No write function");