Method
VipsImagemapim
Declaration [src]
int
vips_mapim (
VipsImage* in,
VipsImage** out,
VipsImage* index,
...
)
Description [src]
This operator resamples in using index to look up pixels.
out is the same size as index, with each pixel being fetched from that
position in in. That is:
out[x, y] = in[index[x, y]]
If index has one band, that band must be complex. Otherwise, index must
have two bands of any format.
Coordinates in index are in pixels, with (0, 0) being the top-left corner
of in, and with y increasing down the image. Use vips_xyz() to
build index images.
interpolate defaults to bilinear.
By default, new pixels are filled with background. This defaults to
zero (black). You can set other extend types with extend. VipsExtend
is better for image upsizing.
Image are normally treated as unpremultiplied, so this operation can be used
directly on PNG images. If your images have been through
vips_premultiply(), set premultiplied.
This operation does not change xres or yres. The image resolution needs to be updated by the application.
See vips_maplut() for a 1D equivalent of this operation.
::: tip “Optional arguments”
* interpolate: VipsInterpolate, interpolate pixels with this
* extend: VipsExtend, how to generate new pixels
* background: VipsArrayDouble, colour for new pixels
* premultiplied: gboolean, images are already premultiplied
::: seealso
vips_xyz(), vips_affine(), vips_resize(),
vips_maplut(), VipsInterpolate.