ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/ApplicationKit/Classes/NSImageRep.rtf

This is NSImageRep.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSImageRep 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding, NSCopying
fi0 NSObject (NSObject)
fs20 
fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSImageRep.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 NSImageRep is an abstract superclass; each of its subclasses knows how to draw an image from a particular kind of source data.  While an NSImageRep subclass can be used directly, it'27s typically used through an NSImage object.  An NSImage manages a group of representations, choosing the best one for the current output device.
fs16 
fs28 There are four subclasses defined in the Application Kit:
fs16 
fs28 pard s19 li854 fi0 ri1007 ql tx4509 tx10180 f0 b fs24 Subclasstab Source Data
fs6 
fs24 s17 f1 b0 fs28 NSBitmapImageReptab Tag Image File Format (TIFF) and other bitmap data
fi0 NSEPSImageReptab Encapsulated PostScript code (EPS)
fi0 NSCustomImageReptab A delegated method that can draw the image
fi0 NSCachedImageReptab A rendered image, usually in an off-screen window
fs6 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 fs10 
fs28 You can define other NSImageRep subclasses for objects that render images from other types of source information.  New subclasses must be added to the NSImageRep class registry by invoking the b registerImageRepClass:b0  class method.  The NSImageRep subclass informs the registry of the data types it can support through its b imageUnfilteredFileTypesb0 ,  b imageUnfilteredPasteboardTypesb0 , and b canInitWithData:b0  class methods.  Once an NSImageRep subclass is registered, an instance of that subclass is created anytime NSImage encounters the type of data handled by that subclass.
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Creating an NSImageRep
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (id)b imageRepWithContentsOfFile:b0 (NSString *)i filename
s9 li7030 fi-6553 fi-5796 i0 tab In subclasses that respond to b imageFileTypesb0  and b imageRepWithData:b0 , returns an object that has been initialized with the data in i filenamei0 .  NSImageRep'27s implementation returns an instance of the appropriate registered subclass.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imageRepsWithContentsOfFile:b0 (NSString *)i filename
s9 li7030 fi-6553 fi-5796 i0 tab In subclasses that respond to b imageFileTypesb0  and b imageRepWithData:b0  (or b imageRepWithData:b0 ), returns an array of objects that have been initialized with the data in i filenamei0 .  NSImageRep'27s implementation returns an array of objects (each an instance of the appropriate registered subclass) that have been initialized with the data in i filenamei0 .
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (id)b imageRepWithPasteboard:b0 (NSPasteboard *)i pasteboard
s9 li7030 fi-6553 fi-5796 i0 tab In subclasses that respond to b imagePasteboardTypesb0  and b imageRepWithData:b0 , returns an object that has been initialized with the data in i pasteboardi0 .  NSImageRep'27s implementation returns an instance of the appropriate registered subclass.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imageRepsWithPasteboard:b0 (NSPasteboard *)i pasteboard
s9 li7030 fi-6553 fi-5796 i0 tab In subclasses that respond to b imagePasteboardTypesb0  and b imageRepsWithData:b0  (or b imageRepWithData:b0 ), returns an array of objects that have been initialized with the data in i pasteboardi0 .  NSImageRep'27s implementation returns an array of objects (each an instance of the appropriate registered subclass) that have been initialized with the data in i pasteboardi0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Checking Data Types 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (BOOL)b canInitWithData:b0 (NSData *)i datai0 tab Overridden in subclasses to return YES if the receiver can initialize itself from i datai0 .
fi-6552 fs16 
fs28 fi-6552 + (BOOL)b canInitWithPasteboard:b0 (NSPasteboard *)i pasteboard
s9 li7030 fi-6553 fi-5796 i0 tab Overridden in subclasses to returnYES if the receiver can initialize itself from i pasteboardi0 .
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imageFileTypesb0 tab Returns an array of strings representing all file types.
fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imagePasteboardTypesb0 tab Returns an array of strings representing all pasteboard types.
fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imageUnfilteredFileTypesb0 tab Returns an array of strings representing directly supported file types.
fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b imageUnfilteredPasteboardTypes b0 tab Returns an array of strings representing directly supported
s9 li7030 fi-6553 fi-5796 tab tab pasteboards.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Setting the Size of the Image 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b setSize:b0 (NSSize)i aSizei0 tab Sets the size of the image.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSSize)b sizeb0 tab Returns the size of the image.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Specifying Information about the Representation 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (int)b bitsPerSampleb0 tab Returns the number of bits per pixel in each component.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b colorSpaceNameb0 tab Returns the name of the image'27s color space.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b hasAlphab0 tab Returns whether there is a coverage component.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isOpaqueb0 tab Returns whether the representation is opaque.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b pixelsHighb0 tab Returns the height specified in the image data.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b pixelsWideb0 tab Returns the width specified in the image data.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setAlpha:b0 (BOOL)i flagi0 tab Informs the receiver whether there is a coverage component.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setBitsPerSample:b0 (int)i anInti0 tab Informs the receiver there are i anInti0  bits/pixel in a component.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setColorSpaceName:b0 (NSString *)i aStringi0 tab Informs the receiver of the image'27s color space.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setOpaque:b0 (BOOL)i flagi0 tab Informs the receiver of the image'27s opacity.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setPixelsHigh:b0 (int)i anInti0 tab Informs the receiver that its data is for an image i anInti0  pixels high.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setPixelsWide:b0 (int)i anInti0 tab Informs the receiver that its data is for an image i anInti0  pixels wide.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Drawing the Image 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b drawb0 tab Implemented by subclasses to draw the image.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b drawAtPoint:b0 (NSPoint)i aPointi0 tab Modifies current coordinates so the image is drawn at i aPointi0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b drawInRect:b0 (NSRect)i aRecti0 tab Modifies current coordinates so the image is drawn in i aRecti0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Managing NSImageRep Subclasses 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 + (Class)b imageRepClassForData:b0 (NSData *)i datai0 tab Returns the NSImageRep subclass that handles data of type i datai0 .
fi-6552 fs16 
fs28 fi-6552 + (Class)b imageRepClassForFileType:b0 (NSString *)i type
s9 li7030 fi-6553 fi-5796 i0 tab Returns the NSImageRep subclass that handles data of file type i typei0 .
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (Class)b imageRepClassForPasteboardType:b0 (NSString *)i type
s9 li7030 fi-6553 fi-5796 i0 tab Returns the NSImageRep subclass that handles data of pasteboard type i typei0 .
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (void)b registerImageRepClass:b0 (Class)i imageRepClass
s9 li7030 fi-6553 fi-5796 i0 tab Adds i imageRepClassi0  to the registry of available NSImageRep classes. This method posts the NSImageRepRegistryChangedNotification notification with the receiving object to the default notification center.
s8 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 + (NSArray *)b registeredImageRepClassesb0 tab Returns the names of the registered NSImageRep classes.
fi-6552 fs16 
fs28 fi-6552 + (void)b unregisterImageRepClass:b0 (Class)i imageRepClass
s9 li7030 fi-6553 fi-5796 i0 tab Removes i imageRepClassi0  from the registry of available NSImageRep classes. This method posts the NSImageRepRegistryChangedNotification notification with the receiving object to the default notification center.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.