Structure

vImage_YpCbCrPixelRange

Range and clamping information for Y'CbCr pixel formats.

Declaration

struct vImage_YpCbCrPixelRange

Overview

Y'CbCr formats frequently don't use the entire representable range available to them to represent image data. While a full range video format does use the entire range, a video range format often leaves the extrema unused, except perhaps to represent values outside of the standard Y'=[0,1] CbCr = [-0.5,0.5] range. For example, an 8-bit video range format typically uses the range [16,235] for Y' and [16,240] for Cb and Cr.

The following code shows examples of typical Y'CbCr pixel ranges:

// video range 8-bit, unclamped
let pixelRange = vImage_YpCbCrPixelRange(Yp_bias: 16,
                                         CbCr_bias: 128,
                                         YpRangeMax: 235,
                                         CbCrRangeMax: 240,
                                         YpMax: 255,
                                         YpMin: 0,
                                         CbCrMax: 255,
                                         CbCrMin: 1)

 // video range 8-bit, clamped to video range
let pixelRange = vImage_YpCbCrPixelRange(Yp_bias: 16,
                                         CbCr_bias: 128,
                                         YpRangeMax: 265,
                                         CbCrRangeMax: 240,
                                         YpMax: 235,
                                         YpMin: 16,
                                         CbCrMax: 240,
                                         CbCrMin: 16)
        
// full range 8-bit, clamped to full range
let pixelRange = vImage_YpCbCrPixelRange(Yp_bias: 0,
                                         CbCr_bias: 128,
                                         YpRangeMax: 255,
                                         CbCrRangeMax: 255,
                                         YpMax: 255,
                                         YpMin: 1,
                                         CbCrMax: 255,
                                         CbCrMin: 0)

The bias is the prebias for YUV -> RGB and postbias for RGB -> YUV.

Topics

Creating a Pixel Range

Pixel Range Properties

var Yp_bias: Int32

The encoding for Y' = 0.0 for this video format (varies by bit depth).

var CbCr_bias: Int32

The encoding for {Cb, Cr} = 0.0 for this video format.

var YpRangeMax: Int32

The encoding for Y' = 1.0 for this video format.

var CbCrRangeMax: Int32

The encoding for {Cb, Cr} = 0.5 for this video format.

var YpMax: Int32

The encoding for the maximum allowed Y' value.

var YpMin: Int32

The encoding of the minimum allowed Y' value.

var CbCrMax: Int32

The encoding of the maximum allowed {Cb, Cr} value.

var CbCrMin: Int32

The encoding of the minimum allowed {Cb, Cr} value.

See Also

Converting from YUV Formats

struct vImageYpCbCrType

Constants indicating the encoding of a YUV image format type to be used with RGB / Y'CbCr conversions.

struct vImageARGBType

Constants indicating the encoding of an ARGB image format type to be used with RGB / Y'CbCr conversions.

struct vImage_YpCbCrToARGBMatrix

A 3 x 3 matrix for converting Y'CbCr signals to RGB.

struct vImage_YpCbCrToARGB

An opaque representation of a 3 x 3 matrix for converting Y'CbCr signals to RGB.