Returns a gamma function object.
- iOS 5.0+
- macOS 10.4+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The exponent of a power function for calculating full-precision gamma correction.
A selector for the type of gamma correction to use. Pass one of the full- or half-precision type constants defined in Gamma Function Types.
The options to use when performing the operation. If you plan to perform your own tiling or use multithreading, pass
Image Do Not Tile
A gamma function object that encapsulates a gamma value, a gamma function type, and option flags.
The gamma-type parameter determines the type of calculation to be used. The simplest calculation is:
This calculation results in symmetric gamma curves about 0, and makes sure that only well-behaved values are used in
You can use an equivalent calculation that uses a more efficient method, depending on the desired precision.
In addition to the full-precision gamma correction, there is a faster half-precision option that provides 12-bit precision.
f your data will ultimately be converted to 8-bit integer data, consider using half-precision. The half-precision variants work correctly only for floating-point input values in the range 0.0 ... 1.0, though out-of-range values produce results that clamp appropriately to 0 or 255 on conversion back to 8-bit. In addition, there are restrictions on the range of the exponent: it must be positive, in the range 0.1 to 10.0.
Finally, there is a set of still faster half-precision options that use predefined gamma values, ignoring the value set in
v. These options have the same restrictions on input values as stated previously.