Function

vImageSymmetricPiecewiseGamma_PlanarF(_:_:_:_:_:_:_:)

Applies a symmetric piecewise gamma function to a PlanarF image.

Parameters

`src`

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

`dest`

A pointer to a vImage buffer data structure. You're responsible for filling out the `height`, `width`, and `rowBytes` fields of this structure, and for allocating a data buffer of the appropriate size. On return, the data buffer this structure points to contains the destination image data. When you no longer need the data buffer, you must deallocate the memory.

`exponentialCoeffs`

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

`gamma`

The exponent of a power function for calculating gamma correction.

`linearCoeffs`

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

`boundary`

The boundary value for switching from linear to gamma curve.

`flags`

The options to use when performing the operation. If you plan to perform your own tiling or use multithreading, pass `kvImageDoNotTile`.

Return Value

`kvImageNoError`; otherwise, one of the error codes described in Data Types and Constants.

Discussion

The symmetric 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 magnitude is greater than or equal to the boundary value, the gamma curve is used to generate the output. Otherwise, the linear curve is used. The result is clamped to `[0, FMT_MAX]` and assigned the sign of the input value. This creates a curve which is symmetric about the origin, with discontinuities flattened to the x-axis.

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

This function will work in place, provided that `src->data = dest->data` and `src->rowBytes = dest->rowBytes`.

`func vImageDestroyGammaFunction(GammaFunction!)`