[devel] Moved the PNG_DIVIDE_* and PNG_*_PREMULTIPLY macros
from png.h to pngpriv.h.
diff --git a/ANNOUNCE b/ANNOUNCE
index a8cd241..879a435 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -715,6 +715,7 @@
that the 255 is used as a double.
version 1.4.0beta106 [November 26, 2009]
+ Moved the PNG_DIVIDE_* and PNG_*_PREMULTIPLY macros from png.h to pngpriv.h.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index 2c16bf2..d65dab6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2402,6 +2402,7 @@
that the 255 is used as a double.
version 1.4.0beta106 [November 26, 2009]
+ Moved the PNG_DIVIDE_* and PNG_*_PREMULTIPLY macros from png.h to pngpriv.h.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/png.h b/png.h
index 523aef1..a44c363 100644
--- a/png.h
+++ b/png.h
@@ -131,7 +131,7 @@
* 1.4.0beta15-36 14 10400 14.so.0.0[.0]
* 1.4.0beta37-87 14 10400 14.so.14.0[.0]
* 1.4.0rc01 14 10400 14.so.14.0[.0]
- * 1.4.0beta88-106 14 10400 14.so.14.0[.0]
+ * 1.4.0beta88-105 14 10400 14.so.14.0[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -2474,15 +2474,6 @@
(png_uint_32)(alpha)) + (png_uint_32)32768L); \
(composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); }
-#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
-#define PNG_DIVIDE_BY_255(v) \
- ((png_byte)(((png_uint_16)(v) + \
- (((png_uint_16)(v) + 128) >> 8) + 128) >> 8))
-#define PNG_DIVIDE_BY_65535(v) \
- ((png_byte)(((png_uint_32)(v) + \
- (((png_uint_32)(v) + 32768L) >> 16) + 32768L) >> 16))
-#endif
-
#else /* Standard method using integer division */
# define png_composite(composite, fg, alpha, bg) \
@@ -2494,18 +2485,8 @@
(composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \
(png_uint_32)(bg)*(png_uint_32)(65535L - (png_uint_32)(alpha)) + \
(png_uint_32)32767) / (png_uint_32)65535L)
-
-#define PNG_DIVIDE_BY_255(v) (((png_uint_16)(v))/255)
-#define PNG_DIVIDE_BY_65535(v) (((png_uint_32)(v))/65535L)
#endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
-#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
-#define PNG_8_BIT_PREMULTIPLY(color,alpha) \
- PNG_DIVIDE_BY_255((color)*(alpha))
-#define PNG_16_BIT_PREMULTIPLY(color,alpha)\
- PNG_DIVIDE_BY_65535((color)*(alpha))
-#endif
-
#ifdef PNG_USE_READ_MACROS
/* Inline macros to do direct reads of bytes from the input buffer.
* The png_get_int_32() routine assumes we are using two's complement
diff --git a/pngpriv.h b/pngpriv.h
index b1f41d5..f120a65 100644
--- a/pngpriv.h
+++ b/pngpriv.h
@@ -831,6 +831,25 @@
int color_type, int interlace_type, int compression_type,
int filter_type));
+#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
+# ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
+# define PNG_DIVIDE_BY_255(v) \
+ ((png_byte)(((png_uint_16)(v) + \
+ (((png_uint_16)(v) + 128) >> 8) + 128) >> 8))
+# define PNG_DIVIDE_BY_65535(v) \
+ ((png_byte)(((png_uint_32)(v) + \
+ (((png_uint_32)(v) + 32768L) >> 16) + 32768L) >> 16))
+# else
+# define PNG_DIVIDE_BY_255(v) (((png_uint_16)(v))/255)
+# define PNG_DIVIDE_BY_65535(v) (((png_uint_32)(v))/65535L)
+# endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */
+
+# define PNG_8_BIT_PREMULTIPLY(color,alpha) \
+ PNG_DIVIDE_BY_255((color)*(alpha))
+# define PNG_16_BIT_PREMULTIPLY(color,alpha)\
+ PNG_DIVIDE_BY_65535((color)*(alpha))
+#endif /* PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED */
+
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
png_infop end_info_ptr));