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

Creating Pixel Buffers

CVPixelBufferCreate

Creates a single pixel buffer for a given size and pixel format.

CVPixelBufferCreateWithBytes

Creates a pixel buffer for a given size and pixel format containing data specified by a memory location.

CVPixelBufferCreateWithPlanarBytes

Creates a single pixel buffer in planar format for a given size and pixel format containing data specified by a memory location.

CVPixelBufferCreateWithIOSurface

Call to create a single pixel buffer for a passed-in IOSurface.

Inspecting Pixel Buffers

CVPixelBufferGetBaseAddress

Returns the base address of the pixel buffer.

CVPixelBufferGetBaseAddressOfPlane

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

CVPixelBufferGetBytesPerRow

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

CVPixelBufferGetBytesPerRowOfPlane

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

CVPixelBufferGetHeight

Returns the height of the pixel buffer.

CVPixelBufferGetHeightOfPlane

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

CVPixelBufferGetWidth

Returns the width of the pixel buffer.

CVPixelBufferGetWidthOfPlane

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

CVPixelBufferIsPlanar

Determines whether the pixel buffer is planar.

CVPixelBufferGetPlaneCount

Returns number of planes of the pixel buffer.

CVPixelBufferGetDataSize

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

CVPixelBufferGetPixelFormatType

Returns the pixel format type of the pixel buffer.

CVPixelBufferGetExtendedPixels

Returns the amount of extended pixel padding in the pixel buffer.

CVPixelBufferGetIOSurface

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

CVPixelBufferCreateResolvedAttributesDictionary

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

CVPixelBufferGetTypeID

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

Modifying Pixel Buffers

CVPixelBufferFillExtendedPixels

Fills the extended pixels of the pixel buffer.

CVPixelBufferLockBaseAddress

Locks the base address of the pixel buffer.

CVPixelBufferUnlockBaseAddress

Unlocks the base address of the pixel buffer.

Retaining and Releasing Pixel Buffers

CVPixelBufferRetain

Retains a pixel buffer.

CVPixelBufferRelease

Releases a pixel buffer.

Data Types

CVPixelBufferRef

A reference to a Core Video pixel buffer object.

CVPlanarComponentInfo

A structure for describing planar components.

CVPlanarPixelBufferInfo

A structure for describing planar buffers.

CVPlanarPixelBufferInfo_YCbCrPlanar

A structure for describing YCbCr planar buffers.

CVPlanarPixelBufferInfo_YCbCrBiPlanar

A structure for describing YCbCr biplanar buffers.

Callbacks

CVPixelBufferReleaseBytesCallback

A type that defines a release callback function.

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.