X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0272a10d2e6d5323422c4c8600fe47ccac0df182..35524f615e56a566786b7621c4b1d16a9c7dd3c7:/src/png/pngtrans.c?ds=sidebyside diff --git a/src/png/pngtrans.c b/src/png/pngtrans.c index 1640095020..f92f4b02d1 100644 --- a/src/png/pngtrans.c +++ b/src/png/pngtrans.c @@ -1,24 +1,24 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.2.17 May 15, 2007 + * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2007 Glenn Randers-Pehrson + * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ #define PNG_INTERNAL #include "png.h" - #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* turn on BGR-to-RGB mapping */ void PNGAPI png_set_bgr(png_structp png_ptr) { - png_debug(1, "in png_set_bgr\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_bgr"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_BGR; } #endif @@ -28,8 +28,8 @@ png_set_bgr(png_structp png_ptr) void PNGAPI png_set_swap(png_structp png_ptr) { - png_debug(1, "in png_set_swap\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_swap"); + if (png_ptr == NULL) return; if (png_ptr->bit_depth == 16) png_ptr->transformations |= PNG_SWAP_BYTES; } @@ -40,8 +40,8 @@ png_set_swap(png_structp png_ptr) void PNGAPI png_set_packing(png_structp png_ptr) { - png_debug(1, "in png_set_packing\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_packing"); + if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) { png_ptr->transformations |= PNG_PACK; @@ -55,8 +55,8 @@ png_set_packing(png_structp png_ptr) void PNGAPI png_set_packswap(png_structp png_ptr) { - png_debug(1, "in png_set_packswap\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_packswap"); + if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) png_ptr->transformations |= PNG_PACKSWAP; } @@ -66,8 +66,8 @@ png_set_packswap(png_structp png_ptr) void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits) { - png_debug(1, "in png_set_shift\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_shift"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SHIFT; png_ptr->shift = *true_bits; } @@ -78,7 +78,7 @@ png_set_shift(png_structp png_ptr, png_color_8p true_bits) int PNGAPI png_set_interlace_handling(png_structp png_ptr) { - png_debug(1, "in png_set_interlace handling\n"); + png_debug(1, "in png_set_interlace handling"); if (png_ptr && png_ptr->interlaced) { png_ptr->transformations |= PNG_INTERLACE; @@ -98,8 +98,8 @@ png_set_interlace_handling(png_structp png_ptr) void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) { - png_debug(1, "in png_set_filler\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_filler"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_FILLER; png_ptr->filler = (png_byte)filler; if (filler_loc == PNG_FILLER_AFTER) @@ -131,8 +131,8 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) void PNGAPI png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) { - png_debug(1, "in png_set_add_alpha\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_add_alpha"); + if (png_ptr == NULL) return; png_set_filler(png_ptr, filler, filler_loc); png_ptr->transformations |= PNG_ADD_ALPHA; } @@ -145,8 +145,8 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) void PNGAPI png_set_swap_alpha(png_structp png_ptr) { - png_debug(1, "in png_set_swap_alpha\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_swap_alpha"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SWAP_ALPHA; } #endif @@ -156,8 +156,8 @@ png_set_swap_alpha(png_structp png_ptr) void PNGAPI png_set_invert_alpha(png_structp png_ptr) { - png_debug(1, "in png_set_invert_alpha\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_invert_alpha"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_ALPHA; } #endif @@ -166,8 +166,8 @@ png_set_invert_alpha(png_structp png_ptr) void PNGAPI png_set_invert_mono(png_structp png_ptr) { - png_debug(1, "in png_set_invert_mono\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_invert_mono"); + if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_MONO; } @@ -175,7 +175,7 @@ png_set_invert_mono(png_structp png_ptr) void /* PRIVATE */ png_do_invert(png_row_infop row_info, png_bytep row) { - png_debug(1, "in png_do_invert\n"); + png_debug(1, "in png_do_invert"); /* This test removed from libpng version 1.0.13 and 1.2.0: * if (row_info->bit_depth == 1 && */ @@ -230,7 +230,7 @@ png_do_invert(png_row_infop row_info, png_bytep row) void /* PRIVATE */ png_do_swap(png_row_infop row_info, png_bytep row) { - png_debug(1, "in png_do_swap\n"); + png_debug(1, "in png_do_swap"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && @@ -361,7 +361,7 @@ static PNG_CONST png_byte fourbppswaptable[256] = { void /* PRIVATE */ png_do_packswap(png_row_infop row_info, png_bytep row) { - png_debug(1, "in png_do_packswap\n"); + png_debug(1, "in png_do_packswap"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && @@ -393,7 +393,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row) void /* PRIVATE */ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) { - png_debug(1, "in png_do_strip_filler\n"); + png_debug(1, "in png_do_strip_filler"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif @@ -551,7 +551,7 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) void /* PRIVATE */ png_do_bgr(png_row_infop row_info, png_bytep row) { - png_debug(1, "in png_do_bgr\n"); + png_debug(1, "in png_do_bgr"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && @@ -630,14 +630,14 @@ void PNGAPI png_set_user_transform_info(png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels) { - png_debug(1, "in png_set_user_transform_info\n"); - if(png_ptr == NULL) return; + png_debug(1, "in png_set_user_transform_info"); + if (png_ptr == NULL) return; #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->user_transform_ptr = user_transform_ptr; png_ptr->user_transform_depth = (png_byte)user_transform_depth; png_ptr->user_transform_channels = (png_byte)user_transform_channels; #else - if(user_transform_ptr || user_transform_depth || user_transform_channels) + if (user_transform_ptr || user_transform_depth || user_transform_channels) png_warning(png_ptr, "This version of libpng does not support user transform info"); #endif @@ -652,8 +652,8 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp png_voidp PNGAPI png_get_user_transform_ptr(png_structp png_ptr) { -#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) if (png_ptr == NULL) return (NULL); +#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) return ((png_voidp)png_ptr->user_transform_ptr); #else return (NULL);