home *** CD-ROM | disk | FTP | other *** search
- /*
- tiff.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import "graphics.h"
-
- #define NX_PAGEHEIGHT 2048
-
- #define NX_BIGENDIAN 0
- #define NX_LITTLEENDIAN 1
-
- /* TIFF errors */
-
- #define NX_BAD_TIFF_FORMAT 1
- #define NX_IMAGE_NOT_FOUND 2
- #define NX_ALLOC_ERROR 3
- #define NX_FORMAT_NOT_YET_SUPPORTED 4
- #define NX_FILE_IO_ERROR 5
- #define NX_COMPRESSION_NOT_YET_SUPPORTED 6
- #define NX_TIFF_CANT_APPEND 7
-
- /* Compression values. */
-
- #define NX_TIFF_COMPRESSION_NONE 1
- #define NX_TIFF_COMPRESSION_CCITTFAX3 3 /* 1 bps only */
- #define NX_TIFF_COMPRESSION_CCITTFAX4 4 /* 1 bps only */
- #define NX_TIFF_COMPRESSION_LZW 5
- #define NX_TIFF_COMPRESSION_JPEG 6
- #define NX_TIFF_COMPRESSION_NEXT 32766 /* Input only */
- #define NX_TIFF_COMPRESSION_PACKBITS 32773
- #define NX_TIFF_COMPRESSION_OLDJPEG 32865 /* Input only */
-
- /*
- * Structures used with the 1.0 TIFF read/write routines.
- * 2.0 and 3.0 applications should use the NXBitmapImageRep class.
- */
- typedef struct _NXImageInfo {
- int width; /* image width in pixels */
- int height; /* image height in pixels */
- int bitsPerSample; /* number of bits per data channel */
- int samplesPerPixel; /* number of channels per pixel */
- int planarConfig; /* NX_MESHED for mixed data channels */
- /* NX_PLANAR for separate data planes */
- int photoInterp; /* photometric interpretation of bitmap data, */
- /* formed by ORing the constants NX_ALPHAMASK, */
- /* NX_COLORMASK, and NX_MONOTONICMASK. */
- } NXImageInfo;
-
- typedef struct _NXTIFFInfo {
- int imageNumber;
- NXImageInfo image;
- int subfileType;
- int rowsPerStrip;
- int stripsPerImage;
- int compression; /* compression id */
- int numImages; /* number of images in tiff */
- int endian; /* either NX_BIGENDIAN or NX_LITTLEENDIAN */
- int version; /* tiff version */
- int error;
- int firstIFD; /* offset of first IFD entry */
- unsigned int stripOffsets[NX_PAGEHEIGHT];
- unsigned int stripByteCounts[NX_PAGEHEIGHT];
- } NXTIFFInfo;
-
- extern int NXGetTIFFInfo(int imageNumber, NXStream *s, NXTIFFInfo *info);
- extern void *NXReadTIFF(int imageNumber, NXStream *s, NXTIFFInfo *info, void *data);
- extern void NXWriteTIFF(NXStream *s, NXImageInfo *image, void *data);
-