about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-06-28 02:34:33 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2015-06-28 02:34:33 +0000
commitcb5a309dc093164c77528b109c4b797c256b0d15 (patch)
tree231d9b7087b696b7f01afc5356f6a45e0eddcc8d
parent4a1661d778cbf045c1820ac9bb4ae4f595510ce5 (diff)
downloadnetpbm-mirror-cb5a309dc093164c77528b109c4b797c256b0d15.tar.gz
netpbm-mirror-cb5a309dc093164c77528b109c4b797c256b0d15.tar.xz
netpbm-mirror-cb5a309dc093164c77528b109c4b797c256b0d15.zip
Remove Pamrgbatopng, obsoleted by Pamtopng
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2570 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/Makefile11
-rw-r--r--converter/other/pamrgbatopng.c136
2 files changed, 6 insertions, 141 deletions
diff --git a/converter/other/Makefile b/converter/other/Makefile
index 252c45fd..f51a780b 100644
--- a/converter/other/Makefile
+++ b/converter/other/Makefile
@@ -131,7 +131,7 @@ ifneq ($(DONT_HAVE_PROCESS_MGMT),Y)
 endif
 
 ifeq ($(HAVE_PNGLIB),Y)
-  PORTBINARIES += pamtopng pnmtopng pngtopam pamrgbatopng
+  PORTBINARIES += pamtopng pnmtopng pngtopam
 endif
 ifneq ($(JPEGLIB),NONE)
   PORTBINARIES += jpegtopnm pnmtojpeg
@@ -215,10 +215,6 @@ pnmtopng: pngx.o pngtxt.o
 pnmtopng: ADDL_OBJECTS = pngx.o pngtxt.o
 pnmtopng: LDFLAGS_TARGET = $(PNGLIB_LIBOPTS)
 
-pamrgbatopng: pngx.o
-pamrgbatopng: ADDL_OBJECTS = pngx.o
-pamrgbatopng: LDFLAGS_TARGET = $(PNGLIB_LIBOPTS)
-
 jpegtopnm: jpegdatasource.o exif.o
 jpegtopnm: ADDL_OBJECTS = jpegdatasource.o exif.o
 jpegtopnm: LDFLAGS_TARGET = $(shell $(LIBOPT) $(LIBOPTR) $(JPEGLIB))
@@ -295,3 +291,8 @@ endif
 # In December 2010, sunicontopnm replaced icontopbm
 	cd $(PKGDIR)/bin ; \
 	$(SYMLINK) sunicontopnm$(EXE) icontopbm$(EXE)
+ifeq ($(HAVE_PNGLIB),Y)
+# In June 2015, pamtopng replaced pamrgbapng
+	cd $(PKGDIR)/bin ; \
+	$(SYMLINK) pamtopng$(EXE) pamrgbatopng$(EXE)
+endif
diff --git a/converter/other/pamrgbatopng.c b/converter/other/pamrgbatopng.c
deleted file mode 100644
index 07a5181b..00000000
--- a/converter/other/pamrgbatopng.c
+++ /dev/null
@@ -1,136 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-/* Because of poor design of libpng, you must not #include <setjmp.h> before
-<png.h>.  Compile failure results.
-*/
-#include <png.h>
-#include <setjmp.h>
-
-#include "pm_c_util.h"
-#include "mallocvar.h"
-#include "pam.h"
-#include "pngx.h"
-
-
-
-struct cmdlineInfo {
-    const char * inputFileName;
-};
-
-
-
-static void
-processCommandLine(int                  const argc,
-                   char *               const argv[],
-                   struct cmdlineInfo * const cmdlineP) {
-        
-    if (argc-1 < 1)
-        cmdlineP->inputFileName = "-";
-    else {
-        cmdlineP->inputFileName = argv[1];
-
-        if (argc-1 > 1)
-            pm_error("Too many arguments.  "
-                     "The only argument is the input file name.");
-    }
-}
-
-
-
-static void
-convertPamToPng(const struct pam * const pamP,
-                const tuple *      const tuplerow,
-                png_byte *         const pngRow) {
-    
-    unsigned int col;
-    
-    for (col = 0; col < pamP->width; ++col) {
-        unsigned int plane;
-        
-        for (plane = 0; plane < 4; ++plane)
-            pngRow[4 * col + plane] = tuplerow[col][plane];
-    }
-}
-
-
-
-static void
-writeRaster(const struct pam * const pamP,
-            struct pngx *      const pngxP) {
-    
-    tuple * tupleRow;
-    png_byte * pngRow;
-    
-    tupleRow = pnm_allocpamrow(pamP);
-    MALLOCARRAY(pngRow, pamP->width * 4);
-
-    if (pngRow == NULL)
-        pm_error("Unable to allocate space for PNG pixel row.");
-    else {
-        unsigned int row;
-        for (row = 0; row < pamP->height; ++row) {
-            pnm_readpamrow(pamP, tupleRow);
-            
-            convertPamToPng(pamP, tupleRow, pngRow);
-            
-            png_write_row(pngxP->png_ptr, pngRow);
-        }
-        free(pngRow);
-    }
-    pnm_freepamrow(tupleRow);
-}
-
-
-
-static void
-writePng(const struct pam * const pamP,
-         FILE *             const ofP) {
-
-    struct pngx * pngxP;
-
-    pngx_create(&pngxP, PNGX_WRITE, NULL);
-    
-    pngx_setIhdr(pngxP, pamP->width, pamP->height,
-                 8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);
-        
-    png_init_io(pngxP->png_ptr, ofP);
-
-    pngx_writeInfo(pngxP);
-        
-    writeRaster(pamP, pngxP);
-
-    pngx_writeEnd(pngxP);
-        
-    pngx_destroy(pngxP);
-}
-    
-
-
-int
-main(int argc, char * argv[]) {
-
-    FILE * ifP;
-    struct cmdlineInfo cmdline;
-    struct pam pam;
-
-    pnm_init(&argc, argv);
-
-    processCommandLine(argc, argv, &cmdline);
-
-    ifP = pm_openr(cmdline.inputFileName);
-
-    pnm_readpaminit(ifP, &pam, PAM_STRUCT_SIZE(tuple_type));
-    
-    if (pam.depth < 4)
-        pm_error("PAM must have depth at least 4 (red, green, blue, alpha).  "
-                 "This one has depth %u", pam.depth);
-        
-    if (pam.maxval != 255)
-        pm_error("PAM must have maxval 255.  This one has %lu", pam.maxval);
-
-    writePng(&pam, stdout);
-
-    pm_close(ifP);
-
-    return 0;
-}