home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiniExamples / AppKit / TIFFandEPS / ImageReader.h < prev    next >
Encoding:
Text File  |  1992-07-22  |  1.8 KB  |  60 lines

  1. /* ImageReader.h
  2.  *  Purpose: The application delegate.  This class reads in and saves out EPS
  3.  * and TIFF images.
  4.  *
  5.  *  You may freely copy, distribute, and reuse the code in this example.
  6.  *  NeXT disclaims any warranty of any kind, expressed or  implied, as to its fitness
  7.  *  for any particular use.
  8.  *
  9.  */
  10.  
  11. #import <appkit/appkit.h>
  12.  
  13. @interface ImageReader:Object
  14. {
  15.     id saveReq;               /* save panel */
  16.     id accessoryWindow;  /* accessory view for save panel */
  17.     id formatMatrix;         /* EPS/TIFF selection in save panel */
  18.     id    DPIpopup, DPIvalue;  /* items in the save panel */
  19.                               /* related to TIFF resolution */
  20.     id compressionType;     /* JPEG vs LZW compression */
  21.     id JPEGlabel;         /* JPEG factor label */
  22.     id JPEGvalue;         /* JPEG compression factor */
  23. }
  24.  
  25. /* Class methods */
  26.  
  27. /* Instance methods */
  28. - openRequest:sender;
  29. - saveRequest:sender;
  30. - selectFormat:sender;
  31. - selectCompression:sender;
  32. - (BOOL)openFile:(const char *)fileName;
  33. - (BOOL)saveTIFF: (const char *)fileName inWindow: window;
  34. - (BOOL)saveEPS: (const char *)fileName  inWindow:window;
  35.  
  36. /* File extensions for files that can be read in and saved out */
  37. const char *epsType = "eps";
  38. const char *tiffType = "tiff";
  39.  
  40. #define POINTSPERINCH    72.0
  41.  
  42. /* These integers refer to the column number in the image format matrix */
  43. /* for the accessory view of the save panel.  This refers to the format of */
  44. /* the saved image only.  */
  45. #define TIFF_FORMAT        0
  46. #define EPS_FORMAT        1
  47.  
  48. /* These integers refer to the column number in the DPI radio button matrix */
  49. /* that these buttons specify.  */
  50. #define DPI_72        0
  51. #define DPI_144        1
  52. #define DPI_OTHER    2
  53.  
  54. /* These integers refer to the column number in the Compression radio */
  55. /* button matrix that these buttons specify. */
  56. #define LZW_COMPRESSION    0
  57. #define JPEG_COMPRESSION    1
  58.  
  59. @end
  60.