(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSImageRep 

Inherits From:	NSObject 

Declared In:	appkit/NSImageRep.h 

Creating an NSImageRep

+ (id)imageRepWithContentsOfFile:(NSString *)filename
	In subclasses that respond to imageFileTypes and imageRepWithData:, returns an object that has been initialized with the data in filename.  NSImageRep's implementation returns an instance of the appropriate registered subclass.
+ (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard
	In subclasses that respond to imagePasteboardTypes and imageRepWithData:, returns an object that has been initialized with the data in pasteboard.  NSImageRep's implementation returns an instance of the appropriate registered subclass.
+ (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename
	In subclasses that respond to imageFileTypes and imageRepWithData: (or imageRepWithData:), returns an array of objects that have been initialized with the data in filename.  NSImageRep's implementation returns an array of objects (each an instance of the appropriate registered subclass) that have been initialized with the data in filename.
+ (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard
	In subclasses that respond to imagePasteboardTypes and imageRepsWithData: (or imageRepWithData:), returns an array of objects that have been initialized with the data in pasteboard.  NSImageRep's implementation returns an array of objects (each an instance of the appropriate registered subclass) that have been initialized with the data in pasteboard.

Checking data types 

+ (BOOL)canInitWithData:(NSData *)data	Overridden in subclasses to return YES if the receiver can initialize itself from data.
+ (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard
	Overridden in subclasses to returnYES if the receiver can initialize itself from pasteboard.
+ (NSArray *)imageFileTypes	Returns an array of strings representing all file types.
+ (NSArray *)imagePasteboardTypes	Returns an array of strings representing all pasteboard types.
+ (NSArray *)imageUnfilteredFileTypes	Returns an array of strings representing directly supported file types.
+ (NSArray *)imageUnfilteredPasteboardTypes 	Returns an array of strings representing directly supported
		pasteboards.

Setting the Size of the Image 

- (void)setSize:(NSSize)aSize	Sets the size of the image.
- (NSSize)size	Returns the size of the image.

Specifying Information about the Representation 

- (int)bitsPerSample	Returns the number of bits per pixel in each component.
- (NSString *)colorSpaceName	Returns the name of the image's color space.
- (BOOL)hasAlpha	Returns whether there is a coverage component.
- (BOOL)isOpaque	Returns whether the representation is opaque.
- (int)pixelsHigh	Returns the height specified in the image data.
- (int)pixelsWide	Returns the width specified in the image data.
- (void)setAlpha:(BOOL)flag	Informs the receiver whether there is a coverage component.
- (void)setBitsPerSample:(int)anInt	Informs the receiver there are anInt bits/pixel in a component.
- (void)setColorSpaceName:(NSString *)aString	Informs the receiver of the image's color space.
- (void)setOpaque:(BOOL)flag	Informs the receiver of the image's opacity.
- (void)setPixelsHigh:(int)anInt	Informs the receiver that its data is for an image anInt pixels high.
- (void)setPixelsWide:(int)anInt	Informs the receiver that its data is for an image anInt pixels wide.

Drawing the Image 

- (BOOL)draw	Implemented by subclasses to draw the image.
- (BOOL)drawAtPoint:(NSPoint)aPoint	Modifies current coordinates so the image is drawn at aPoint.
- (BOOL)drawInRect:(NSRect)aRect	Modifies current coordinates so the image is drawn in aRect.

Managing NSImageRep Subclasses 

+ (Class)imageRepClassForData:(NSData *)data
	Returns the ImageRep subclass that handles data of type data.
+ (Class)imageRepClassForFileType:(NSString *)type
	Returns the ImageRep subclass that handles data of file type type.
+ (Class)imageRepClassForPasteboardType:(NSString *)type
	Returns the ImageRep subclass that handles data of pasteboard type type.
+ (void)registerImageRepClass:(Class)imageRepClass
	Adds imageRepClass to the registry of available ImageRep classes.
+ (NSArray *)registeredImageRepClasses	Returns the names of the registered ImageRep classes.
+ (void)unregisterImageRepClass:(Class)imageRepClass
	Removes imageRepClass from the registry of available ImageRep classes.