pixelBuffer
TypeScriptget pixelBuffer(): _CoreVideo_CVReadOnlyPixelBufferSwift declarationvar pixelBuffer: CVReadOnlyPixelBuffer { get }struct · iOS 18.0+ · SDK 27.1
struct PixelBufferObservationAn object that represents an image that an image analysis request produces.
get pixelBuffer(): _CoreVideo_CVReadOnlyPixelBufferSwift declarationvar pixelBuffer: CVReadOnlyPixelBuffer { get }get confidence(): numberSwift declarationlet confidence: FloatThe level of confidence normalized to `[0, 1]` where `1` is most confident. The only exception is results coming from `CoreMLRequest`, where confidence values are forwarded as is from relevant CoreML models
get description(): stringSwift declarationvar description: String { get }A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.
get pixelFormat(): SDKHandleSwift declarationvar pixelFormat: OSType { get }The four-character code OSType identifier for the pixel format.
get originatingRequestDescriptor(): (RequestDescriptor) | nullSwift declarationlet originatingRequestDescriptor: RequestDescriptor?The descriptor of the request that produced the observation.
get size(): { width: number; height: number }Swift declarationvar size: CGSize { get }The size of the observation image.
get uuid(): stringSwift declarationlet uuid: UUIDThe unique identifier for the observation.
pixel(point: NormalizedPoint): numberSwift declarationfunc pixel(at point: NormalizedPoint) -> FloatReturns the pixel data for the specified location in the image
get cgImage(): _CoreGraphics_CGImageSwift declarationvar cgImage: CGImage { get throws }A Core Graphics image created from the pixel buffer observation.
get timeRange(): (_CoreMedia_CMTimeRange) | nullSwift declarationlet timeRange: CMTimeRange?The time range of the reported observation. When evaluating a sequence of image buffers, use this property to determine each observation’s start time and duration.
static init(observation: VNPixelBufferObservation): (PixelBufferObservation) | nullSwift declarationinit?(_ observation: VNPixelBufferObservation)1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
PixelBufferObservation.withUnsafePointer(_:)
callback cannot propagate synchronous failure