init(c0:c1:c2:c3:gamma:cutoff:c4:c5:)
Creates a structure that represents a transfer function to convert from linear to nonlinear RGB.
Declaration
init(c0: CGFloat, c1: CGFloat, c2: CGFloat, c3: CGFloat, gamma: CGFloat, cutoff: CGFloat, c4: CGFloat, c5: CGFloat)Parameters
- c0:
The
c0value in the transfer function. - c1:
The
c1value in the transfer function. - c2:
The
c2value in the transfer function. - c3:
The
c3value in the transfer function. - gamma:
The
gammavalue in the transfer function. - cutoff:
The
cutoffvalue in the transfer function. - c4:
The
c4value in the transfer function. - c5:
The
c5value in the transfer function.
Return Value
A new structure that represents a transfer function.
Discussion
Listing 1.
if (R >= cutoff) {
R' = c0 * pow( c1 * R + c2, gamma ) + c3
}
else {
R' = c4 * R + c5
}