[gs-cvs] gs/src

Ralph Giles giles at ghostscript.com
Thu Jul 14 22:23:45 PDT 2005


Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv25386/src

Modified Files:
	configure.ac devs.mak gdevpng.c 
Log Message:
Add a 48 bit RGB PNG raster device for testing deep color output code
paths. The new device is called 'png48'. Note that this is a different
naming scheme from the the other PNG devices, which use number of colors
instead of the log of the number of colors to distinguish between the 
different output formats. Related to bug 688204.


Index: configure.ac
===================================================================
RCS file: /cvs/ghostscript/gs/src/configure.ac,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- configure.ac	25 Jan 2005 01:19:34 -0000	1.50
+++ configure.ac	15 Jul 2005 05:23:42 -0000	1.51
@@ -226,18 +226,19 @@
 dnl png for the png output device; it also requires zlib
 LIBPNGDIR=src
 PNGDEVS=''
+PNGDEVS_ALL='$(DD)png48.dev $(DD)png16m.dev $(DD)pnggray.dev $(DD)pngmono.dev $(DD)png256.dev $(DD)png16.dev $(DD)pngalpha.dev'
 AC_MSG_CHECKING([for local png library source])
 if test -f libpng/pngread.c; then
 	AC_MSG_RESULT([yes])
 	SHARE_LIBPNG=0
 	LIBPNGDIR=libpng
-	PNGDEVS='$(DD)png16m.dev $(DD)pnggray.dev $(DD)pngmono.dev $(DD)png256.dev $(DD)png16.dev $(DD)pngalpha.dev'
+	PNGDEVS="$PNGDEVS_ALL"
 else
 	AC_MSG_RESULT([no])
 	AC_CHECK_LIB(png, png_check_sig, [
 	  AC_CHECK_HEADERS(png.h, [
 		SHARE_LIBPNG=1
-		PNGDEVS='$(DD)png16m.dev $(DD)pnggray.dev $(DD)pngmono.dev $(DD)png256.dev $(DD)png16.dev $(DD)pngalpha.dev'
+		PNGDEVS="$PNGDEVS_ALL"
 	  ], [SHARE_LIBPNG=0])
 	], [SHARE_LIBPNG=0], [-lz])
 fi

Index: devs.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/devs.mak,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- devs.mak	14 Jul 2005 10:27:59 -0000	1.133
+++ devs.mak	15 Jul 2005 05:23:43 -0000	1.134
@@ -1421,6 +1421,10 @@
 	$(SETPDEV2) $(DD)png16m $(png_)
 	$(ADDMOD) $(DD)png16m $(png_i_)
 
+$(DD)png48.dev : $(DEVS_MAK) $(libpng_dev) $(png_) $(GLD)page.dev
+	$(SETPDEV2) $(DD)png48 $(png_)
+	$(ADDMOD) $(DD)png48 $(png_i_)
+
 $(DD)pngalpha.dev : $(DEVS_MAK) $(libpng_dev) $(png_) $(GLD)page.dev
 	$(SETPDEV2) $(DD)pngalpha $(png_)
 	$(ADDMOD) $(DD)pngalpha $(png_i_)

Index: gdevpng.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpng.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- gdevpng.c	20 Sep 2004 22:14:59 -0000	1.11
+++ gdevpng.c	15 Jul 2005 05:23:43 -0000	1.12
@@ -135,6 +135,19 @@
 	   0, 0, 0, 0,		/* margins */
 	   24, png_print_page);
 
+/* 48 bit color. */
+
+private const gx_device_procs png48_procs =
+prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
+		gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb);
+const gx_device_printer gs_png48_device =
+prn_device(png48_procs, "png48",
+	   DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+	   X_DPI, Y_DPI,
+	   0, 0, 0, 0,		/* margins */
+	   48, png_print_page);
+
+
 /* 32-bit RGBA */
 /* pngalpha device is 32-bit RGBA, with the alpha channel
  * indicating pixel coverage, not true transparency.  
@@ -304,6 +317,13 @@
 		png_set_bKGD(png_ptr, info_ptr, &background);
 	    }
 	    break;
+	case 48:
+	    info_ptr->bit_depth = 16;
+	    info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+#if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN) 
+	    png_set_swap(png_ptr);
+#endif
+	    break;
 	case 24:
 	    info_ptr->bit_depth = 8;
 	    info_ptr->color_type = PNG_COLOR_TYPE_RGB;



More information about the gs-cvs mailing list