---
name: "im_lintra_vec"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_lintra"
---

# im\_lintra\_vec(3)

performs a linear transformation on an image

Part of [im\_lintra(3)](/im_lintra/3.md).

## 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)](/im_lintra_vec/3.md)** 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 one of the integer types then output is float.  In all other cases the output is the same as the input.

**[im\_lintra(3)](/im_lintra/3.md)** is a convenience function which calls **[im\_lintra\_vec(3)](/im_lintra_vec/3.md)** 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_exptra/3.md), [im\_logtra(3)](/im_logtra/3.md)

## AUTHOR

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