CVPixelBuffer

An image buffer that holds pixels in main memory.

Overview

A Core Video pixel buffer is an image buffer that holds pixels in main memory. Applications generating frames, compressing or decompressing video, or using Core Image can all make use of Core Video pixel buffers.

Topics

Inspecting Pixel Buffers

func CVPixelBufferGetBaseAddress(CVPixelBuffer)

Returns the base address of the pixel buffer.

func CVPixelBufferGetBaseAddressOfPlane(CVPixelBuffer, Int)

Returns the base address of the plane at the specified plane index.

func CVPixelBufferGetBytesPerRow(CVPixelBuffer)

Returns the number of bytes per row of the pixel buffer.

func CVPixelBufferGetBytesPerRowOfPlane(CVPixelBuffer, Int)

Returns the number of bytes per row for a plane at the specified index in the pixel buffer.

func CVPixelBufferGetHeight(CVPixelBuffer)

Returns the height of the pixel buffer.

func CVPixelBufferGetHeightOfPlane(CVPixelBuffer, Int)

Returns the height of the plane at planeIndex in the pixel buffer.

func CVPixelBufferGetWidth(CVPixelBuffer)

Returns the width of the pixel buffer.

func CVPixelBufferGetWidthOfPlane(CVPixelBuffer, Int)

Returns the width of the plane at a given index in the pixel buffer.

func CVPixelBufferIsPlanar(CVPixelBuffer)

Determines whether the pixel buffer is planar.

func CVPixelBufferGetPlaneCount(CVPixelBuffer)

Returns number of planes of the pixel buffer.

func CVPixelBufferGetDataSize(CVPixelBuffer)

Returns the data size for contiguous planes of the pixel buffer.

func CVPixelBufferGetPixelFormatType(CVPixelBuffer)

Returns the pixel format type of the pixel buffer.

func CVPixelBufferGetIOSurface(CVPixelBuffer?)

Returns the IOSurface backing the pixel buffer, or NULL if it is not backed by an IOSurface.

func CVPixelBufferCreateResolvedAttributesDictionary(CFAllocator?, CFArray?, UnsafeMutablePointer<CFDictionary?>)

Resolves an array of CFDictionary objects describing various pixel buffer attributes into a single dictionary.

func CVPixelBufferGetTypeID()

Returns the Core Foundation type identifier of the pixel buffer type.

Modifying Pixel Buffers

func CVPixelBufferFillExtendedPixels(CVPixelBuffer)

Fills the extended pixels of the pixel buffer.

Data Types

typealias CVPixelBuffer

A reference to a Core Video pixel buffer object.

struct CVPlanarComponentInfo

A structure for describing planar components.

struct CVPlanarPixelBufferInfo

A structure for describing planar buffers.

struct CVPlanarPixelBufferInfo_YCbCrPlanar

A structure for describing YCbCr planar buffers.

struct CVPlanarPixelBufferInfo_YCbCrBiPlanar

A structure for describing YCbCr biplanar buffers.

Callbacks

typealias CVPixelBufferReleaseBytesCallback

Defines a pointer to a pixel buffer release callback function, which is called when a pixel buffer created by CVPixelBufferCreateWithBytes(_:_:_:_:_:_:_:_:_:_:) is released.

typealias CVPixelBufferReleasePlanarBytesCallback

Defines a pointer to a pixel buffer release callback function, which is called when a pixel buffer created by CVPixelBufferCreateWithPlanarBytes(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:) is released.

Constants

Pixel Buffer Attribute Keys

The attributes associated with a pixel buffer.

See Also

Data Processing

CVBuffer

An abstract base class that defines how to interact with data buffers.

CVImageBuffer

An interface for managing different types of image data.

CVPixelBufferPool

A utility object for managing a recyclable set of pixel buffer objects.

CVPixelFormatDescription

An API that provides functions and types for defining custom pixel formats.