NSImageRep

NSImageRep Mac OS X 10.0

This is an abstract class that defines a general interface to image representations. NSImageRep subclasses allow NSImage to work with various image data formats using the common interface declared in NSImageRep.

figs/cocn_1542.gif

@interface NSImageRep : NSObject <NSCoding, NSCopying>
 // Accessor Methods
   - (void)setSize:(NSSize)aSize;
   - (NSSize)size;
   - (void)setPixelsWide:(int)anInt;
   - (int)pixelsWide;
   - (void)setBitsPerSample:(int)anInt;
   - (int)bitsPerSample;
   - (void)setOpaque:(BOOL)flag;
   - (void)setPixelsHigh:(int)anInt;
   - (int)pixelsHigh;
   - (void)setAlpha:(BOOL)flag;
   - (void)setColorSpaceName:(NSString *)string;
   - (NSString *)colorSpaceName;
 // Class Methods
   + (BOOL)canInitWithData:(NSData *)data;
   + (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard;
   + (NSArray *)imageFileTypes;
   + (NSArray *)imagePasteboardTypes;
   + (Class)imageRepClassForData:(NSData *)data;
   + (Class)imageRepClassForFileType:(NSString *)type;
   + (Class)imageRepClassForPasteboardType:(NSString *)type;
   + (id)imageRepWithContentsOfFile:(NSString *)filename;
   + (id)imageRepWithContentsOfURL:(NSURL *)url;
   + (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard;
   + (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename;
   + (NSArray *)imageRepsWithContentsOfURL:(NSURL *)url;
   + (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard;
   + (NSArray *)imageUnfilteredFileTypes;
   + (NSArray *)imageUnfilteredPasteboardTypes;
   + (void)registerImageRepClass:(Class)imageRepClass;
   + (NSArray *)registeredImageRepClasses;
   + (void)unregisterImageRepClass:(Class)imageRepClass;
 // Instance Methods
   - (BOOL)draw;
   - (BOOL)drawAtPoint:(NSPoint)point;
   - (BOOL)drawInRect:(NSRect)rect;
   - (BOOL)hasAlpha;
   - (BOOL)isOpaque;
 // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;
 // Methods Implementing NSCopying
   - (id)copyWithZone:(NSZone *)zone;
// Notifications
   NSImageRepRegistryDidChangeNotification;

Subclasses

NSBitmapImageRep, NSCachedImageRep, NSCustomImageRep, NSEPSImageRep, NSPDFImageRep, NSPICTImageRep



    Part II: API Quick Reference
    Chapter 13. Foundation Classes