home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / jpeg2ps2.zip / psimage.h < prev    next >
C/C++ Source or Header  |  1997-01-23  |  2KB  |  45 lines

  1. /* -------------------------- psimage.h ------------------------- */
  2. #define TRUE  1
  3. #define FALSE 0
  4.  
  5. #ifdef min
  6. #undef min
  7. #endif
  8. #define min(a, b) ((a) < (b) ? (a) : (b))
  9.  
  10. typedef int BOOL;
  11.  
  12. /* Simple prototype macros for K&R and ANSI-C */
  13.  
  14. #ifdef KNR
  15. #define P0(v)            ()
  16. #define P1(t1, p1)        (p1) t1 p1;
  17. #define P2(t1, p1, t2, p2)    (p1, p2) t1 p1; t2 p2;
  18. #define P3(t1, p1, t2, p2, t3, p3)    (p1, p2, p3) t1 p1; t2 p2; t3 p3;
  19. #else
  20. #define P0(v)            (void)
  21. #define P1(t1, p1)        (t1 p1)
  22. #define P2(t1, p1, t2, p2)    (t1 p1, t2 p2)
  23. #define P3(t1, p1, t2, p2, t3, p3)    (t1 p1, t2 p2, t3 p3)
  24. #endif
  25.  
  26. /* data output mode: binary, ascii85, hex-ascii */
  27. typedef enum { BINARY, ASCII85, ASCIIHEX } DATAMODE;
  28.  
  29. typedef struct {
  30.   FILE     *fp;                   /* file pointer for jpeg file         */
  31.   char     *filename;             /* name of image file             */
  32.   int      width;                 /* pixels per line             */
  33.   int      height;                /* rows                 */
  34.   int      components;            /* number of color components         */
  35.   int      bits_per_component;    /* bits per color component         */
  36.   float    dpi;                   /* image resolution in dots per inch   */
  37.   DATAMODE mode;                  /* output mode: 8bit, ascii, ascii85     */
  38.   long     startpos;              /* offset to jpeg data         */
  39.   BOOL     landscape;             /* rotate image to landscape mode?     */
  40.   BOOL     adobe;                 /* image includes Adobe comment marker */
  41. } imagedata;
  42.  
  43. #define    DPI_IGNORE    -1.0      /* dummy value for imagedata.dpi       */
  44. #define DPI_USE_FILE     0.0      /* dummy value for imagedata.dpi       */
  45.