im_recomb(3) matrix recombination of image


#include <vips/vips.h>

int im_recomb(imagein, imageout, mat)
IMAGE *imagein, *imageout;


im_recomb() recombines the elements of an m band image to form an n band image using mat, an m by n matrix of floating point numbers.

It calculates

  A = B x C

where A is an n band output image, C is an m band input image and B is an m by n matrix of floats. Can be used with a 3 by 3 matrix to perform simple colour space transforms; 7 by 30 matrix to shrink 3rd order development of 3 filter system to XYZ etc.

The output type is float unless the input type is double, in which case the output type is double. It does not work for complex image types. All intermediates are calculated as double. Note that the width of the matrix should be equal to the number of bands in the input image.


The function returns 0 on success and -1 on error.


National Gallery and Birkbeck College, 1990 - 1996