home *** CD-ROM | disk | FTP | other *** search
/ swCHIP 1991 January / swCHIP_95-1.bin / utility / gsview13 / src / gvceps.h < prev    next >
C/C++ Source or Header  |  1995-12-09  |  3KB  |  112 lines

  1. /* Copyright (C) 1993, 1994, Russell Lang.  All rights reserved.
  2.   
  3.   This file is part of GSview.
  4.   
  5.   This program is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the GSview Free Public Licence 
  9.   (the "Licence") for full details.
  10.   
  11.   Every copy of GSview must include a copy of the Licence, normally in a 
  12.   plain ASCII text file named LICENCE.  The Licence grants you the right 
  13.   to copy, modify and redistribute GSview, but only under certain conditions 
  14.   described in the Licence.  Among other things, the Licence requires that 
  15.   the copyright notice and this notice be preserved on all copies.
  16. */
  17.  
  18. /* gvceps.h */
  19. /* Common data structures for EPS manipulation */
  20.  
  21. /* because Windows and PM define the same bitmap structures  */
  22. /* with different names we use our own common structures */
  23. /* BITMAP1 = Windows BITMAPCORE and PM BITMAPINFO */
  24. /* BITMAP2 = Windows BITMAPINFO and PM BITMAPINFO2 */
  25. /* RGB3 = Windows RGBTRIPLE and PM RGB */
  26. /* RGB4 = Windows RGBQUAD and PM RGB2 */
  27.  
  28. #ifdef __EMX__
  29. #pragma pack(1)        /* align structures to byte boundaries */
  30. #endif
  31.  
  32. typedef struct tagRGB3
  33. {
  34.     BYTE    rgbtBlue;
  35.     BYTE    rgbtGreen;
  36.     BYTE    rgbtRed;
  37. } RGB3;
  38. typedef RGB3 GVFAR* LPRGB3;
  39.  
  40. typedef struct tagRGB4
  41. {
  42.     BYTE    rgbBlue;
  43.     BYTE    rgbGreen;
  44.     BYTE    rgbRed;
  45.     BYTE    rgbReserved;
  46. } RGB4;
  47. typedef RGB4 GVFAR* LPRGB4;
  48.  
  49. typedef struct tagBITMAP1
  50. {
  51.     DWORD   bcSize;
  52.     short   bcWidth;
  53.     short   bcHeight;
  54.     WORD    bcPlanes;
  55.     WORD    bcBitCount;
  56. } BITMAP1;
  57. typedef BITMAP1 GVFAR* LPBITMAP1;
  58.  
  59. typedef struct tagBITMAP2
  60. {
  61.     DWORD   biSize;
  62.     LONG    biWidth;
  63.     LONG    biHeight;
  64.     WORD    biPlanes;
  65.     WORD    biBitCount;
  66.     DWORD   biCompression;
  67.     DWORD   biSizeImage;
  68.     LONG    biXPelsPerMeter;
  69.     LONG    biYPelsPerMeter;
  70.     DWORD   biClrUsed;
  71.     DWORD   biClrImportant;
  72. } BITMAP2;
  73. typedef BITMAP2 GVFAR* LPBITMAP2;
  74.  
  75. typedef struct tagBITMAPFILE
  76. {
  77.     WORD    bfType;
  78.     DWORD   bfSize;
  79.     WORD    bfReserved1;
  80.     WORD    bfReserved2;
  81.     DWORD   bfOffBits;
  82. } BITMAPFILE;
  83. typedef BITMAPFILE GVFAR* LPBITMAPFILE;
  84.  
  85.  
  86. struct eps_header_s {
  87.     char id[4];
  88.     DWORD ps_begin;
  89.     DWORD ps_length;
  90.     DWORD mf_begin;
  91.     DWORD mf_length;
  92.     DWORD tiff_begin;
  93.     DWORD tiff_length;
  94.     WORD  checksum;
  95. };
  96.  
  97. #ifdef __EMX__
  98. #pragma pack()
  99. #endif
  100.  
  101. /* in gvpeps.c or gvweps.c */
  102. LPBITMAP2 get_bitmap(void);
  103. void release_bitmap(void);
  104.  
  105. /* in gvceps.c */
  106. unsigned long dib_bytewidth(LPBITMAP2 pbm);
  107. unsigned int dib_pal_colors(LPBITMAP2 pbm);
  108. void make_eps_tiff(int type);
  109. void make_eps_interchange(BOOL calc_bbox);
  110. void extract_doseps(int command);
  111. void copy_bbox_header(FILE *f);
  112.