Table of Contents

## Name

im_lintra, im_lintra_vec - performs a linear transformation on an image

## Synopsis

#include <vips/vips.h>

int im_lintra_vec(n, a, in, b, out)
int n;
double *a, *b;
IMAGE *in, *out;

int im_lintra(a, in, b, out)
double a, b;
IMAGE *in, *out;

## Description

im_lintra_vec(3) performs a linear transform on image in, that is, it calculates

out = a * in + b

a and b are vectors, ie. arrays of constants of length n. If in has one band, then the vectors may be any length and the output image will have the same number of bands as the length of the vector. If in has many bands, then the vector must be length 1, or have the same length as the number of bands in the image. If the input format is uchar, char, ushort, short, uint or int then output is float. In all other cases the output is the same as the input.

im_lintra(3) is a convenience function which calls im_lintra_vec(3) with a vector of length 1.

## Return Value

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

## Bugs

The function does not check for under/overflow

## See Also

im_exptra(3) , im_logtra(3)

## Author

N. Dessipris - 24/04/1991
J. Cupitt (rewrite) - 21/7/93

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- Bugs
- SeeAlso
- Author