Applies a piecewise gamma function to a Planar8 image to produce a Planar16Q12 image.


func vImagePiecewiseGamma_Planar8toPlanar16Q12(_ src: UnsafePointer<vImage_Buffer>, _ dest: UnsafePointer<vImage_Buffer>, _ exponentialCoeffs: UnsafePointer<Float>, _ gamma: Float, _ linearCoeffs: UnsafePointer<Float>, _ boundary: Pixel_8, _ flags: vImage_Flags) -> vImage_Error



A pointer to a vImage buffer structure that contains the source image.




An array of three floating-point coefficients for the gamma curve.


The exponent of a power function for calculating gamma correction.


An array of two floating-point coefficients for the linear curve.


The boundary value for switching from linear to gamma curve.



Return Value



The piecewise gamma calculation combines a linear and an exponential (gamma) curve on two regions of the input interval, separated by a specified boundary value. When the input is greater than or equal to the boundary value, the gamma curve is used to generate the output. Otherwise, the linear curve is used.

For each pixel, given that x is the value of the source pixel, the operation can be described as:

if x < boundary:    
    r = linearCoeffs[0]*x + linearCoeffs[1]
    t = exponentialCoeffs[0]*x + exponentialCoeffs[1]    
    r = pow(t, gamma) + exponentialCoeffs[2]
output pixel value = r

See Also

Correcting Gamma

func vImageDestroyGammaFunction(GammaFunction!)

Destroys a gamma function object created.

Beta Software


Learn more about using Apple's beta software