I need to retrieve attributes dictionary from CVPixelBuffer. Printing a buffer object shows that the buffer has that dictionary:
(lldb) po imageBuffer
<CVPixelBuffer 0x282985fe0 width=886 height=1920 pixelFormat=420f iosurface=0x281a9def0 planes=2>
<Plane 0 width=886 height=1920 bytesPerRow=896>
<Plane 1 width=443 height=960 bytesPerRow=896>
<attributes={
ExtendedPixelsBottom = 0;
ExtendedPixelsLeft = 0;
ExtendedPixelsRight = 10;
...
};
} propagatedAttachments={
...
} nonPropagatedAttachments={
...
}>
iOS 15 has introduced a new method called CVPixelBufferCopyCreationAttributes that returns this attributes field.
Is it possible to achieve the same for the lower targets?
You can get all the information in this way except ExtendedPixels.
allocator is nullable
pixelFormat can be obtained by using
For ExtendedPixels information:
Hope this answer was helpful