about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-09-25 20:34:05 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2021-09-25 20:34:05 +0000
commit0ffd1eedea91fdb58cbef1075d8b251fe61a75fa (patch)
tree051911c43b07ec3e479a8607926750fc294bf34a
parent311a6622e576349fdcf13a4b015911fab4d6f190 (diff)
downloadnetpbm-mirror-0ffd1eedea91fdb58cbef1075d8b251fe61a75fa.tar.gz
netpbm-mirror-0ffd1eedea91fdb58cbef1075d8b251fe61a75fa.tar.xz
netpbm-mirror-0ffd1eedea91fdb58cbef1075d8b251fe61a75fa.zip
Promote Development to Advnced, Release 10.96.0
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4136 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pgmtoppm.c25
-rw-r--r--doc/HISTORY6
-rw-r--r--editor/pnmcat.c53
-rw-r--r--lib/libpam.c4
-rw-r--r--version.mk4
5 files changed, 52 insertions, 40 deletions
diff --git a/converter/other/pgmtoppm.c b/converter/other/pgmtoppm.c
index c3a26594..62a388c2 100644
--- a/converter/other/pgmtoppm.c
+++ b/converter/other/pgmtoppm.c
@@ -37,7 +37,7 @@ parseCommandLine(int argc, char ** argv,
                  struct cmdlineInfo * const cmdlineP) {
 /*----------------------------------------------------------------------------
    parse program command line described in Unix standard form by argc
-   and argv.  Return the information in the options as *cmdlineP.  
+   and argv.  Return the information in the options as *cmdlineP.
 
    If command line is internally inconsistent (invalid options, etc.),
    issue error message to stderr and abort program.
@@ -82,9 +82,13 @@ parseCommandLine(int argc, char ** argv,
         }
     } else {
         /* Arguments are color or color range and file name */
+        /* For defaults, we use "rgbi:..." instead of the simpler "black"
+           and "white" so that we don't have unnecessary dependency on a
+           color dictionary being available.
+        */
         if (argc-1 < 1) {
-            cmdlineP->colorBlack = "black";
-            cmdlineP->colorWhite = "white";
+            cmdlineP->colorBlack = "rgbi:0/0/0";
+            cmdlineP->colorWhite = "rgbi:1/1/1";
         } else {
             char * buffer = strdup(argv[1]);
             char * hyphenPos = strchr(buffer, '-');
@@ -93,7 +97,7 @@ parseCommandLine(int argc, char ** argv,
                 cmdlineP->colorBlack = buffer;
                 cmdlineP->colorWhite = hyphenPos+1;
             } else {
-                cmdlineP->colorBlack = "black";
+                cmdlineP->colorBlack = "rgbi:0/0/0";
                 cmdlineP->colorWhite = buffer;
             }
         }
@@ -101,7 +105,7 @@ parseCommandLine(int argc, char ** argv,
             cmdlineP->inputFilename = "-";
         else
             cmdlineP->inputFilename = argv[2];
-        
+
         if (argc-1 > 2)
             pm_error("Program takes at most 2 arguments:  "
                      "color name/range and input file name.  "
@@ -128,7 +132,7 @@ convertWithMap(FILE * const ifP,
     pixval mapmaxval;
     pixel ** mappixels;
     unsigned int mapmaxcolor;
-    
+
     mapFileP = pm_openr(mapFileName);
     mappixels = ppm_readppm(mapFileP, &mapcols, &maprows, &mapmaxval);
     pm_close(mapFileP);
@@ -138,7 +142,7 @@ convertWithMap(FILE * const ifP,
 
     for (row = 0; row < rows; ++row) {
         unsigned int col;
-            
+
         pgm_readpgmrow(ifP, grayrow, cols, maxval, format);
 
         for (col = 0; col < cols; ++col) {
@@ -176,7 +180,7 @@ convertLinear(FILE * const ifP,
 
     colorBlack = ppm_parsecolor(colorNameBlack, maxval);
     colorWhite = ppm_parsecolor(colorNameWhite, maxval);
- 
+
     red0 = PPM_GETR(colorBlack);
     grn0 = PPM_GETG(colorBlack);
     blu0 = PPM_GETB(colorBlack);
@@ -228,7 +232,7 @@ main(int    argc,
         convertWithMap(ifP, cols, rows, maxval, format, cmdline.map,
                        stdout, grayrow, pixelrow);
     else
-        convertLinear(ifP, cols, rows, maxval, format, 
+        convertLinear(ifP, cols, rows, maxval, format,
                       cmdline.colorBlack, cmdline.colorWhite, stdout,
                       grayrow, pixelrow);
 
@@ -241,3 +245,6 @@ main(int    argc,
     */
     return 0;
 }
+
+
+
diff --git a/doc/HISTORY b/doc/HISTORY
index d3b3f93b..c6c7099b 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -3,7 +3,11 @@ Netpbm.
 
 CHANGE HISTORY 
 --------------
-21.08.12 BJH  Release 10.95.01
+
+21.09.25 BJH  Release 10.96.00
+
+              pgmtoppm: Eliminate dependency on color dictionary when user
+              does not specify any colors by name.
 
               pamstereogram: Fix crash with -xbegin=0.  Thanks Scott Pakin.
               Introduced in Netpbm 10.94.
diff --git a/editor/pnmcat.c b/editor/pnmcat.c
index 565ecceb..c660698c 100644
--- a/editor/pnmcat.c
+++ b/editor/pnmcat.c
@@ -28,7 +28,7 @@ enum orientation {TOPBOTTOM, LEFTRIGHT};
 
 enum justification {JUST_CENTER, JUST_MIN, JUST_MAX};
 
-struct imgInfo {
+typedef struct {
     /* This obviously should be a struct pam.  We should convert this
        to 'pamcat'.
     */
@@ -37,11 +37,11 @@ struct imgInfo {
     int    rows;
     int    format;
     xelval maxval;
-};
+} ImgInfo;
 
 
 
-struct cmdlineInfo {
+struct CmdlineInfo {
     /* All the information the user supplied in the command line,
        in a form easy for the program to use.
     */
@@ -56,7 +56,7 @@ struct cmdlineInfo {
 
 static void
 parseCommandLine(int argc, const char ** const argv,
-                 struct cmdlineInfo * const cmdlineP) {
+                 struct CmdlineInfo * const cmdlineP) {
 /*----------------------------------------------------------------------------
    Note that the file spec array we return is stored in the storage that
    was passed to us as the argv array.
@@ -178,7 +178,7 @@ parseCommandLine(int argc, const char ** const argv,
 static void
 computeOutputParms(unsigned int     const nfiles,
                    enum orientation const orientation,
-                   struct imgInfo   const img[],
+                   ImgInfo          const img[],
                    unsigned int *   const newcolsP,
                    unsigned int *   const newrowsP,
                    xelval *         const newmaxvalP,
@@ -194,7 +194,7 @@ computeOutputParms(unsigned int     const nfiles,
     newrows = 0;
 
     for (i = 0; i < nfiles; ++i) {
-        const struct imgInfo * const imgP = &img[i];
+        const ImgInfo * const imgP = &img[i];
 
         if (i == 0) {
             newmaxval = imgP->maxval;
@@ -318,7 +318,7 @@ padFillBitrow(unsigned char * const destBitrow,
 */
 
 
-struct imgInfoPbm2 {
+typedef struct {
     /* Information about one image */
     unsigned char * proberow;
         /* Top row of image, when background color is
@@ -332,22 +332,22 @@ struct imgInfoPbm2 {
         /* Background color.  0x00 means white; 0xff means black */
     unsigned int padtop;
         /* Top padding amount */
-};
+} ImgInfoPbm2;
 
 
 
 static void
-getPbmImageInfo(struct imgInfo        const img[],
+getPbmImageInfo(ImgInfo               const img[],
                 unsigned int          const nfiles,
                 unsigned int          const newrows,
                 enum justification    const justification,
                 enum backcolor        const backcolor,
-                struct imgInfoPbm2 ** const img2P) {
+                ImgInfoPbm2 **        const img2P) {
 /*----------------------------------------------------------------------------
    Read the first row of each image in img[] and return that and additional
    information about images as *img2P.
 -----------------------------------------------------------------------------*/
-    struct imgInfoPbm2 * img2;
+    ImgInfoPbm2 * img2;
     unsigned int i;
 
     MALLOCARRAY_NOFAIL(img2, nfiles);
@@ -394,8 +394,8 @@ getPbmImageInfo(struct imgInfo        const img[],
 
 
 static void
-destroyPbmImg2(struct imgInfoPbm2 * const img2,
-               unsigned int         const nfiles) {
+destroyPbmImg2(ImgInfoPbm2 * const img2,
+               unsigned int  const nfiles) {
 
     unsigned int i;
 
@@ -414,7 +414,7 @@ concatenateLeftRightPbm(FILE *             const ofP,
                         unsigned int       const newcols,
                         unsigned int       const newrows,
                         enum justification const justification,
-                        struct imgInfo     const img[],
+                        ImgInfo            const img[],
                         enum backcolor     const backcolor) {
 
     unsigned char * const outrow = pbm_allocrow_packed(newcols);
@@ -423,7 +423,7 @@ concatenateLeftRightPbm(FILE *             const ofP,
            packed PBM row.
         */
 
-    struct imgInfoPbm2 * img2;
+    ImgInfoPbm2 * img2;
         /* malloc'ed array, one element per image.  Shadows img[] */
     unsigned int row;
 
@@ -479,7 +479,7 @@ concatenateTopBottomPbm(FILE *             const ofP,
                         int                const newcols,
                         int                const newrows,
                         enum justification const justification,
-                        struct imgInfo     const img[],
+                        ImgInfo            const img[],
                         enum backcolor     const backcolor) {
 
     unsigned char * const outrow = pbm_allocrow_packed(newcols);
@@ -574,17 +574,17 @@ concatenateTopBottomPbm(FILE *             const ofP,
 
 
 
-struct imgGen2 {
+typedef struct {
     xel * xelrow;
     xel * inrow;
     xel   background;
     int   padtop;
-};
+} ImgGen2;
 
 
 
 static void
-getGenImgInfo(struct imgInfo     const img[],
+getGenImgInfo(ImgInfo            const img[],
               unsigned int       const nfiles,
               xel *              const newxelrow,
               unsigned int       const newrows,
@@ -592,9 +592,9 @@ getGenImgInfo(struct imgInfo     const img[],
               int                const newformat,
               enum justification const justification,
               enum backcolor     const backcolor,
-              struct imgGen2 **  const img2P) {
+              ImgGen2 **         const img2P) {
 
-    struct imgGen2 * img2;
+    ImgGen2 * img2;
     unsigned int i;
 
     MALLOCARRAY_NOFAIL(img2, nfiles);
@@ -654,11 +654,12 @@ concatenateLeftRightGen(FILE *             const ofP,
                         xelval             const newmaxval,
                         int                const newformat,
                         enum justification const justification,
-                        struct imgInfo     const img[],
+                        ImgInfo            const img[],
                         enum backcolor     const backcolor) {
 
     xel * const outrow = pnm_allocrow(newcols);
-    struct imgGen2 * img2;
+
+    ImgGen2 *    img2;
     unsigned int row;
 
     getGenImgInfo(img, nfiles, outrow, newrows,
@@ -716,7 +717,7 @@ concatenateTopBottomGen(FILE *             const ofP,
                         xelval             const newmaxval,
                         int                const newformat,
                         enum justification const justification,
-                        struct imgInfo     const img[],
+                        ImgInfo            const img[],
                         enum backcolor     const backcolor) {
 
     xel * const newxelrow = pnm_allocrow(newcols);
@@ -808,8 +809,8 @@ int
 main(int           argc,
      const char ** argv) {
 
-    struct cmdlineInfo cmdline;
-    struct imgInfo * img;  /* malloc'ed array */
+    struct CmdlineInfo cmdline;
+    ImgInfo * img;  /* malloc'ed array */
     xelval newmaxval;
     int newformat;
     unsigned int i;
diff --git a/lib/libpam.c b/lib/libpam.c
index d19534e2..72502749 100644
--- a/lib/libpam.c
+++ b/lib/libpam.c
@@ -405,9 +405,9 @@ pnm_setpamrow(const struct pam * const pamP,
               tuple *            const tuplerow,
               sample             const value) {
 
-    int col;
+    unsigned int col;
     for (col = 0; col < pamP->width; ++col) {
-        int plane;
+        unsigned int plane;
         for (plane = 0; plane < pamP->depth; ++plane)
             tuplerow[col][plane] = value;
     }
diff --git a/version.mk b/version.mk
index b83b493d..90ef19e5 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
-NETPBM_MINOR_RELEASE = 95
-NETPBM_POINT_RELEASE = 1
+NETPBM_MINOR_RELEASE = 96
+NETPBM_POINT_RELEASE = 0