vImage_YpCbCrPixelRange
The description of range and clamping information for YpCbCr pixel formats.
Declaration
struct vImage_YpCbCrPixelRangeOverview
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:
// The 8-bit pixel range that's unclamped.
let pixelRange = vImage_YpCbCrPixelRange(Yp_bias: 16,
CbCr_bias: 128,
YpRangeMax: 235,
CbCrRangeMax: 240,
YpMax: 255,
YpMin: 0,
CbCrMax: 255,
CbCrMin: 1)
// The 8-bit pixel range that's 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)
// The 8-bit pixel range that's 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 to RGB and the postbias for RGB to YUV.