CVPixelBuffer.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. {
  2. * CVPixelBuffer.h
  3. * CoreVideo
  4. *
  5. * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  6. *
  7. }
  8. { Pascal Translation: Gale R Paeper, <[email protected]>, 2008 }
  9. {
  10. Modified for use with Free Pascal
  11. Version 210
  12. Please report any bugs to <[email protected]>
  13. }
  14. {$mode macpas}
  15. {$packenum 1}
  16. {$macro on}
  17. {$inline on}
  18. {$calling mwpascal}
  19. unit CVPixelBuffer;
  20. interface
  21. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  22. {$setc GAP_INTERFACES_VERSION := $0210}
  23. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  24. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  25. {$endc}
  26. {$ifc defined CPUPOWERPC and defined CPUI386}
  27. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  28. {$endc}
  29. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  30. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  31. {$endc}
  32. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  33. {$setc __ppc__ := 1}
  34. {$elsec}
  35. {$setc __ppc__ := 0}
  36. {$endc}
  37. {$ifc not defined __i386__ and defined CPUI386}
  38. {$setc __i386__ := 1}
  39. {$elsec}
  40. {$setc __i386__ := 0}
  41. {$endc}
  42. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  43. {$error Conflicting definitions for __ppc__ and __i386__}
  44. {$endc}
  45. {$ifc defined __ppc__ and __ppc__}
  46. {$setc TARGET_CPU_PPC := TRUE}
  47. {$setc TARGET_CPU_X86 := FALSE}
  48. {$elifc defined __i386__ and __i386__}
  49. {$setc TARGET_CPU_PPC := FALSE}
  50. {$setc TARGET_CPU_X86 := TRUE}
  51. {$elsec}
  52. {$error Neither __ppc__ nor __i386__ is defined.}
  53. {$endc}
  54. {$setc TARGET_CPU_PPC_64 := FALSE}
  55. {$ifc defined FPC_BIG_ENDIAN}
  56. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  57. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  58. {$elifc defined FPC_LITTLE_ENDIAN}
  59. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  60. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  61. {$elsec}
  62. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  63. {$endc}
  64. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  65. {$setc CALL_NOT_IN_CARBON := FALSE}
  66. {$setc OLDROUTINENAMES := FALSE}
  67. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  68. {$setc OPAQUE_UPP_TYPES := TRUE}
  69. {$setc OTCARBONAPPLICATION := TRUE}
  70. {$setc OTKERNEL := FALSE}
  71. {$setc PM_USE_SESSION_APIS := TRUE}
  72. {$setc TARGET_API_MAC_CARBON := TRUE}
  73. {$setc TARGET_API_MAC_OS8 := FALSE}
  74. {$setc TARGET_API_MAC_OSX := TRUE}
  75. {$setc TARGET_CARBON := TRUE}
  76. {$setc TARGET_CPU_68K := FALSE}
  77. {$setc TARGET_CPU_MIPS := FALSE}
  78. {$setc TARGET_CPU_SPARC := FALSE}
  79. {$setc TARGET_OS_MAC := TRUE}
  80. {$setc TARGET_OS_UNIX := FALSE}
  81. {$setc TARGET_OS_WIN32 := FALSE}
  82. {$setc TARGET_RT_MAC_68881 := FALSE}
  83. {$setc TARGET_RT_MAC_CFM := FALSE}
  84. {$setc TARGET_RT_MAC_MACHO := TRUE}
  85. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  86. {$setc TYPE_BOOL := FALSE}
  87. {$setc TYPE_EXTENDED := FALSE}
  88. {$setc TYPE_LONGLONG := TRUE}
  89. uses MacTypes, CFArray, CFBase, CFDictionary, CVBase, CVImageBuffer, CVReturns;
  90. {$ALIGN POWER}
  91. {! @header CVPixelBuffer.h
  92. @copyright 2004 Apple Computer, Inc. All rights reserved.
  93. @availability Mac OS X 10.4 or later
  94. @discussion CVPixelBuffers are CVImageBuffers that hold the pixels in main memory
  95. }
  96. //#pragma mark BufferAttributeKeys
  97. var kCVPixelBufferPixelFormatTypeKey: CFStringRef; external name '_kCVPixelBufferPixelFormatTypeKey'; (* attribute const *)
  98. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // A single CFNumber or a CFArray of CFNumbers (OSTypes)
  99. var kCVPixelBufferMemoryAllocatorKey: CFStringRef; external name '_kCVPixelBufferMemoryAllocatorKey'; (* attribute const *)
  100. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFAllocatorRef
  101. var kCVPixelBufferWidthKey: CFStringRef; external name '_kCVPixelBufferWidthKey'; (* attribute const *)
  102. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  103. var kCVPixelBufferHeightKey: CFStringRef; external name '_kCVPixelBufferHeightKey'; (* attribute const *)
  104. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  105. var kCVPixelBufferExtendedPixelsLeftKey: CFStringRef; external name '_kCVPixelBufferExtendedPixelsLeftKey'; (* attribute const *)
  106. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  107. var kCVPixelBufferExtendedPixelsTopKey: CFStringRef; external name '_kCVPixelBufferExtendedPixelsTopKey'; (* attribute const *)
  108. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  109. var kCVPixelBufferExtendedPixelsRightKey: CFStringRef; external name '_kCVPixelBufferExtendedPixelsRightKey'; (* attribute const *)
  110. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  111. var kCVPixelBufferExtendedPixelsBottomKey: CFStringRef; external name '_kCVPixelBufferExtendedPixelsBottomKey'; (* attribute const *)
  112. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  113. var kCVPixelBufferBytesPerRowAlignmentKey: CFStringRef; external name '_kCVPixelBufferBytesPerRowAlignmentKey'; (* attribute const *)
  114. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  115. var kCVPixelBufferCGBitmapContextCompatibilityKey: CFStringRef; external name '_kCVPixelBufferCGBitmapContextCompatibilityKey'; (* attribute const *)
  116. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFBoolean
  117. var kCVPixelBufferCGImageCompatibilityKey: CFStringRef; external name '_kCVPixelBufferCGImageCompatibilityKey'; (* attribute const *)
  118. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFBoolean
  119. var kCVPixelBufferOpenGLCompatibilityKey: CFStringRef; external name '_kCVPixelBufferOpenGLCompatibilityKey'; (* attribute const *)
  120. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFBoolean
  121. {!
  122. @typedef CVPixelBufferRef
  123. @abstract Based on the image buffer type. The pixel buffer implements the memory storage for an image buffer.
  124. }
  125. type
  126. CVPixelBufferRef = CVImageBufferRef;
  127. function CVPixelBufferGetTypeID: CFTypeID; external name '_CVPixelBufferGetTypeID';
  128. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  129. {!
  130. @function CVPixelBufferRetain
  131. @abstract Retains a CVPixelBuffer object
  132. @discussion Equivalent to CFRetain, but NULL safe
  133. @param buffer A CVPixelBuffer object that you want to retain.
  134. @result A CVPixelBuffer object that is the same as the passed in buffer.
  135. }
  136. function CVPixelBufferRetain( texture: CVPixelBufferRef ): CVPixelBufferRef; external name '_CVPixelBufferRetain';
  137. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  138. {!
  139. @function CVPixelBufferRelease
  140. @abstract Releases a CVPixelBuffer object
  141. @discussion Equivalent to CFRelease, but NULL safe
  142. @param buffer A CVPixelBuffer object that you want to release.
  143. }
  144. procedure CVPixelBufferRelease( texture: CVPixelBufferRef ); external name '_CVPixelBufferRelease';
  145. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  146. {!
  147. @function CVPixelBufferCreateResolvedAttributesDictionary
  148. @abstract Takes a CFArray of CFDictionary objects describing various pixel buffer attributes and tries to resolve them into a
  149. single dictionary.
  150. @discussion This is useful when you need to resolve multiple requirements between different potential clients of a buffer.
  151. @param attributes CFArray of CFDictionaries containing kCVPixelBuffer key/value pairs.
  152. @param resolvedDictionaryOut The resulting dictionary will be placed here.
  153. @result Return value that may be useful in discovering why resolution failed.
  154. }
  155. function CVPixelBufferCreateResolvedAttributesDictionary( allocator: CFAllocatorRef; attributes: CFArrayRef; var resolvedDictionaryOut: CFDictionaryRef ): CVReturn; external name '_CVPixelBufferCreateResolvedAttributesDictionary';
  156. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  157. {!
  158. @function CVPixelBufferCreate
  159. @abstract Call to create a single PixelBuffer for a given size and pixelFormatType.
  160. @discussion Creates a single PixelBuffer for a given size and pixelFormatType. It allocates the necessary memory based on the pixel dimensions, pixelFormatType and extended pixels described in the pixelBufferAttributes. Not all parameters of the pixelBufferAttributes will be used here.
  161. @param width Width of the PixelBuffer in pixels.
  162. @param height Height of the PixelBuffer in pixels.
  163. @param pixelFormatType Pixel format indentified by its respective OSType.
  164. @param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
  165. @param pixelBufferOut The new pixel buffer will be returned here
  166. @result returns kCVReturnSuccess on success.
  167. }
  168. function CVPixelBufferCreate( allocator: CFAllocatorRef; width: size_t; height: size_t; pixelFormatType: OSType; pixelBufferAttributes: CFDictionaryRef; var pixelBufferOut: CVPixelBufferRef ): CVReturn; external name '_CVPixelBufferCreate';
  169. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  170. type
  171. CVPixelBufferReleaseBytesCallback = procedure( releaseRefCon: UnivPtr; baseAddress: {const} UnivPtr );
  172. {!
  173. @function CVPixelBufferCreateWithBytes
  174. @abstract Call to create a single PixelBuffer for a given size and pixelFormatType based on a passed in piece of memory.
  175. @discussion Creates a single PixelBuffer for a given size and pixelFormatType. Not all parameters of the pixelBufferAttributes will be used here. It requires a release callback function that will be called, when the PixelBuffer gets destroyed so that the owner of the pixels can free the memory.
  176. @param width Width of the PixelBuffer in pixels
  177. @param height Height of the PixelBuffer in pixels
  178. @param pixelFormatType Pixel format indentified by its respective OSType.
  179. @param baseAddress Address of the memory storing the pixels.
  180. @param bytesPerRow Row bytes of the pixel storage memory.
  181. @param releaseCallback CVPixelBufferReleaseBytePointerCallback function that gets called when the PixelBuffer gets destroyed.
  182. @param releaseRefCon User data identifying the PixelBuffer for the release callback.
  183. @param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
  184. @param pixelBufferOut The new pixel buffer will be returned here
  185. @result returns kCVReturnSuccess on success.
  186. }
  187. function CVPixelBufferCreateWithBytes( allocator: CFAllocatorRef; width: size_t; height: size_t; pixelFormatType: OSType; baseAddress: UnivPtr; bytesPerRow: size_t; releaseCallback: CVPixelBufferReleaseBytesCallback; releaseRefCon: UnivPtr; pixelBufferAttributes: CFDictionaryRef; var pixelBufferOut: CVPixelBufferRef ): CVReturn; external name '_CVPixelBufferCreateWithBytes';
  188. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  189. type
  190. CVPixelBufferReleasePlanarBytesCallback = procedure( releaseRefCon: UnivPtr; dataPtr: {const} UnivPtr; dataSize: size_t; numberOfPlanes: size_t; {const} planeAddresses: {variable-size-array} UnivPtr );
  191. {!
  192. @function CVPixelBufferCreateWithPlanarBytes
  193. @abstract Call to create a single PixelBuffer in planar format for a given size and pixelFormatType based on a passed in piece of memory.
  194. @discussion Creates a single PixelBuffer for a given size and pixelFormatType. Not all parameters of the pixelBufferAttributes will be used here. It requires a release callback function that will be called, when the PixelBuffer gets destroyed so that the owner of the pixels can free the memory.
  195. @param width Width of the PixelBuffer in pixels
  196. @param height Height of the PixelBuffer in pixels
  197. @param pixelFormatType Pixel format indentified by its respective OSType.
  198. @param dataPtr Pass a pointer to a plane descriptor block, or NULL.
  199. @param dataSize pass size if planes are contiguous, NULL if not.
  200. @param numberOfPlanes Number of planes.
  201. @param planeBaseAddress Array of base addresses for the planes.
  202. @param planeWidth Array of plane widths.
  203. @param planeHeight Array of plane heights.
  204. @param planeBytesPerRow Array of plane bytesPerRow values.
  205. @param releaseCallback CVPixelBufferReleaseBytePointerCallback function that gets called when the PixelBuffer gets destroyed.
  206. @param releaseRefCon User data identifying the PixelBuffer for the release callback.
  207. @param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
  208. @param pixelBufferOut The new pixel buffer will be returned here
  209. @result returns kCVReturnSuccess on success.
  210. }
  211. function CVPixelBufferCreateWithPlanarBytes( allocator: CFAllocatorRef; width: size_t; height: size_t; pixelFormatType: OSType; dataPtr: {pass a pointer to a plane descriptor block, or NULL} UnivPtr; dataSize: {pass size if planes are contiguous, NULL if not} size_t; numberOfPlanes: size_t; planeAddresses: {variable-size-array} UnivPtr; planeWidth: {variable-size-array} size_t_Ptr; planeHeight: {variable-size-array} size_t_Ptr; planeBytesPerRow: {variable-size-array} size_t_Ptr; releaseCallback: CVPixelBufferReleasePlanarBytesCallback; releaseRefCon: UnivPtr; pixelBufferAttributes: CFDictionaryRef; var pixelBufferOut: CVPixelBufferRef ): CVReturn; external name '_CVPixelBufferCreateWithPlanarBytes';
  212. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  213. {!
  214. @function CVPixelBufferLockBaseAddress
  215. @abstract Description Locks the BaseAddress of the PixelBuffer to ensure that the is available.
  216. @param pixelBuffer Target PixelBuffer.
  217. @param lockFlags No options currently defined, pass 0.
  218. @result kCVReturnSuccess if the lock succeeded, or error code on failure
  219. }
  220. function CVPixelBufferLockBaseAddress( pixelBuffer: CVPixelBufferRef; lockFlags: CVOptionFlags ): CVReturn; external name '_CVPixelBufferLockBaseAddress';
  221. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  222. {!
  223. @function CVPixelBufferUnlockBaseAddress
  224. @abstract Description Unlocks the BaseAddress of the PixelBuffer.
  225. @param pixelBuffer Target PixelBuffer.
  226. @param unlockFlags No options currently defined, pass 0.
  227. @result kCVReturnSuccess if the unlock succeeded, or error code on failure
  228. }
  229. function CVPixelBufferUnlockBaseAddress( pixelBuffer: CVPixelBufferRef; unlockFlags: CVOptionFlags ): CVReturn; external name '_CVPixelBufferUnlockBaseAddress';
  230. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  231. {!
  232. @function CVPixelBufferGetWidth
  233. @abstract Returns the width of the PixelBuffer.
  234. @param pixelBuffer Target PixelBuffer.
  235. @result Width in pixels.
  236. }
  237. function CVPixelBufferGetWidth( pixelBuffer: CVPixelBufferRef ): size_t; external name '_CVPixelBufferGetWidth';
  238. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  239. {!
  240. @function CVPixelBufferGetHeight
  241. @abstract Returns the height of the PixelBuffer.
  242. @param pixelBuffer Target PixelBuffer.
  243. @result Height in pixels.
  244. }
  245. function CVPixelBufferGetHeight( pixelBuffer: CVPixelBufferRef ): size_t; external name '_CVPixelBufferGetHeight';
  246. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  247. {!
  248. @function CVPixelBufferGetPixelFormatType
  249. @abstract Returns the PixelFormatType of the PixelBuffer.
  250. @param pixelBuffer Target PixelBuffer.
  251. @result OSType identifying the pixel format by its type.
  252. }
  253. function CVPixelBufferGetPixelFormatType( pixelBuffer: CVPixelBufferRef ): OSType; external name '_CVPixelBufferGetPixelFormatType';
  254. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  255. {!
  256. @function CVPixelBufferGetBaseAddress
  257. @abstract Returns the base address of the PixelBuffer.
  258. @discussion Retrieving the base address for a PixelBuffer requires that the buffer base address be locked
  259. via a successful call to CVPixelBufferLockBaseAddress.
  260. @param pixelBuffer Target PixelBuffer.
  261. @result Base address of the pixels.
  262. For chunky buffers, this will return a pointer to the pixel at 0,0 in the buffer
  263. For planar buffers this will return a pointer to a PlanarComponentInfo struct (defined in QuickTime).
  264. }
  265. function CVPixelBufferGetBaseAddress( pixelBuffer: CVPixelBufferRef ): UnivPtr; external name '_CVPixelBufferGetBaseAddress';
  266. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  267. {!
  268. @function CVPixelBufferGetBytesPerRow
  269. @abstract Returns the rowBytes of the PixelBuffer.
  270. @param pixelBuffer Target PixelBuffer.
  271. @result Bytes per row of the image data. For planar buffers this will return a rowBytes value such that bytesPerRow * height
  272. will cover the entire image including all planes.
  273. }
  274. function CVPixelBufferGetBytesPerRow( pixelBuffer: CVPixelBufferRef ): size_t; external name '_CVPixelBufferGetBytesPerRow';
  275. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  276. {!
  277. @function CVPixelBufferGetDataSize
  278. @abstract Returns the data size for contigous planes of the PixelBuffer.
  279. @param pixelBuffer Target PixelBuffer.
  280. @result Data size used in CVPixelBufferCreateWithPlanarBytes.
  281. }
  282. function CVPixelBufferGetDataSize( pixelBuffer: CVPixelBufferRef ): size_t; external name '_CVPixelBufferGetDataSize';
  283. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  284. {!
  285. @function CVPixelBufferIsPlanar
  286. @abstract Returns if the PixelBuffer is planar.
  287. @param pixelBuffer Target PixelBuffer.
  288. @result True if the PixelBuffer was created using CVPixelBufferCreateWithPlanarBytes.
  289. }
  290. function CVPixelBufferIsPlanar( pixelBuffer: CVPixelBufferRef ): Boolean; external name '_CVPixelBufferIsPlanar';
  291. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  292. {!
  293. @function CVPixelBufferGetPlaneCount
  294. @abstract Returns number of planes of the PixelBuffer.
  295. @param pixelBuffer Target PixelBuffer.
  296. @result Number of planes. Returns 0 for non-planar CVPixelBufferRefs.
  297. }
  298. function CVPixelBufferGetPlaneCount( pixelBuffer: CVPixelBufferRef ): size_t; external name '_CVPixelBufferGetPlaneCount';
  299. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  300. {!
  301. @function CVPixelBufferGetWidthOfPlane
  302. @abstract Returns the width of the plane at planeIndex in the PixelBuffer.
  303. @param pixelBuffer Target PixelBuffer.
  304. @param planeIndex Identifying the plane.
  305. @result Width in pixels, or 0 for non-planar CVPixelBufferRefs.
  306. }
  307. function CVPixelBufferGetWidthOfPlane( pixelBuffer: CVPixelBufferRef; planeIndex: size_t ): size_t; external name '_CVPixelBufferGetWidthOfPlane';
  308. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  309. {!
  310. @function CVPixelBufferGetHeightOfPlane
  311. @abstract Returns the height of the plane at planeIndex in the PixelBuffer.
  312. @param pixelBuffer Target PixelBuffer.
  313. @param planeIndex Identifying the plane.
  314. @result Height in pixels, or 0 for non-planar CVPixelBufferRefs.
  315. }
  316. function CVPixelBufferGetHeightOfPlane( pixelBuffer: CVPixelBufferRef; planeIndex: size_t ): size_t; external name '_CVPixelBufferGetHeightOfPlane';
  317. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  318. {!
  319. @function CVPixelBufferGetBaseAddressOfPlane
  320. @abstract Returns the base address of the plane at planeIndex in the PixelBuffer.
  321. @discussion Retrieving the base address for a PixelBuffer requires that the buffer base address be locked
  322. via a successful call to CVPixelBufferLockBaseAddress.
  323. @param pixelBuffer Target PixelBuffer.
  324. @param planeIndex Identifying the plane.
  325. @result Base address of the plane, or NULL for non-planar CVPixelBufferRefs.
  326. }
  327. function CVPixelBufferGetBaseAddressOfPlane( pixelBuffer: CVPixelBufferRef; planeIndex: size_t ): UnivPtr; external name '_CVPixelBufferGetBaseAddressOfPlane';
  328. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  329. {!
  330. @function CVPixelBufferGetBytesPerRowOfPlane
  331. @abstract Returns the row bytes of the plane at planeIndex in the PixelBuffer.
  332. @param pixelBuffer Target PixelBuffer.
  333. @param planeIndex Identifying the plane.
  334. @result Row bytes of the plane, or NULL for non-planar CVPixelBufferRefs.
  335. }
  336. function CVPixelBufferGetBytesPerRowOfPlane( pixelBuffer: CVPixelBufferRef; planeIndex: size_t ): size_t; external name '_CVPixelBufferGetBytesPerRowOfPlane';
  337. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  338. {!
  339. @function CVPixelBufferGetExtendedPixels
  340. @abstract Returns the size of extended pixels of the PixelBuffer.
  341. @param pixelBuffer Target PixelBuffer.
  342. @param extraColumnsOnLeft Returns the pixel row padding to the left. May be NULL.
  343. @param extraRowsOnTop Returns the pixel row padding to the top. May be NULL.
  344. @param extraColumnsOnRight Returns the pixel row padding to the right. May be NULL.
  345. @param extraRowsOnBottom Returns the pixel row padding to the bottom. May be NULL.
  346. }
  347. procedure CVPixelBufferGetExtendedPixels( pixelBuffer: CVPixelBufferRef; var extraColumnsOnLeft: size_t; var extraColumnsOnRight: size_t; var extraRowsOnTop: size_t; var extraRowsOnBottom: size_t ); external name '_CVPixelBufferGetExtendedPixels';
  348. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  349. {!
  350. @function CVPixelBufferFillExtendedPixels
  351. @abstract Fills the extended pixels of the PixelBuffer with Zero. This function replicates edge pixels to fill the entire extended region of the image.
  352. @param pixelBuffer Target PixelBuffer.
  353. }
  354. function CVPixelBufferFillExtendedPixels( pixelBuffer: CVPixelBufferRef ): CVReturn; external name '_CVPixelBufferFillExtendedPixels';
  355. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  356. end.