<!--
{
  "documentType" : "article",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/cvimagebuffer-q40",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CVImageBuffer"
}
-->

# CVImageBuffer

An interface for managing different types of image data.

## Discussion

Core Video image buffers provides a convenient interface for managing different types of image data. Pixel buffers and Core Video OpenGL buffers derive from the Core Video image buffer.

## Topics

### Inspecting image buffers

[`CVImageBufferGetCleanRect`](/documentation/CoreVideo/CVImageBufferGetCleanRect(_:))

Returns the source rectangle of a Core Video image buffer that represents the clean aperture of the buffer in encoded pixels.

[`CVImageBufferGetColorSpace`](/documentation/CoreVideo/CVImageBufferGetColorSpace(_:))

Returns the color space of a Core Video image buffer.

[`CVImageBufferGetDisplaySize`](/documentation/CoreVideo/CVImageBufferGetDisplaySize(_:))

Returns the nominal output display size, in square pixels, of a Core Video image buffer.

[`CVImageBufferGetEncodedSize`](/documentation/CoreVideo/CVImageBufferGetEncodedSize(_:))

Returns the full encoded dimensions of a Core Video image buffer.

[`CVImageBufferIsFlipped`](/documentation/CoreVideo/CVImageBufferIsFlipped(_:))

Returns a Boolean value indicating whether the image is vertically flipped.

### Creating color spaces

[`CVImageBufferCreateColorSpaceFromAttachments`](/documentation/CoreVideo/CVImageBufferCreateColorSpaceFromAttachments(_:))

Attempts to create a Core Graphics color space from the image buffer’s attachments that you specify.

### Protocols

[`CVImageBufferRepresentable`](/documentation/CoreVideo/CVImageBufferRepresentable)

CVImageBufferRepresentable protocol is a sealed protocol intended to be implemented by the
types in CoreVideo framework. This protocol facilitates Swift types that wrap a value
of CVImageBuffer type.

[`CVImageBufferAttachmentKeyDefinitions`](/documentation/CoreVideo/CVImageBufferAttachmentKeyDefinitions)

A namespace for image buffer attachment keys.

### Data types

[`CVImageBuffer`](/documentation/CoreVideo/CVImageBuffer)

A reference to a Core Video image buffer.

[`CVImageSize`](/documentation/CoreVideo/CVImageSize)

Size of image buffer expressed as pixel count.

[`CVImageBufferOriginPosition`](/documentation/CoreVideo/CVImageBufferOriginPosition)

[`CVImageCleanAperture`](/documentation/CoreVideo/CVImageCleanAperture)

An image’s clean aperture is a region of video to display.

[`CVImagePixelAspectRatio`](/documentation/CoreVideo/CVImagePixelAspectRatio)

Aspect ratio of each pixel in the image buffer.

[`CVImageDisplayMaskRectangle`](/documentation/CoreVideo/CVImageDisplayMaskRectangle)

Specifies the rectangular display area within the image.

[`CVImageStereoDisplayMaskRectangle`](/documentation/CoreVideo/CVImageStereoDisplayMaskRectangle)

Specifies the rectangular display area within a view of stereo image.

[`CVImageChromaField`](/documentation/CoreVideo/CVImageChromaField)

Information about chroma field in the 2VUY format image data.

### Color and signal characteristics

[`CVImageColorPrimaries`](/documentation/CoreVideo/CVImageColorPrimaries)

Color primaries describe the gamut used for the rendering intent of an image.

[`CVImageTransferFunction`](/documentation/CoreVideo/CVImageTransferFunction)

The transfer function describes the tonality of an image for use in color matching operations.
This value is used along with a color primaries gamut [`CVImageColorPrimaries`](/documentation/CoreVideo/CVImageColorPrimaries). Most apps should use the
[`CVImageTransferFunction.itu_R_709_2`](/documentation/CoreVideo/CVImageTransferFunction/itu_R_709_2) transfer function.

[`CVImageLogTransferFunction`](/documentation/CoreVideo/CVImageLogTransferFunction)

Identifies the specific log curve transfer function or gamma of the content.

[`CVImageYCbCrMatrix`](/documentation/CoreVideo/CVImageYCbCrMatrix)

Indicates color matrix used for converting image buffer from YCbCr to RGB.

[`CVImageAlphaChannelMode`](/documentation/CoreVideo/CVImageAlphaChannelMode)

[`CVImageFieldDetail`](/documentation/CoreVideo/CVImageFieldDetail)

### Converting between strings and integer code points

[`CVColorPrimariesGetIntegerCodePointForString`](/documentation/CoreVideo/CVColorPrimariesGetIntegerCodePointForString(_:))

Returns the standard integer code point corresponding to the Core Video color primaries constant string that you specify.

[`CVColorPrimariesGetStringForIntegerCodePoint`](/documentation/CoreVideo/CVColorPrimariesGetStringForIntegerCodePoint(_:))

Returns the Core Video color primaries string corresponding to the standard integer code point that you specify.

[`CVTransferFunctionGetIntegerCodePointForString`](/documentation/CoreVideo/CVTransferFunctionGetIntegerCodePointForString(_:))

Returns the standard integer code point corresponding to the Core Video transfer function string that you specify.

[`CVTransferFunctionGetStringForIntegerCodePoint`](/documentation/CoreVideo/CVTransferFunctionGetStringForIntegerCodePoint(_:))

Returns the Core Video transfer function string corresponding to the standard integer code point that you specify.

[`CVYCbCrMatrixGetIntegerCodePointForString`](/documentation/CoreVideo/CVYCbCrMatrixGetIntegerCodePointForString(_:))

Returns the standard integer code point corresponding to the Core Video YCbCr matrix string that you specify.

[`CVYCbCrMatrixGetStringForIntegerCodePoint`](/documentation/CoreVideo/CVYCbCrMatrixGetStringForIntegerCodePoint(_:))

Returns the Core Video YCbCr matrix string corresponding to the standard integer code point that you specify.

### Constants

[Image Buffer Attachment Keys](/documentation/CoreVideo/image-buffer-attachment-keys)

Keys that describe the attachment types associated with image buffers.

[Image Buffer Clean Aperture Keys](/documentation/CoreVideo/image-buffer-clean-aperture-keys)

Keys that describe the clean aperture of an image buffer.

[Image Buffer Pixel Aspect Ratio Keys](/documentation/CoreVideo/image-buffer-pixel-aspect-ratio-keys)

Keys that describe the pixel aspect ratio of an image buffer.

[Image Buffer Display Dimensions Keys](/documentation/CoreVideo/image-buffer-display-dimensions-keys)

Keys that describe the display dimensions of an image buffer.

[Image Buffer Field Detail Constants](/documentation/CoreVideo/image-buffer-field-detail-constants)

Constants that indicate the field order of interlaced video in an image buffer.

[Image Buffer YCbCr Matrix Constants](/documentation/CoreVideo/image-buffer-ycbcr-matrix-constants)

Constants that indicate the type of conversion matrix Core Video uses when it converts image buffer data from the YCbCr color space to the RGB color space.

[Image Buffer Color Primaries Constants](/documentation/CoreVideo/image-buffer-color-primaries-constants)

Constants that indicate the color primaries gamut for the image buffer.

[Image Buffer Transfer Function Constants](/documentation/CoreVideo/image-buffer-transfer-function-constants)

Constants that indicate the transfer function for the image buffer.

[Image Buffer Chroma Location Constants](/documentation/CoreVideo/image-buffer-chroma-location-constants)

Constants that indicate locations for chroma samples in the image buffer.

[Image Buffer Chroma Subsampling Constants](/documentation/CoreVideo/image-buffer-chroma-subsampling-constants)

Constants that indicate the original format of subsampled data in the image buffer before conversion to 422/2vuy format.

[Image Buffer Display Mask Rectangle Keys](/documentation/CoreVideo/image-buffer-display-mask-rectangle-keys)

Keys that describe the display dimensions of an image buffer mask.

[`kCVImageBufferDisplayMaskRectangleKey`](/documentation/CoreVideo/kCVImageBufferDisplayMaskRectangleKey)

Specifies the rectangular display area within the image.

[`kCVImageBufferDisplayMaskRectangleStereoLeftKey`](/documentation/CoreVideo/kCVImageBufferDisplayMaskRectangleStereoLeftKey)

Specifies the rectangular display area within the left-eye view of stereo images, using the same keys as `kCVImageBufferDisplayMaskRectangleKey`.

[`kCVImageBufferDisplayMaskRectangleStereoRightKey`](/documentation/CoreVideo/kCVImageBufferDisplayMaskRectangleStereoRightKey)

Specifies the rectangular display area within the right-eye view of stereo images, using the same keys as `kCVImageBufferDisplayMaskRectangleKey`.

## See Also

  [Core Video Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/CoreVideo/CVProg_Intro/CVProg_Intro.html#//apple_ref/doc/uid/TP40001536)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)