int
im_buildlut( DOUBLEMASK *input, IMAGE *output )
0 0
128 20
255 100
we generate
0 0
1 0.01
.. etc. linear interpolation
128 20
129 20.5
.. etc. linear interpolation
255 100
the x axis (12 .. 17) is implied. The x/y points don’t need to be sorted: we do that. You can have several Ys ... each becomes a band in the output LUT.