jpegStillImageNSDataRepresentation(_:)
Returns an NSData representation of a still image data and metadata attachments in a JPEG sample buffer.
Declaration
class func jpegStillImageNSDataRepresentation(_ jpegSampleBuffer: CMSampleBuffer) -> Data?Parameters
- jpegSampleBuffer:
The sample buffer carrying JPEG image data, optionally with
Exifmetadata sample buffer attachments.This method throws an Invalidargumentexception if
jpegSampleBufferisNULLor not in the JPEG format.
Return Value
An NSData representation of jpegSampleBuffer.
Discussion
This method merges the image data and Exif metadata sample buffer attachments without recompressing the image.
The returned NSData object is suitable for writing to disk.