/usr/include/GNUstep/AppKit/NSBitmapImageRep.h is in libgnustep-gui-dev 0.22.0-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | /*
NSBitmapImageRep.h
Bitmap image representations
Copyright (C) 1996 Free Software Foundation, Inc.
Written by: Adam Fedor <fedor@colorado.edu>
Date: Feb 1996
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSBitmapImageRep
#define _GNUstep_H_NSBitmapImageRep
#import <GNUstepBase/GSVersionMacros.h>
#import <AppKit/NSImageRep.h>
@class NSArray;
@class NSString;
@class NSData;
@class NSDictionary;
@class NSMutableData;
@class NSMutableDictionary;
@class NSColor;
/** Describes the type of compression used on an image. Possible compressions:
<list>
<item> NSTIFFCompressionNone; </item>
<item> NSTIFFCompressionCCITTFAX3; </item>
<item> NSTIFFCompressionCCITFAX4; </item>
<item> NSTIFFCompressionLZW; </item>
<item> NSTIFFCompressionJPEG; </item>
<item> NSTIFFCompressionNEXT; </item>
<item> NSTIFFCompressionPackBits. </item>
<item> NSTIFFCompressionOldJPEG; </item>
</list>
*/
typedef enum _NSTIFFCompression {
NSTIFFCompressionNone = 1,
NSTIFFCompressionCCITTFAX3 = 3,
NSTIFFCompressionCCITTFAX4 = 4,
NSTIFFCompressionLZW = 5,
NSTIFFCompressionJPEG = 6,
NSTIFFCompressionNEXT = 32766,
NSTIFFCompressionPackBits = 32773,
NSTIFFCompressionOldJPEG = 32865
} NSTIFFCompression;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
/** Type of image
<list>
<item> NSTIFFFileType; </item>
<item> NSBMPFileType; Not implemented </item>
<item> NSGIFFileType; </item>
<item> NSJPEGFileType; </item>
<item> NSPNGFileType; </item>
<item> NSJPEG2000FileType. Not implemented </item>
</list>
*/
typedef enum _NSBitmapImageFileType {
NSTIFFFileType,
NSBMPFileType,
NSGIFFileType,
NSJPEGFileType,
NSPNGFileType,
NSJPEG2000FileType // available in Mac OS X v10.4
} NSBitmapImageFileType;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
typedef enum _NSBitmapFormat
{
NSAlphaFirstBitmapFormat = 1,
NSAlphaNonpremultipliedBitmapFormat = 2,
NSFloatingPointSamplesBitmapFormat = 4
} NSBitmapFormat;
typedef enum _NSImageRepLoadStatus
{
NSImageRepLoadStatusUnknownType = -1,
NSImageRepLoadStatusReadingHeader = -2,
NSImageRepLoadStatusWillNeedAllData = -3,
NSImageRepLoadStatusInvalidData = -4,
NSImageRepLoadStatusUnexpectedEOF = -5,
NSImageRepLoadStatusCompleted = -6
} NSImageRepLoadStatus;
#endif
APPKIT_EXPORT NSString *NSImageCompressionMethod; // NSNumber; only for TIFF files
APPKIT_EXPORT NSString *NSImageCompressionFactor; // NSNumber 0.0 to 255.0; only for JPEG files (GNUstep extension: JPEG-compressed TIFFs too)
APPKIT_EXPORT NSString *NSImageDitherTranparency; // NSNumber boolean; only for writing GIF files
APPKIT_EXPORT NSString *NSImageRGBColorTable; // NSData; only for reading & writing GIF files
APPKIT_EXPORT NSString *NSImageInterlaced; // NSNumber boolean; only for writing PNG files
APPKIT_EXPORT NSString *NSImageColorSyncProfileData; // Mac OX X only
//APPKIT_EXPORT NSString *GSImageICCProfileData; // if & when color management comes to GNUstep
APPKIT_EXPORT NSString *NSImageFrameCount; // NSNumber integer; only for reading animated GIF files
APPKIT_EXPORT NSString *NSImageCurrentFrame; // NSNumber integer; only for animated GIF files
APPKIT_EXPORT NSString *NSImageCurrentFrameDuration; // NSNumber float; only for reading animated GIF files
APPKIT_EXPORT NSString *NSImageLoopCount; // NSNumber integer; only for reading animated GIF files
APPKIT_EXPORT NSString *NSImageGamma; // NSNumber 0.0 to 1.0; only for reading & writing PNG files
APPKIT_EXPORT NSString *NSImageProgressive; // NSNumber boolean; only for reading & writing JPEG files
APPKIT_EXPORT NSString *NSImageEXIFData; // No GNUstep support yet; for reading & writing JPEG
#endif
@interface NSBitmapImageRep : NSImageRep
{
// Attributes
unsigned int _bytesPerRow;
unsigned int _numColors;
unsigned int _bitsPerPixel;
unsigned short _compression;
float _comp_factor;
NSMutableDictionary *_properties;
BOOL _isPlanar;
unsigned char **_imagePlanes;
NSData *_imageData;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
NSBitmapFormat _format;
#else
unsigned int _format;
#endif
}
//
// Allocating and Initializing a New NSBitmapImageRep Object
//
+ (id) imageRepWithData: (NSData*)imageData;
+ (NSArray*) imageRepsWithData: (NSData*)imageData;
- (id) initWithData: (NSData*)imageData;
- (id) initWithFocusedViewRect: (NSRect)rect;
- (id) initWithBitmapDataPlanes: (unsigned char**)planes
pixelsWide: (int)width
pixelsHigh: (int)height
bitsPerSample: (int)bitsPerSample
samplesPerPixel: (int)samplesPerPixel
hasAlpha: (BOOL)alpha
isPlanar: (BOOL)isPlanar
colorSpaceName: (NSString*)colorSpaceName
bytesPerRow: (int)rowBytes
bitsPerPixel: (int)pixelBits;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (void)colorizeByMappingGray:(float)midPoint
toColor:(NSColor *)midPointColor
blackMapping:(NSColor *)shadowColor
whiteMapping:(NSColor *)lightColor;
- (id)initWithBitmapHandle:(void *)bitmap;
- (id)initWithIconHandle:(void *)icon;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST)
- (int) incrementalLoadFromData: (NSData *)data complete: (BOOL)complete;
- (id) initForIncrementalLoad;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (id) initWithBitmapDataPlanes: (unsigned char**)planes
pixelsWide: (int)width
pixelsHigh: (int)height
bitsPerSample: (int)bps
samplesPerPixel: (int)spp
hasAlpha: (BOOL)alpha
isPlanar: (BOOL)isPlanar
colorSpaceName: (NSString*)colorSpaceName
bitmapFormat: (NSBitmapFormat)bitmapFormat
bytesPerRow: (int)rowBytes
bitsPerPixel: (int)pixelBits;
#endif
//
// Getting Information about the Image
//
- (int) bitsPerPixel;
- (int) samplesPerPixel;
- (BOOL) isPlanar;
- (int) numberOfPlanes;
- (int) bytesPerPlane;
- (int) bytesPerRow;
//
// Getting Image Data
//
- (unsigned char*) bitmapData;
- (void) getBitmapDataPlanes: (unsigned char**)data;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (NSBitmapFormat) bitmapFormat;
- (void) getPixel: (unsigned int[])pixelData atX: (int)x y: (int)y;
- (void) setPixel: (unsigned int[])pixelData atX: (int)x y: (int)y;
- (NSColor*) colorAtX: (int)x y: (int)y;
- (void) setColor: (NSColor*)color atX: (int)x y: (int)y;
#endif
//
// Producing a TIFF Representation of the Image
//
+ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray;
+ (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray
usingCompression: (NSTIFFCompression)type
factor: (float)factor;
- (NSData*) TIFFRepresentation;
- (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)type
factor: (float)factor;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
+ (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps
usingType:(NSBitmapImageFileType)storageType
properties:(NSDictionary *)properties;
- (NSData *)representationUsingType:(NSBitmapImageFileType)storageType
properties:(NSDictionary *)properties;
#endif
//
// Setting and Checking Compression Types
//
+ (void) getTIFFCompressionTypes: (const NSTIFFCompression**)list
count: (int*)numTypes;
+ (NSString*) localizedNameForTIFFCompressionType: (NSTIFFCompression)type;
- (BOOL) canBeCompressedUsing: (NSTIFFCompression)compression;
- (void) getCompression: (NSTIFFCompression*)compression
factor: (float*)factor;
- (void) setCompression: (NSTIFFCompression)compression
factor: (float)factor;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (void)setProperty:(NSString *)property withValue:(id)value;
- (id)valueForProperty:(NSString *)property;
#endif
@end
@interface NSBitmapImageRep (GNUstepExtension)
+ (NSArray*) imageRepsWithFile: (NSString *)filename;
@end
#endif // _GNUstep_H_NSBitmapImageRep
|