NSBitmapImageRep.inc 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. { Parsed from AppKit.framework NSBitmapImageRep.h }
  2. {$ifdef TYPES}
  3. type
  4. NSBitmapImageRepPtr = ^NSBitmapImageRep;
  5. {$endif}
  6. {$ifdef TYPES}
  7. type
  8. NSTIFFCompression = NSUInteger;
  9. NSTIFFCompressionPtr = ^NSTIFFCompression;
  10. const
  11. NSTIFFCompressionNone = 1;
  12. NSTIFFCompressionCCITTFAX3 = 3;
  13. NSTIFFCompressionCCITTFAX4 = 4;
  14. NSTIFFCompressionLZW = 5;
  15. NSTIFFCompressionJPEG = 6;
  16. NSTIFFCompressionNEXT = 32766;
  17. NSTIFFCompressionPackBits = 32773;
  18. NSTIFFCompressionOldJPEG = 32865;
  19. type
  20. NSBitmapImageFileType = NSUInteger;
  21. NSBitmapImageFileTypePtr = ^NSBitmapImageFileType;
  22. const
  23. NSTIFFFileType = 0;
  24. NSBMPFileType = 1;
  25. NSGIFFileType = 2;
  26. NSJPEGFileType = 3;
  27. NSPNGFileType = 4;
  28. NSJPEG2000FileType = 5;
  29. type
  30. NSImageRepLoadStatus = NSInteger;
  31. NSImageRepLoadStatusPtr = ^NSImageRepLoadStatus;
  32. const
  33. NSImageRepLoadStatusUnknownType = -1;
  34. NSImageRepLoadStatusReadingHeader = -2;
  35. NSImageRepLoadStatusWillNeedAllData = -3;
  36. NSImageRepLoadStatusInvalidData = -4;
  37. NSImageRepLoadStatusUnexpectedEOF = -5;
  38. NSImageRepLoadStatusCompleted = -6;
  39. type
  40. NSBitmapFormat = NSUInteger;
  41. NSBitmapFormatPtr = ^NSBitmapFormat;
  42. const
  43. NSAlphaFirstBitmapFormat = 1 shl 0;
  44. NSAlphaNonpremultipliedBitmapFormat = 1 shl 1;
  45. NSFloatingPointSamplesBitmapFormat = 1 shl 2;
  46. NS16BitLittleEndianBitmapFormat = 1 shl 8 { available in 10_10 };
  47. NS32BitLittleEndianBitmapFormat = 1 shl 9 { available in 10_10 };
  48. NS16BitBigEndianBitmapFormat = 1 shl 10 { available in 10_10 };
  49. NS32BitBigEndianBitmapFormat = 1 shl 11 { available in 10_10 };
  50. {$endif}
  51. {$ifdef EXTERNAL_SYMBOLS}
  52. var
  53. NSImageCompressionMethod: NSString; cvar; external;
  54. NSImageCompressionFactor: NSString; cvar; external;
  55. NSImageDitherTransparency: NSString; cvar; external;
  56. NSImageRGBColorTable: NSString; cvar; external;
  57. NSImageInterlaced: NSString; cvar; external;
  58. NSImageColorSyncProfileData: NSString; cvar; external;
  59. NSImageFrameCount: NSString; cvar; external;
  60. NSImageCurrentFrame: NSString; cvar; external;
  61. NSImageCurrentFrameDuration: NSString; cvar; external;
  62. NSImageLoopCount: NSString; cvar; external;
  63. NSImageGamma: NSString; cvar; external;
  64. NSImageProgressive: NSString; cvar; external;
  65. NSImageEXIFData: NSString; cvar; external;
  66. NSImageFallbackBackgroundColor: NSString { available in 10_5 }; cvar; external;
  67. {$endif}
  68. {$ifdef CLASSES}
  69. type
  70. NSBitmapImageRep = objcclass external (NSImageRep, NSSecureCodingProtocol)
  71. private
  72. _moreRepFlags: bitpacked record
  73. case byte of
  74. 0: (_anonBitField__moreRepFlags0: cuint);
  75. 1: (
  76. bitsPerPixel: 0..((1 shl 8)-1);
  77. isPlanar: 0..1;
  78. explicitPlanes: 0..1;
  79. imageSourceIsIndexed: 0..1;
  80. dataLoaded: 0..1;
  81. colorModel: 0..((1 shl 4)-1);
  82. tierTwoInfoIsLoaded: 0..1;
  83. respectO: 0..1;
  84. compressionFactor: 0..((1 shl 14)-1);
  85. imageNumber: 0..((1 shl 8)-1);
  86. bitmapFormat: 0..((1 shl 3)-1);
  87. cgImageIsPrimary: 0..1;
  88. compression: 0..((1 shl 20)-1);
  89. );
  90. end;
  91. _bytesPerRow: cuint;
  92. _dataObj: id;
  93. _tiffData: NSData;
  94. _properties: id;
  95. public
  96. function initWithFocusedViewRect (rect: NSRect): instancetype; message 'initWithFocusedViewRect:';
  97. function initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel (planes: PChar; width: NSInteger; height: NSInteger; bps: NSInteger; spp: NSInteger; alpha: ObjCBOOL; isPlanar: ObjCBOOL; colorSpaceName_: NSString; rBytes: NSInteger; pBits: NSInteger): instancetype; message 'initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:';
  98. function initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel (planes: PChar; width: NSInteger; height: NSInteger; bps: NSInteger; spp: NSInteger; alpha: ObjCBOOL; isPlanar: ObjCBOOL; colorSpaceName_: NSString; bitmapFormat: NSBitmapFormat; rBytes: NSInteger; pBits: NSInteger): instancetype; message 'initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:';
  99. function initWithCGImage (cgImage: CGImageRef): instancetype; message 'initWithCGImage:'; { available in 10_5 }
  100. function initWithCIImage (ciImage_: CIImage): instancetype; message 'initWithCIImage:'; { available in 10_5 }
  101. class function imageRepsWithData (data: NSData): NSArray; message 'imageRepsWithData:';
  102. class function imageRepWithData (data: NSData): instancetype; message 'imageRepWithData:';
  103. function initWithData (data: NSData): instancetype; message 'initWithData:';
  104. function bitmapData: PChar; message 'bitmapData';
  105. procedure getBitmapDataPlanes (data: PChar); message 'getBitmapDataPlanes:';
  106. function isPlanar: ObjCBOOL; message 'isPlanar';
  107. function samplesPerPixel: NSInteger; message 'samplesPerPixel';
  108. function bitsPerPixel: NSInteger; message 'bitsPerPixel';
  109. function bytesPerRow: NSInteger; message 'bytesPerRow';
  110. function bytesPerPlane: NSInteger; message 'bytesPerPlane';
  111. function numberOfPlanes: NSInteger; message 'numberOfPlanes';
  112. function bitmapFormat: NSBitmapFormat; message 'bitmapFormat';
  113. procedure getCompression_factor (compression: NSTIFFCompressionPtr; factor: psingle); message 'getCompression:factor:';
  114. procedure setCompression_factor (compression: NSTIFFCompression; factor: single); message 'setCompression:factor:';
  115. function TIFFRepresentation: NSData; message 'TIFFRepresentation';
  116. function TIFFRepresentationUsingCompression_factor (comp: NSTIFFCompression; factor: single): NSData; message 'TIFFRepresentationUsingCompression:factor:';
  117. class function TIFFRepresentationOfImageRepsInArray (array_: NSArray): NSData; message 'TIFFRepresentationOfImageRepsInArray:';
  118. class function TIFFRepresentationOfImageRepsInArray_usingCompression_factor (array_: NSArray; comp: NSTIFFCompression; factor: single): NSData; message 'TIFFRepresentationOfImageRepsInArray:usingCompression:factor:';
  119. class procedure getTIFFCompressionTypes_count (list: NSTIFFCompressionPtr; numTypes: NSIntegerPtr); message 'getTIFFCompressionTypes:count:';
  120. class function localizedNameForTIFFCompressionType (compression: NSTIFFCompression): NSString; message 'localizedNameForTIFFCompressionType:';
  121. function canBeCompressedUsing (compression: NSTIFFCompression): ObjCBOOL; message 'canBeCompressedUsing:';
  122. procedure colorizeByMappingGray_toColor_blackMapping_whiteMapping (midPoint: CGFloat; midPointColor: NSColor; shadowColor: NSColor; lightColor: NSColor); message 'colorizeByMappingGray:toColor:blackMapping:whiteMapping:';
  123. function initForIncrementalLoad: instancetype; message 'initForIncrementalLoad';
  124. function incrementalLoadFromData_complete (data: NSData; complete: ObjCBOOL): NSInteger; message 'incrementalLoadFromData:complete:';
  125. procedure setColor_atX_y (color: NSColor; x: NSInteger; y: NSInteger); message 'setColor:atX:y:';
  126. function colorAtX_y (x: NSInteger; y: NSInteger): NSColor; message 'colorAtX:y:';
  127. procedure getPixel_atX_y (p: NSUIntegerPtr { variable size array of NSUInteger }; x: NSInteger; y: NSInteger); message 'getPixel:atX:y:';
  128. procedure setPixel_atX_y (p: NSUIntegerPtr { variable size array of NSUInteger }; x: NSInteger; y: NSInteger); message 'setPixel:atX:y:';
  129. function CGImage: CGImageRef; message 'CGImage';
  130. function colorSpace: NSColorSpace; message 'colorSpace';
  131. function bitmapImageRepByConvertingToColorSpace_renderingIntent (targetSpace: NSColorSpace; renderingIntent: NSColorRenderingIntent): NSBitmapImageRep; message 'bitmapImageRepByConvertingToColorSpace:renderingIntent:'; { available in 10_6 }
  132. function bitmapImageRepByRetaggingWithColorSpace (newSpace: NSColorSpace): NSBitmapImageRep; message 'bitmapImageRepByRetaggingWithColorSpace:'; { available in 10_6 }
  133. { Adopted protocols }
  134. class function supportsSecureCoding: ObjCBOOL; message 'supportsSecureCoding';
  135. end;
  136. type
  137. NSBitmapImageFileTypeExtensions = objccategory external (NSBitmapImageRep)
  138. class function representationOfImageRepsInArray_usingType_properties (imageReps: NSArray; storageType: NSBitmapImageFileType; properties: NSDictionary): NSData; message 'representationOfImageRepsInArray:usingType:properties:';
  139. function representationUsingType_properties (storageType: NSBitmapImageFileType; properties: NSDictionary): NSData; message 'representationUsingType:properties:';
  140. procedure setProperty_withValue (property_: NSString; value: id); message 'setProperty:withValue:';
  141. function valueForProperty (property_: NSString): id; message 'valueForProperty:';
  142. end;
  143. {$endif}