home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 309.lha / PBM_PLUS / pbmplus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1980-12-04  |  2.6 KB  |  75 lines

  1. /* pbmplus.h - header file for PBM, PGM, PPM, and PNM
  2. */
  3.  
  4. #ifndef _PBMPLUS_H_
  5. #define _PBMPLUS_H_
  6.  
  7. #if ! ( defined(BSD) || defined(SYSV) )
  8. /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a
  9. ** System V site, set the SYSV option.  This mostly has to do with string
  10. ** functions.
  11. */
  12. #define BSD
  13. /* #define SYSV */
  14. #endif
  15.  
  16. /* CONFIGURE: If you want to enable writing "raw" files, set this option.
  17. ** "Raw" files are smaller, and much faster to read and write, but you
  18. ** must have a filesystem that allows all 256 ASCII characters to be read
  19. ** and written.  Also, you will no longer be able to mail P?M files without 
  20. ** using uuencode or the equivalent.  Note that reading "raw" files works
  21. ** whether writing is enabled or not.
  22. */
  23. #define PBMPLUS_RAWBITS
  24.  
  25. /* CONFIGURE: PGM can store gray values as either bytes or shorts.  For most
  26. ** applications, bytes will be big enough, and the memory savings can be
  27. ** substantial.  However, if you need more than 8 bits of resolution, then
  28. ** define this symbol.
  29. **
  30. ** If you are not making PGM, you can ignore this.
  31. */
  32. /* #define PGM_BIGGRAYS */
  33.  
  34. /* CONFIGURE: Normally, PPM handles a pixel as a struct of three grays.
  35. ** It can also be configured to pack the three values into a single longword,
  36. ** 10 bits each.  If you have configured PGM with the PGM_BIGGRAYS option
  37. ** (store grays as shorts), AND you don't need more than 10 bits for each
  38. ** color component, AND you care more about memory use than speed, then
  39. ** this option might be a win.  Under these circumstances it will make
  40. ** some of the programs use 1.5 times less space,  but all of the programs
  41. ** will run about 1.4 times slower.
  42. **
  43. ** If you are not using PGM_BIGGRAYS, then this option is useless -- it
  44. ** doesn't save any space, but it still slows things down.
  45. **
  46. ** If you are not making PPM, you can ignore this.
  47. */
  48. /* #define PPM_PACKCOLORS */
  49.  
  50. /* CONFIGURE: uncomment this to enable debugging checks. */
  51. /* #define DEBUG */
  52.  
  53. /* End of configurable definitions. */
  54.  
  55. /* Variable-sized arrays definitions. */
  56.  
  57. char **pm_allocarray( /* int cols, int rows, size */ );
  58. char *pm_allocrow( /* int cols, size */);
  59. void pm_freearray( /* char **its, int rows */ );
  60. void pm_freerow( /* char *itrow */ );
  61.  
  62. /* Error handling definitions. */
  63.  
  64. extern char *pm_progname;    /* every main() must assign argv[0] to this */
  65. void pm_message( /* char *fmt, arg, arg, arg, arg, arg */ );
  66. void pm_error( /* char *fmt, arg, arg, arg, arg, arg */ ); /* doesn't return */
  67. void pm_usage( /* char *usage */ );            /* doesn't return */
  68.  
  69. /* File open/close that handles "-" as stdin and checks errors. */
  70.  
  71. FILE *pm_openr( /* char *name */ );
  72. void pm_close( /* FILE *f */ );
  73.  
  74. #endif _PBMPLUS_H_
  75.