mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.2.30beta04.tar
This commit is contained in:
111
pngrtran.c
111
pngrtran.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.2.30 [July 6, 2008]
|
||||
* Last changed in libpng 1.2.30 [July 10, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@@ -23,7 +23,7 @@ png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
|
||||
{
|
||||
png_debug(1, "in png_set_crc_action\n");
|
||||
/* Tell libpng how we react to CRC errors in critical chunks */
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
switch (crit_action)
|
||||
{
|
||||
case PNG_CRC_NO_CHANGE: /* leave setting as is */
|
||||
@@ -81,7 +81,7 @@ png_set_background(png_structp png_ptr,
|
||||
int need_expand, double background_gamma)
|
||||
{
|
||||
png_debug(1, "in png_set_background\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
|
||||
{
|
||||
png_warning(png_ptr, "Application must supply a known background gamma");
|
||||
@@ -103,7 +103,7 @@ void PNGAPI
|
||||
png_set_strip_16(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_strip_16\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= PNG_16_TO_8;
|
||||
}
|
||||
#endif
|
||||
@@ -113,7 +113,7 @@ void PNGAPI
|
||||
png_set_strip_alpha(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_strip_alpha\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
|
||||
}
|
||||
#endif
|
||||
@@ -143,7 +143,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
|
||||
int full_dither)
|
||||
{
|
||||
png_debug(1, "in png_set_dither\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= PNG_DITHER;
|
||||
|
||||
if (!full_dither)
|
||||
@@ -527,7 +527,7 @@ void PNGAPI
|
||||
png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
|
||||
{
|
||||
png_debug(1, "in png_set_gamma\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) ||
|
||||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) ||
|
||||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
|
||||
@@ -546,7 +546,7 @@ void PNGAPI
|
||||
png_set_expand(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_expand\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
@@ -573,7 +573,7 @@ void PNGAPI
|
||||
png_set_palette_to_rgb(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_palette_to_rgb\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ void PNGAPI
|
||||
png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= PNG_EXPAND;
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ void PNGAPI
|
||||
png_set_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_gray_1_2_4_to_8\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
}
|
||||
#endif
|
||||
@@ -635,7 +635,7 @@ png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
|
||||
{
|
||||
int red_fixed = (int)((float)red*100000.0 + 0.5);
|
||||
int green_fixed = (int)((float)green*100000.0 + 0.5);
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
|
||||
}
|
||||
#endif
|
||||
@@ -645,7 +645,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
png_fixed_point red, png_fixed_point green)
|
||||
{
|
||||
png_debug(1, "in png_set_rgb_to_gray\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
switch(error_action)
|
||||
{
|
||||
case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY;
|
||||
@@ -666,12 +666,12 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
#endif
|
||||
{
|
||||
png_uint_16 red_int, green_int;
|
||||
if(red < 0 || green < 0)
|
||||
if (red < 0 || green < 0)
|
||||
{
|
||||
red_int = 6968; /* .212671 * 32768 + .5 */
|
||||
green_int = 23434; /* .715160 * 32768 + .5 */
|
||||
}
|
||||
else if(red + green < 100000L)
|
||||
else if (red + green < 100000L)
|
||||
{
|
||||
red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L);
|
||||
green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L);
|
||||
@@ -684,7 +684,8 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
}
|
||||
png_ptr->rgb_to_gray_red_coeff = red_int;
|
||||
png_ptr->rgb_to_gray_green_coeff = green_int;
|
||||
png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768-red_int-green_int);
|
||||
png_ptr->rgb_to_gray_blue_coeff =
|
||||
(png_uint_16)(32768 - red_int - green_int);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -697,13 +698,13 @@ png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
|
||||
read_user_transform_fn)
|
||||
{
|
||||
png_debug(1, "in png_set_read_user_transform_fn\n");
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL) return;
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||
png_ptr->transformations |= PNG_USER_TRANSFORM;
|
||||
png_ptr->read_user_transform_fn = read_user_transform_fn;
|
||||
#endif
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
if(read_user_transform_fn)
|
||||
if (read_user_transform_fn)
|
||||
png_warning(png_ptr,
|
||||
"This version of libpng does not support user transforms");
|
||||
#endif
|
||||
@@ -718,7 +719,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_init_read_transformations\n");
|
||||
#if defined(PNG_USELESS_TESTS_SUPPORTED)
|
||||
if(png_ptr != NULL)
|
||||
if (png_ptr != NULL)
|
||||
#endif
|
||||
{
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||
@@ -1111,7 +1112,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
#if !defined(PNG_READ_GAMMA_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||
&& !defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
if(png_ptr)
|
||||
if (png_ptr)
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
@@ -1240,11 +1241,11 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) && \
|
||||
defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||
if(png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||
{
|
||||
if(info_ptr->bit_depth < png_ptr->user_transform_depth)
|
||||
if (info_ptr->bit_depth < png_ptr->user_transform_depth)
|
||||
info_ptr->bit_depth = png_ptr->user_transform_depth;
|
||||
if(info_ptr->channels < png_ptr->user_transform_channels)
|
||||
if (info_ptr->channels < png_ptr->user_transform_channels)
|
||||
info_ptr->channels = png_ptr->user_transform_channels;
|
||||
}
|
||||
#endif
|
||||
@@ -1255,7 +1256,7 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, info_ptr->width);
|
||||
|
||||
#if !defined(PNG_READ_EXPAND_SUPPORTED)
|
||||
if(png_ptr)
|
||||
if (png_ptr)
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
@@ -1325,13 +1326,13 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
int rgb_error =
|
||||
png_do_rgb_to_gray(png_ptr, &(png_ptr->row_info), png_ptr->row_buf + 1);
|
||||
if(rgb_error)
|
||||
if (rgb_error)
|
||||
{
|
||||
png_ptr->rgb_to_gray_status=1;
|
||||
if((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
PNG_RGB_TO_GRAY_WARN)
|
||||
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||
if((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||
PNG_RGB_TO_GRAY_ERR)
|
||||
png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||
}
|
||||
@@ -1415,7 +1416,7 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
||||
{
|
||||
png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
png_ptr->palette_lookup, png_ptr->dither_index);
|
||||
if(png_ptr->row_info.rowbytes == (png_uint_32)0)
|
||||
if (png_ptr->row_info.rowbytes == (png_uint_32)0)
|
||||
png_error(png_ptr, "png_do_dither returned rowbytes=0");
|
||||
}
|
||||
#endif
|
||||
@@ -1477,7 +1478,7 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||
{
|
||||
if(png_ptr->read_user_transform_fn != NULL)
|
||||
if (png_ptr->read_user_transform_fn != NULL)
|
||||
(*(png_ptr->read_user_transform_fn)) /* user read transform function */
|
||||
(png_ptr, /* png_ptr */
|
||||
&(png_ptr->row_info), /* row_info: */
|
||||
@@ -1489,9 +1490,9 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
||||
png_ptr->row_buf + 1); /* start of pixel data for row */
|
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
if(png_ptr->user_transform_depth)
|
||||
if (png_ptr->user_transform_depth)
|
||||
png_ptr->row_info.bit_depth = png_ptr->user_transform_depth;
|
||||
if(png_ptr->user_transform_channels)
|
||||
if (png_ptr->user_transform_channels)
|
||||
png_ptr->row_info.channels = png_ptr->user_transform_channels;
|
||||
#endif
|
||||
png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
|
||||
@@ -1968,7 +1969,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
if(row_info->bit_depth == 8)
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
/* This changes the data from G to GX */
|
||||
if (flags & PNG_FLAG_FILLER_AFTER)
|
||||
@@ -2000,7 +2001,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
row_info->rowbytes = row_width * 2;
|
||||
}
|
||||
}
|
||||
else if(row_info->bit_depth == 16)
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
/* This changes the data from GG to GGXX */
|
||||
if (flags & PNG_FLAG_FILLER_AFTER)
|
||||
@@ -2040,7 +2041,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
} /* COLOR_TYPE == GRAY */
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||
{
|
||||
if(row_info->bit_depth == 8)
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
/* This changes the data from RGB to RGBX */
|
||||
if (flags & PNG_FLAG_FILLER_AFTER)
|
||||
@@ -2076,7 +2077,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
row_info->rowbytes = row_width * 4;
|
||||
}
|
||||
}
|
||||
else if(row_info->bit_depth == 16)
|
||||
else if (row_info->bit_depth == 16)
|
||||
{
|
||||
/* This changes the data from RRGGBB to RRGGBBXX */
|
||||
if (flags & PNG_FLAG_FILLER_AFTER)
|
||||
@@ -2266,14 +2267,14 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
png_byte red = png_ptr->gamma_to_1[*(sp++)];
|
||||
png_byte green = png_ptr->gamma_to_1[*(sp++)];
|
||||
png_byte blue = png_ptr->gamma_to_1[*(sp++)];
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
{
|
||||
rgb_error |= 1;
|
||||
*(dp++) = png_ptr->gamma_from_1[
|
||||
(rc*red+gc*green+bc*blue)>>15];
|
||||
(rc*red + gc*green + bc*blue)>>15];
|
||||
}
|
||||
else
|
||||
*(dp++) = *(sp-1);
|
||||
*(dp++) = *(sp - 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2286,13 +2287,13 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
png_byte red = *(sp++);
|
||||
png_byte green = *(sp++);
|
||||
png_byte blue = *(sp++);
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
{
|
||||
rgb_error |= 1;
|
||||
*(dp++) = (png_byte)((rc*red+gc*green+bc*blue)>>15);
|
||||
*(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
|
||||
}
|
||||
else
|
||||
*(dp++) = *(sp-1);
|
||||
*(dp++) = *(sp - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2313,7 +2314,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
|
||||
if(red == green && red == blue)
|
||||
if (red == green && red == blue)
|
||||
w = red;
|
||||
else
|
||||
{
|
||||
@@ -2347,7 +2348,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
rgb_error |= 1;
|
||||
gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15);
|
||||
*(dp++) = (png_byte)((gray16>>8) & 0xff);
|
||||
@@ -2370,7 +2371,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
png_byte red = png_ptr->gamma_to_1[*(sp++)];
|
||||
png_byte green = png_ptr->gamma_to_1[*(sp++)];
|
||||
png_byte blue = png_ptr->gamma_to_1[*(sp++)];
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
rgb_error |= 1;
|
||||
*(dp++) = png_ptr->gamma_from_1
|
||||
[(rc*red + gc*green + bc*blue)>>15];
|
||||
@@ -2387,7 +2388,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
png_byte red = *(sp++);
|
||||
png_byte green = *(sp++);
|
||||
png_byte blue = *(sp++);
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
rgb_error |= 1;
|
||||
*(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
|
||||
*(dp++) = *(sp++); /* alpha */
|
||||
@@ -2410,7 +2411,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
green = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2;
|
||||
|
||||
if(red == green && red == blue)
|
||||
if (red == green && red == blue)
|
||||
w = red;
|
||||
else
|
||||
{
|
||||
@@ -2444,7 +2445,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
red = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
|
||||
green = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
|
||||
blue = (png_uint_16)((*(sp)<<8) | *(sp+1)); sp+=2;
|
||||
if(red != green || red != blue)
|
||||
if (red != green || red != blue)
|
||||
rgb_error |= 1;
|
||||
gray16 = (png_uint_16)((rc*red + gc*green + bc*blue)>>15);
|
||||
*(dp++) = (png_byte)((gray16>>8) & 0xff);
|
||||
@@ -3836,7 +3837,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
dp = row + (row_info->rowbytes << 1) - 1;
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if (*(sp-1) == gray_high && *(sp) == gray_low)
|
||||
if (*(sp - 1) == gray_high && *(sp) == gray_low)
|
||||
{
|
||||
*dp-- = 0;
|
||||
*dp-- = 0;
|
||||
@@ -4066,7 +4067,7 @@ png_build_gamma_table(png_structp png_ptr)
|
||||
png_ptr->gamma_from_1 = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)256);
|
||||
|
||||
if(png_ptr->screen_gamma > 0.000001)
|
||||
if (png_ptr->screen_gamma > 0.000001)
|
||||
g = 1.0 / png_ptr->screen_gamma;
|
||||
else
|
||||
g = png_ptr->gamma; /* probably doing rgb_to_gray */
|
||||
@@ -4203,7 +4204,7 @@ png_build_gamma_table(png_structp png_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
if(png_ptr->screen_gamma > 0.000001)
|
||||
if (png_ptr->screen_gamma > 0.000001)
|
||||
g = 1.0 / png_ptr->screen_gamma;
|
||||
else
|
||||
g = png_ptr->gamma; /* probably doing rgb_to_gray */
|
||||
@@ -4279,11 +4280,11 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
|
||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||
{
|
||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp+1);
|
||||
png_uint_32 s1 = (*(rp+2) << 8) | *(rp+3);
|
||||
png_uint_32 s2 = (*(rp+4) << 8) | *(rp+5);
|
||||
png_uint_32 red = (png_uint_32)((s0+s1+65536L) & 0xffffL);
|
||||
png_uint_32 blue = (png_uint_32)((s2+s1+65536L) & 0xffffL);
|
||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
||||
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
||||
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
||||
png_uint_32 red = (png_uint_32)((s0 + s1 + 65536L) & 0xffffL);
|
||||
png_uint_32 blue = (png_uint_32)((s2 + s1 + 65536L) & 0xffffL);
|
||||
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
||||
*(rp+1) = (png_byte)(red & 0xff);
|
||||
*(rp+4) = (png_byte)((blue >> 8) & 0xff);
|
||||
|
||||
Reference in New Issue
Block a user