home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netpbma.zip / pnm / pnm.h < prev    next >
C/C++ Source or Header  |  1993-10-04  |  2KB  |  47 lines

  1. /* pnm.h - header file for libpnm portable anymap library
  2. */
  3.  
  4. #ifndef _PNM_H_
  5. #define _PNM_H_
  6.  
  7. #include "ppm.h"
  8. typedef pixel xel;
  9. typedef pixval xelval;
  10. #define PNM_MAXMAXVAL PPM_MAXMAXVAL
  11. #define PNM_GET1(x) PPM_GETB(x)
  12. #define PNM_ASSIGN1(x,v) PPM_ASSIGN(x,0,0,v)
  13. #define PNM_EQUAL(x,y) PPM_EQUAL(x,y)
  14. #define PNM_FORMAT_TYPE(f) PPM_FORMAT_TYPE(f)
  15.  
  16. /* Declarations of routines. */
  17.  
  18. void pnm_init ARGS(( int* argcP, char* argv[] ));
  19.  
  20. #define pnm_allocarray( cols, rows ) ((xel**) pm_allocarray( cols, rows, sizeof(xel) ))
  21. #define pnm_allocrow( cols ) ((xel*) pm_allocrow( cols, sizeof(xel) ))
  22. #define pnm_freearray( xels, rows ) pm_freearray( (char**) xels, rows )
  23. #define pnm_freerow( xelrow ) pm_freerow( (char*) xelrow )
  24.  
  25. xel** pnm_readpnm ARGS(( FILE* file, int* colsP, int* rowsP, xelval* maxvalP, int* formatP ));
  26. void pnm_readpnminit ARGS(( FILE* file, int* colsP, int* rowsP, xelval* maxvalP, int* formatP ));
  27. void pnm_readpnmrow ARGS(( FILE* file, xel* xelrow, int cols, xelval maxval, int format ));
  28.  
  29. void pnm_writepnm ARGS(( FILE* file, xel** xels, int cols, int rows, xelval maxval, int format, int forceplain ));
  30. void pnm_writepnminit ARGS(( FILE* file, int cols, int rows, xelval maxval, int format, int forceplain ));
  31. void pnm_writepnmrow ARGS(( FILE* file, xel* xelrow, int cols, xelval maxval, int format, int forceplain ));
  32.  
  33. xel pnm_backgroundxel ARGS(( xel** xels, int cols, int rows, xelval maxval, int format ));
  34. xel pnm_backgroundxelrow ARGS(( xel* xelrow, int cols, xelval maxval, int format ));
  35. xel pnm_whitexel ARGS(( xelval maxval, int format ));
  36. xel pnm_blackxel ARGS(( xelval maxval, int format ));
  37. void pnm_invertxel ARGS(( xel* x, xelval maxval, int format ));
  38. void pnm_promoteformat ARGS(( xel** xels, int cols, int rows, xelval maxval, int format, xelval newmaxval, int newformat ));
  39. void pnm_promoteformatrow ARGS(( xel* xelrow, int cols, xelval maxval, int format, xelval newmaxval, int newformat ));
  40.  
  41. extern xelval pnm_pbmmaxval;
  42. /* This is the maxval used when a PNM program reads a PBM file.  Normally
  43. ** it is 1; however, for some programs, a larger value gives better results
  44. */
  45.  
  46. #endif /*_PNM_H_*/
  47.