mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
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:
11
pngwio.c
11
pngwio.c
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user