home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21fs.zip / octave / pnm / oct-img.h < prev    next >
C/C++ Source or Header  |  2000-01-15  |  2KB  |  75 lines

  1. /*
  2. *******************************************************************************
  3. ** Header for Octave/2 Image processing                                      **
  4. ** (c) 1997, Klaus Gebhardt, 1997 - 1999                                     **
  5. *******************************************************************************
  6. */
  7.  
  8. #ifndef _OCT_IMG_H
  9. #define _OCT_IMG_H
  10.  
  11. typedef int           BOOL;    /* Boolean type   */
  12. typedef unsigned char UCHAR;   /* Colormaps      */
  13. typedef short         SHORT;   /* Bits per Pixel */
  14. typedef int           INT;     /* Colours        */
  15. typedef unsigned int  UINT;    /* Sizes          */
  16. typedef double        OCTAVE;  /* Octaves type   */
  17.  
  18. #define OCT_BLACKWHITE 0
  19. #define OCT_GREY       1
  20. #define OCT_RGB        2
  21.  
  22. #if defined (__cplusplus)
  23. #include <octave/config.h>
  24. #include <octave/variables.h>
  25.  
  26. UCHAR **gif_colormap (octave_value, INT *, BOOL *);
  27. INT   **gif_pixels   (octave_value, INT, UINT *, UINT *);
  28.  
  29. void oct_colormap (Matrix&, UCHAR **, INT, INT);
  30. void oct_pixels   (Matrix&, INT **, INT, UINT, UINT);
  31. #endif
  32.  
  33. #if defined (__cplusplus)
  34. extern "C" {
  35. #endif
  36.  
  37. #include <stdio.h>
  38.  
  39. #ifndef max
  40. #define max(a,b)             (((a) > (b)) ? (a) : (b))
  41. #endif
  42. #ifndef min
  43. #define min(a,b)             (((a) < (b)) ? (a) : (b))
  44. #endif
  45.  
  46.   /* Windows und OS/2 Bitmaps */
  47. #define BMP_MAXCOLORS  256
  48. #define BMP_WIN          1
  49. #define BMP_OS2          2
  50.  
  51.   BOOL BMP_Encode (FILE *, INT, UINT, UINT, INT **, INT, UCHAR **);
  52.   BOOL BMP_Decode (FILE *, UINT *, UINT *, INT *, INT *, UCHAR ***, INT ***);
  53.  
  54.   /* PNM format */
  55. #define PPM_MAXVAL   255
  56. #define PPM_TYPE       'P' * 256 + '3'
  57. #define RPPM_TYPE      'P' * 256 + '6'
  58. #define PGM_MAXVAL   255
  59. #define PGM_TYPE       'P' * 256 + '2'
  60. #define RPGM_TYPE      'P' * 256 + '5'
  61. #define PBM_MAXVAL     1
  62. #define PBM_TYPE       'P' * 256 + '1'
  63. #define RPBM_TYPE      'P' * 256 + '4'
  64.  
  65.   BOOL PNM_Encode (FILE *, INT, UINT, UINT, INT **, INT, UCHAR **);
  66.   BOOL PNM_Decode (FILE *, UINT *, UINT *, INT *, INT *, UCHAR ***, INT ***);
  67.  
  68.   /* Postscript */
  69.   BOOL PS_Encode (FILE *, INT, UINT, UINT, INT **, INT, UCHAR **);
  70. #if defined (__cplusplus)
  71. }
  72. #endif
  73.  
  74. #endif
  75.