about summary refs log tree commit diff
path: root/lib/libpbm3.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpbm3.c')
-rw-r--r--lib/libpbm3.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/libpbm3.c b/lib/libpbm3.c
index 5d4e614b..b566202f 100644
--- a/lib/libpbm3.c
+++ b/lib/libpbm3.c
@@ -324,7 +324,15 @@ pbm_writepbmrow_packed(FILE *                const fileP,
                        const unsigned char * const packedBits,
                        int                   const cols,
                        int                   const forceplain) {
+/*----------------------------------------------------------------------------
+   Write to file *fileP the PBM row 'cols' columns wide in packed bit buffer
+   'packedBits'.
+
+   Write it in PBM plain format iff 'forceplain' is nonzero.
 
+   In raw format, the don't-care bits at the end of the row are the same as
+   in the input buffer.
+-----------------------------------------------------------------------------*/
     if (!forceplain && !pm_plain_output)
         writePackedRawRow(fileP, packedBits, cols);
     else {
@@ -385,10 +393,14 @@ pbm_writepbmrow_bitoffset(FILE *          const fileP,
                           int             const format,
                           unsigned int    const offset) {
 /*----------------------------------------------------------------------------
-   Write PBM row from a packed bit buffer 'packedBits, starting at the
-   specified offset 'offset' in the buffer.
+   Write to file *fileP the tail of the PBM row 'cols' columns wide in packed
+   bit buffer 'packedBits'.  Start at column 'offset' of the row.
+
+   Write it in PBM raw format.
+
+   Make any don't-care bits at the end of the row written zero.
 
-   We destroy the buffer.
+   We destroy the contents of the buffer.
 -----------------------------------------------------------------------------*/
     unsigned int const rsh = offset % 8;
     unsigned int const lsh = (8 - rsh) % 8;