'Is Apple ROMM RGB profile broken? It seems to have incorrect TRC values in it

The ROMM RGB profile shipped with MacOS is presented as v4.x format with parametric curve. I tried to use is as a reference to check my parametric curve handling code an I found something very strange. The TRC is encoded as curve type 3 with g, a, c, b, and d parameters. According to a spec it has the following interpretation (it's Rust but universally understabdable):

if x >= d {
    (a * x + b).powf(g)
} else {
    c * x
}

The profile has d value of 0.001953125 which is a way off the expected 0.03125 I calculated from the ROMM RGB spec from Kodak. Basically it makes the curve non monotonous by introducing a step. For now I added a workaround for a special case of a = 1 and b = 0 in which d value can be easily recalculated. But how it works in other software?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source