1IM_AFFINE(3) Library Functions Manual IM_AFFINE(3)
2
3
4
6 im_affine - apply an affine transform to an image
7
9 #include <vips/vips.h>
10
11 int im_affine(in, out, a, b, c, d, dx, dy, x, y, w, h)
12 IMAGE *in, *out;
13 double a, b, c, d, dx, dy;
14 int x, y;
15 int w, h;
16
17
19 im_affine() applies an affine transformation on the image held by the
20 IMAGE descriptor in and puts the result at the location pointed by the
21 IMAGE descriptor out. in many have any number of bands, be any size,
22 and have any non-complex type.
23
24 The transformation is described by a, b, c, d, dx, dy. The point (x,y)
25 in the input is mapped onto point (X,Y) in the output by
26
27 X = a * x + b * y + dx
28 Y = c * x + d * y + dy
29
30 The area of the output image given by w, h, x, y is generated. (0,0) is
31 the position of the transformed top-left-hand corner of the input
32 image. Function im_affine resamples the transformed image using bilinā
33 ear interpolation.
34
35
37 The functions return 0 on success and -1 on error.
38
40 As with most resamplers, im_affine(3) performs poorly at the edges of
41 images.
42
44 im_similarity(3)
45
46
47
48 21 December 1999 IM_AFFINE(3)