about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-12 17:31:08 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2024-03-12 17:31:08 +0000
commit65fc824d664ceb501985edee67b320173b9e789a (patch)
tree6633b012091b7ee0ca07e6409df07ecc3ae0822b /lib
parent2e3b39415008ac5743b69583f14154841577c49d (diff)
downloadnetpbm-mirror-65fc824d664ceb501985edee67b320173b9e789a.tar.gz
netpbm-mirror-65fc824d664ceb501985edee67b320173b9e789a.tar.xz
netpbm-mirror-65fc824d664ceb501985edee67b320173b9e789a.zip
Add comments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4871 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-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;