diff options
author | Glenn Randers-Pehrson glennrp@comcast.net <glennrp at users.sourceforge.net> | 2009-05-15 20:39:34 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson glennrp@comcast.net <glennrp at users.sourceforge.net> | 2009-05-15 20:39:34 -0500 |
commit | b1c0d331284a2e6bfe0aaa438d1966b41c1c0bda (patch) | |
tree | caa2d9a09c576588a3cd6a9885841250a7cedfa7 /pngtrans.c | |
parent | 9a692c0769bcd5890507f376d856ebf104d726e9 (diff) | |
download | libpng-b1c0d331284a2e6bfe0aaa438d1966b41c1c0bda.tar.gz |
Housecleaning: revise identation and comments to meet libpng coding style.
Diffstat (limited to 'pngtrans.c')
-rw-r--r-- | pngtrans.c | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/pngtrans.c b/pngtrans.c index 0fef0b2f2..61e78b3ba 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -13,12 +13,13 @@ #include "pngpriv.h" #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* turn on BGR-to-RGB mapping */ +/* Turn on BGR-to-RGB mapping */ void PNGAPI png_set_bgr(png_structp png_ptr) { png_debug(1, "in png_set_bgr"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_BGR; } #endif @@ -29,7 +30,8 @@ void PNGAPI png_set_swap(png_structp png_ptr) { png_debug(1, "in png_set_swap"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; if (png_ptr->bit_depth == 16) png_ptr->transformations |= PNG_SWAP_BYTES; } @@ -41,7 +43,8 @@ void PNGAPI png_set_packing(png_structp png_ptr) { png_debug(1, "in png_set_packing"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; if (png_ptr->bit_depth < 8) { png_ptr->transformations |= PNG_PACK; @@ -56,7 +59,8 @@ void PNGAPI png_set_packswap(png_structp png_ptr) { png_debug(1, "in png_set_packswap"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; if (png_ptr->bit_depth < 8) png_ptr->transformations |= PNG_PACKSWAP; } @@ -67,7 +71,8 @@ void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits) { png_debug(1, "in png_set_shift"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_SHIFT; png_ptr->shift = *true_bits; } @@ -99,7 +104,8 @@ void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) { png_debug(1, "in png_set_filler"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_FILLER; png_ptr->filler = (png_byte)filler; if (filler_loc == PNG_FILLER_AFTER) @@ -131,7 +137,8 @@ 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"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_set_filler(png_ptr, filler, filler_loc); png_ptr->transformations |= PNG_ADD_ALPHA; } @@ -144,7 +151,8 @@ void PNGAPI png_set_swap_alpha(png_structp png_ptr) { png_debug(1, "in png_set_swap_alpha"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_SWAP_ALPHA; } #endif @@ -155,7 +163,8 @@ void PNGAPI png_set_invert_alpha(png_structp png_ptr) { png_debug(1, "in png_set_invert_alpha"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_INVERT_ALPHA; } #endif @@ -165,7 +174,8 @@ void PNGAPI png_set_invert_mono(png_structp png_ptr) { png_debug(1, "in png_set_invert_mono"); - if (png_ptr == NULL) return; + if (png_ptr == NULL) + return; png_ptr->transformations |= PNG_INVERT_MONO; } @@ -348,7 +358,7 @@ static PNG_CONST png_byte fourbppswaptable[256] = { 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF }; -/* swaps pixel packing order within bytes */ +/* Swaps pixel packing order within bytes */ void /* PRIVATE */ png_do_packswap(png_row_infop row_info, png_bytep row) { @@ -377,7 +387,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row) #if defined(PNG_WRITE_FILLER_SUPPORTED) || \ defined(PNG_READ_STRIP_ALPHA_SUPPORTED) -/* remove filler or alpha byte(s) */ +/* Remove filler or alpha byte(s) */ void /* PRIVATE */ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) { @@ -389,9 +399,9 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) png_uint_32 i; if ((row_info->color_type == PNG_COLOR_TYPE_RGB || - (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && - (flags & PNG_FLAG_STRIP_ALPHA))) && - row_info->channels == 4) + (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA && + (flags & PNG_FLAG_STRIP_ALPHA))) && + row_info->channels == 4) { if (row_info->bit_depth == 8) { @@ -532,7 +542,7 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) -/* swaps red and blue bytes within a pixel */ +/* Swaps red and blue bytes within a pixel */ void /* PRIVATE */ png_do_bgr(png_row_infop row_info, png_bytep row) { @@ -613,7 +623,8 @@ 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"); - if (png_ptr == NULL) return; + 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; @@ -634,7 +645,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 (png_ptr == NULL) return (NULL); + if (png_ptr == NULL) + return (NULL); #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) return ((png_voidp)png_ptr->user_transform_ptr); #else |