Method
VipsImagebuildlut
Declaration [src]
int
vips_buildlut (
VipsImage* in,
VipsImage** out,
...
)
Description [src]
This operation builds a lookup table from a set of points. Intermediate
values are generated by piecewise linear interpolation. The lookup table is
always of type VipsBandFormat, use vips_cast() to
change it to the type you need.
For example, consider this 2 x 2 matrix of (x, y) coordinates:
2 2
0 0
255 100
We then generate a 1 x 256 element LUT like this:
| Index | Value |
|---|---|
| 0 | 0 |
| 1 | 0.4 |
| etc. | 0.4 |
| 255 | 100 |
This is then written as the output image, with the left column giving the index in the image to place the value.
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. You don’t need to start at zero, any integer will do, including negatives.
::: seealso
vips_identity(), vips_invertlut(), vips_cast(),
vips_maplut().
Parameters
out |
VipsImage |
Output image. |
|
| The argument will be set by the function. | |
| The instance takes ownership of the data, and is responsible for freeing it. | |
... |
none |
|