From 65fc824d664ceb501985edee67b320173b9e789a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 12 Mar 2024 17:31:08 +0000 Subject: Add comments git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4871 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libpbm3.c | 18 +++++++++++++++--- 1 file 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; -- cgit 1.4.1