diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2009-09-27 21:44:29 +0000 |
commit | 43939e66b1d4eeb2f3799c124f3598756755005a (patch) | |
tree | 15733092de55d52421a6ea02f5a43d5f8ff24393 /lib/libpgm2.c | |
parent | 49f4336c9bba33650573ba780b70bc501b38643e (diff) | |
download | netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.gz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.tar.xz netpbm-mirror-43939e66b1d4eeb2f3799c124f3598756755005a.zip |
Rebase Stable series to current Advanced: 10.47.04
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@995 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpgm2.c')
-rw-r--r-- | lib/libpgm2.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/libpgm2.c b/lib/libpgm2.c index 7a04f09b..650d2cb5 100644 --- a/lib/libpgm2.c +++ b/lib/libpgm2.c @@ -16,7 +16,6 @@ #include "pm_c_util.h" #include "mallocvar.h" #include "pgm.h" -#include "libpgm.h" @@ -57,35 +56,6 @@ putus(unsigned short const n, -void -pgm_writerawsample(FILE * const fileP, - gray const val, - gray const maxval) { - - if (maxval < 256) { - /* Samples fit in one byte, so write just one byte */ - int rc; - rc = putc(val, fileP); - if (rc == EOF) - pm_error("Error writing single byte sample to file"); - } else { - /* Samples are too big for one byte, so write two */ - int n_written; - unsigned char outval[2]; - /* We could save a few instructions if we exploited the internal - format of a gray, i.e. its endianness. Then we might be able - to skip the shifting and anding. - */ - outval[0] = val >> 8; - outval[1] = val & 0xFF; - n_written = fwrite(&outval, 2, 1, fileP); - if (n_written == 0) - pm_error("Error writing double byte sample to file"); - } -} - - - static void format1bpsRow(const gray * const grayrow, unsigned int const cols, |