about summary refs log tree commit diff
path: root/converter/ppm/ppmtoilbm.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-09-28 02:40:42 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-09-28 02:40:42 +0000
commit34546ecb9b586f34e04f6e133a247ffe1f50046e (patch)
tree55c0c6c76c55bfe99a9f3c7dec416604a1c6dbd9 /converter/ppm/ppmtoilbm.c
parentd484f36f7c690d0a88476127afd9bdf90233699d (diff)
downloadnetpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.tar.gz
netpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.tar.xz
netpbm-mirror-34546ecb9b586f34e04f6e133a247ffe1f50046e.zip
Release 1.04.00
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@4700 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm/ppmtoilbm.c')
-rw-r--r--converter/ppm/ppmtoilbm.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/converter/ppm/ppmtoilbm.c b/converter/ppm/ppmtoilbm.c
index ad07f9fb..f9672733 100644
--- a/converter/ppm/ppmtoilbm.c
+++ b/converter/ppm/ppmtoilbm.c
@@ -483,7 +483,7 @@ encodeRow(FILE *    const outfile,
     int plane, bytes;
     long retbytes = 0;
 
-    bytes = RowBytes(cols);
+    bytes = ilbm_rowByteCt(cols);
 
     /* Encode and write raw bytes in plane-interleaved form. */
     for( plane = 0; plane < nPlanes; plane++ ) {
@@ -1145,7 +1145,7 @@ ppmToHam(FILE *  const ifP,
     nPlanes = hamplanes;
     cmapsize = colors * 3;
 
-    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * RowBytes(cols);
+    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * ilbm_rowByteCt(cols);
     if( DO_COMPRESS ) {
         bodysize = doHamBody(ifP, NULL, cols, rows, maxval,
                                hammaxval, nPlanes, colormap, colors);
@@ -1276,7 +1276,7 @@ ppmToDeep(FILE * const ifP,
 
     nPlanes = 3*bitspercolor;
 
-    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * RowBytes(cols);
+    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * ilbm_rowByteCt(cols);
     if( DO_COMPRESS ) {
         bodysize = doDeepBody(ifP, NULL, cols, rows, maxval, bitspercolor);
         if( bodysize > oldsize )
@@ -1389,7 +1389,7 @@ ppmToDcol(FILE *        const ifP,
 
     nPlanes = dcol->r + dcol->g + dcol->b;
 
-    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * RowBytes(cols);
+    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * ilbm_rowByteCt(cols);
     if( DO_COMPRESS ) {
         bodysize = doDcolBody(ifP, NULL, cols, rows, maxval, dcol);
         if( bodysize > oldsize )
@@ -1563,7 +1563,7 @@ ppmToStd(FILE *  const ifP,
     if( sortcmap )
         ppm_sortcolorrow(colormap, colors, PPM_STDSORT);
 
-    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * RowBytes(cols);
+    bodysize = oldsize = rows * TOTALPLANES(nPlanes) * ilbm_rowByteCt(cols);
     if( DO_COMPRESS ) {
         bodysize = doStdBody(ifP, NULL, cols, rows, maxval, colormap,
                              colors, nPlanes);
@@ -2274,11 +2274,13 @@ main(int argc, char ** argv) {
 
     if (mode != MODE_CMAP) {
         unsigned int i;
-        MALLOCARRAY_NOFAIL(coded_rowbuf, RowBytes(cols));
-        for (i = 0; i < RowBytes(cols); ++i)
+        MALLOCARRAY_NOFAIL(coded_rowbuf, ilbm_rowByteCt(cols));
+        for (i = 0; i < ilbm_rowByteCt(cols); ++i)
             coded_rowbuf[i] = 0;
         if (DO_COMPRESS)
-            pm_rlenc_allocoutbuf(&compr_rowbuf, RowBytes(cols), PM_RLE_PACKBITS);
+            pm_rlenc_allocoutbuf(&compr_rowbuf,
+                                 ilbm_rowByteCt(cols),
+                                 PM_RLE_PACKBITS);
     }
 
     switch (mode) {