home *** CD-ROM | disk | FTP | other *** search
- /*
- NXBitmapImageRep.h
- Application Kit, Release 2.0
- Copyright (c) 1988, 1989, 1990, NeXT, Inc. All rights reserved.
- */
-
- #import "NSImageRep.h"
- #import <objc/List.h>
- #import <streams/streams.h>
- #import <objc/zone.h>
- #import "obsoleteGraphics.h"
-
- typedef enum _NSTIFFCompression {
- NSTIFFCompressionNone = 1,
- NSTIFFCompressionCCITTFAX3 = 3, /* 1 bps only */
- NSTIFFCompressionCCITTFAX4 = 4, /* 1 bps only */
- NSTIFFCompressionLZW = 5,
- NSTIFFCompressionJPEG = 6,
- NSTIFFCompressionNEXT = 32766, /* Input only */
- NSTIFFCompressionPackBits = 32773,
- NSTIFFCompressionOldJPEG = 32865 /* Input only */
- } NSTIFFCompression;
-
- @interface NSBitmapImageRep : NSImageRep
- {
- unsigned int _bytesPerRow;
- unsigned short _imageNumber;
- short _colorSpace;
- struct __bitmapRepFlags {
- #ifdef __BIG_ENDIAN__
- unsigned int isPlanar:1;
- unsigned int explicitPlanes:1;
- unsigned int bitsPerPixel:8;
- unsigned int unpackedOK:1;
- unsigned int isUnpacked:1;
- unsigned int memory:2;
- unsigned int _RESERVED:2;
- #else
- unsigned int _RESERVED:2;
- unsigned int memory:2;
- unsigned int isUnpacked:1;
- unsigned int unpackedOK:1;
- unsigned int bitsPerPixel:8;
- unsigned int explicitPlanes:1;
- unsigned int isPlanar:1;
- #endif
- } _moreRepFlags;
- unsigned short _reservedB1;
- char *_fileName;
- int _reservedB2;
- unsigned char *_data;
- char *_otherName;
- unsigned short _compression;
- unsigned short _factor;
- }
-
- - initFromSection:(NSString *)fileName;
- - initFromFile:(NSString *)fileName;
- - initFromStream:(NXStream *)stream;
- - initData:(unsigned char *)data fromRect:(NSRect)rect;
- - initData:(unsigned char *)data pixelsWide:(int)width pixelsHigh:(int)height bitsPerSample:(int)bps samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpace:(NXColorSpace)colorSpace bytesPerRow:(int)rBytes bitsPerPixel:(int)pBits;
- - initDataPlanes:(unsigned char **)planes pixelsWide:(int)width pixelsHigh:(int)height bitsPerSample:(int)bps samplesPerPixel:(int)spp hasAlpha:(BOOL)alpha isPlanar:(BOOL)isPlanar colorSpace:(NXColorSpace)colorSpace bytesPerRow:(int)rBytes bitsPerPixel:(int)pBits;
-
- + (int)sizeImage:(NSRect)rect;
- + (int)sizeImage:(NSRect)rect pixelsWide:(int *)width pixelsHigh:(int *)height bitsPerSample:(int *)bps samplesPerPixel:(int *)spp hasAlpha:(BOOL *)hasAlpha isPlanar:(BOOL *)isPlanar colorSpace:(NXColorSpace *)colorSpace;
-
- + (NSArray *)newListFromSection:(NSString *)fileName;
- + (NSArray *)newListFromFile:(NSString *)fileName;
- + (NSArray *)newListFromStream:(NXStream *)stream;
- + (NSArray *)newListFromSection:(NSString *)fileName zone:(NSZone *)zone;
- + (NSArray *)newListFromFile:(NSString *)fileName zone:(NSZone *)zone;
- + (NSArray *)newListFromStream:(NXStream *)stream zone:(NSZone *)zone;
-
- - (unsigned char *)data;
- - getDataPlanes:(unsigned char **)data;
- - (BOOL)isPlanar;
- - (int)samplesPerPixel;
- - (int)bitsPerPixel;
- - (int)bytesPerRow;
- - (int)bytesPerPlane;
- - (int)numPlanes;
- - (NXColorSpace)colorSpace;
- - (BOOL)drawIn:(NSRect)rect;
- - (BOOL)draw;
- - (void)getCompression:(NSTIFFCompression *)compression andFactor:(float *)factor;
- - (void)setCompression:(NSTIFFCompression)compression andFactor:(float)factor;
- - writeTIFF:(NXStream *)stream;
- - writeTIFF:(NXStream *)stream usingCompression:(NSTIFFCompression)compression;
- - writeTIFF:(NXStream *)stream usingCompression:(NSTIFFCompression)compression andFactor:(float)compressionFactor;
- + (void)getTIFFCompressionTypes:(const NSTIFFCompression **)list count:(int *)numTypes;
- + (NSString *)localizedNameForTIFFCompressionType:(NSString *)compression;
- - (BOOL)canBeCompressedUsing:(NSTIFFCompression)compression;
- + (void)setUnpackedImageDataAcceptable:(BOOL)flag;
- + (BOOL)isUnpackedImageDataAcceptable;
- - read:(NXTypedStream *)stream;
- - write:(NXTypedStream *)stream;
- - (void)dealloc;
-
- @end
-