summaryrefslogtreecommitdiff
path: root/pngwtran.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-08-26 17:14:07 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-08-26 17:14:07 -0500
commit7d3e6732fbf529be0571fb89a5f778d89b2553ac (patch)
treef8a337934f0d88f4d3d39dd1fc366ac1dc788576 /pngwtran.c
parent07d9fc947819a752f06602156de052830f561751 (diff)
downloadlibpng-7d3e6732fbf529be0571fb89a5f778d89b2553ac.tar.gz
[devel] Added PNG_WRITE_16BIT_SUPPORTED option.
Diffstat (limited to 'pngwtran.c')
-rw-r--r--pngwtran.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pngwtran.c b/pngwtran.c
index 8293a5941..1c2e7afb7 100644
--- a/pngwtran.c
+++ b/pngwtran.c
@@ -393,6 +393,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
}
}
+#ifdef PNG_WRITE_16BIT_SUPPORTED
else
{
/* This converts from AARRGGBB to RRGGBBAA */
@@ -415,6 +416,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = save[1];
}
}
+#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
@@ -434,6 +436,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
}
}
+#ifdef PNG_WRITE_16BIT_SUPPORTED
else
{
/* This converts from AAGG to GGAA */
@@ -452,6 +455,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = save[1];
}
}
+#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
}
}
@@ -485,6 +489,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
}
}
+#ifdef PNG_WRITE_16BIT_SUPPORTED
else
{
/* This inverts the alpha channel in RRGGBBAA */
@@ -507,6 +512,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
}
}
+#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
@@ -525,6 +531,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
}
}
+#ifdef PNG_WRITE_16BIT_SUPPORTED
else
{
/* This inverts the alpha channel in GGAA */
@@ -543,6 +550,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
*(dp++) = (png_byte)(255 - *(sp++));
}
}
+#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
}
}
@@ -580,6 +588,7 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
}
}
+#ifdef PNG_WRITE_16BIT_SUPPORTED
else if (row_info->bit_depth == 16)
{
png_bytep rp;
@@ -607,6 +616,7 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
*(rp + 5) = (png_byte)(blue & 0xff);
}
}
+#endif /* PNG_WRITE_16BIT_SUPPORTED */
}
}
#endif /* PNG_MNG_FEATURES_SUPPORTED */