home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / tiff.h < prev    next >
Text File  |  1992-03-06  |  2KB  |  70 lines

  1. /*
  2.     tiff.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "graphics.h"
  8.  
  9. #define NX_PAGEHEIGHT 2048
  10.  
  11. #define NX_BIGENDIAN 0
  12. #define NX_LITTLEENDIAN 1
  13.  
  14. /* TIFF errors */
  15.  
  16. #define NX_BAD_TIFF_FORMAT 1
  17. #define NX_IMAGE_NOT_FOUND 2
  18. #define NX_ALLOC_ERROR 3
  19. #define NX_FORMAT_NOT_YET_SUPPORTED 4
  20. #define NX_FILE_IO_ERROR 5
  21. #define NX_COMPRESSION_NOT_YET_SUPPORTED 6
  22. #define NX_TIFF_CANT_APPEND 7
  23.  
  24. /* Compression values. */
  25.  
  26. #define NX_TIFF_COMPRESSION_NONE    1
  27. #define NX_TIFF_COMPRESSION_CCITTFAX3    3    /* 1 bps only */
  28. #define NX_TIFF_COMPRESSION_CCITTFAX4    4    /* 1 bps only */
  29. #define NX_TIFF_COMPRESSION_LZW        5
  30. #define NX_TIFF_COMPRESSION_JPEG    6
  31. #define NX_TIFF_COMPRESSION_NEXT    32766    /* Input only */
  32. #define NX_TIFF_COMPRESSION_PACKBITS    32773
  33. #define NX_TIFF_COMPRESSION_OLDJPEG    32865    /* Input only */
  34.  
  35. /*
  36.  * Structures used with the 1.0 TIFF read/write routines.
  37.  * 2.0 and 3.0 applications should use the NXBitmapImageRep class.
  38.  */
  39. typedef struct _NXImageInfo {
  40.     int width;             /* image width in pixels */
  41.     int height;            /* image height in pixels */
  42.     int bitsPerSample;     /* number of bits per data channel */
  43.     int samplesPerPixel;   /* number of channels per pixel */
  44.     int planarConfig;      /* NX_MESHED for mixed data channels */
  45.                        /* NX_PLANAR for separate data planes */
  46.     int photoInterp;       /* photometric interpretation of bitmap data, */
  47.                            /* formed by ORing the constants NX_ALPHAMASK, */
  48.                /* NX_COLORMASK, and NX_MONOTONICMASK.  */
  49. } NXImageInfo;
  50.  
  51. typedef struct _NXTIFFInfo {
  52.     int imageNumber;
  53.     NXImageInfo image;
  54.     int    subfileType;
  55.     int rowsPerStrip;
  56.     int stripsPerImage;
  57.     int compression;        /* compression id */
  58.     int numImages;        /* number of images in tiff */
  59.     int endian;            /* either NX_BIGENDIAN or NX_LITTLEENDIAN */
  60.     int version;        /* tiff version */
  61.     int error;
  62.     int firstIFD;        /* offset of first IFD entry */
  63.     unsigned int stripOffsets[NX_PAGEHEIGHT];
  64.     unsigned int stripByteCounts[NX_PAGEHEIGHT];
  65. } NXTIFFInfo;
  66.  
  67. extern int NXGetTIFFInfo(int imageNumber, NXStream *s, NXTIFFInfo *info);
  68. extern void *NXReadTIFF(int imageNumber, NXStream *s, NXTIFFInfo *info, void *data);
  69. extern void NXWriteTIFF(NXStream *s, NXImageInfo *image, voUF'data);
  70.