mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Fix inconsistent whitespace in pngtrans.c, pngwrite.c, and pngwtran.c
This commit is contained in:
parent
4e763f1b30
commit
45624d6c2c
@ -136,7 +136,7 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Also I added this in libpng-1.0.2a (what happens when we expand
|
/* Also I added this in libpng-1.0.2a (what happens when we expand
|
||||||
* a less-than-8-bit grayscale to GA? */
|
* a less-than-8-bit grayscale to GA?) */
|
||||||
|
|
||||||
if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8)
|
if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8)
|
||||||
{
|
{
|
||||||
@ -506,18 +506,18 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
|
|||||||
{
|
{
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
{
|
{
|
||||||
/* This converts from GX or GA to G */
|
|
||||||
if (flags & PNG_FLAG_FILLER_AFTER)
|
if (flags & PNG_FLAG_FILLER_AFTER)
|
||||||
{
|
{
|
||||||
|
/* This converts from GX or GA to G */
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
*dp++ = *sp++;
|
*dp++ = *sp++;
|
||||||
sp++;
|
sp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This converts from XG or AG to G */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This converts from XG or AG to G */
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
sp++;
|
sp++;
|
||||||
|
|||||||
@ -879,8 +879,7 @@ png_write_flush(png_structp png_ptr)
|
|||||||
if (!(png_ptr->zstream.avail_out))
|
if (!(png_ptr->zstream.avail_out))
|
||||||
{
|
{
|
||||||
/* Write the IDAT and reset the zlib output buffer */
|
/* Write the IDAT and reset the zlib output buffer */
|
||||||
png_write_IDAT(png_ptr, png_ptr->zbuf,
|
png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
|
||||||
png_ptr->zbuf_size);
|
|
||||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||||
wrote_IDAT = 1;
|
wrote_IDAT = 1;
|
||||||
@ -1073,9 +1072,11 @@ png_set_filter(png_structp png_ptr, int method, int filters)
|
|||||||
png_ptr->do_filter = PNG_FILTER_AVG; break;
|
png_ptr->do_filter = PNG_FILTER_AVG; break;
|
||||||
case PNG_FILTER_VALUE_PAETH:
|
case PNG_FILTER_VALUE_PAETH:
|
||||||
png_ptr->do_filter = PNG_FILTER_PAETH; break;
|
png_ptr->do_filter = PNG_FILTER_PAETH; break;
|
||||||
default: png_ptr->do_filter = (png_byte)filters; break;
|
default:
|
||||||
|
png_ptr->do_filter = (png_byte)filters; break;
|
||||||
#else
|
#else
|
||||||
default: png_warning(png_ptr, "Unknown row filter for method 0");
|
default:
|
||||||
|
png_warning(png_ptr, "Unknown row filter for method 0");
|
||||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
#endif /* PNG_WRITE_FILTER_SUPPORTED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
pngwtran.c
16
pngwtran.c
@ -342,9 +342,9 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
{
|
{
|
||||||
/* This converts from ARGB to RGBA */
|
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
{
|
{
|
||||||
|
/* This converts from ARGB to RGBA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -357,9 +357,9 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
*(dp++) = save;
|
*(dp++) = save;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This converts from AARRGGBB to RRGGBBAA */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This converts from AARRGGBB to RRGGBBAA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -382,9 +382,9 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
}
|
}
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||||
{
|
{
|
||||||
/* This converts from AG to GA */
|
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
{
|
{
|
||||||
|
/* This converts from AG to GA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -396,9 +396,9 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
*(dp++) = save;
|
*(dp++) = save;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This converts from AAGG to GGAA */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This converts from AAGG to GGAA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -428,9 +428,9 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
{
|
{
|
||||||
/* This inverts the alpha channel in RGBA */
|
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
{
|
{
|
||||||
|
/* This inverts the alpha channel in RGBA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -445,9 +445,9 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
*(dp++) = (png_byte)(255 - *(sp++));
|
*(dp++) = (png_byte)(255 - *(sp++));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This inverts the alpha channel in RRGGBBAA */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This inverts the alpha channel in RRGGBBAA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -470,9 +470,9 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
}
|
}
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||||
{
|
{
|
||||||
/* This inverts the alpha channel in GA */
|
|
||||||
if (row_info->bit_depth == 8)
|
if (row_info->bit_depth == 8)
|
||||||
{
|
{
|
||||||
|
/* This inverts the alpha channel in GA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@ -483,9 +483,9 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
*(dp++) = (png_byte)(255 - *(sp++));
|
*(dp++) = (png_byte)(255 - *(sp++));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This inverts the alpha channel in GGAA */
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* This inverts the alpha channel in GGAA */
|
||||||
png_bytep sp, dp;
|
png_bytep sp, dp;
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user