1mlib_ImageAffineTransform(3mMeLdIiBa)Lib Library Funcmtliiobn_sImageAffineTransform(3MLIB)
2
3
4
6 mlib_ImageAffineTransform - affine transformation on an image, checking
7 the matrix first
8
10 cc [ flag... ] file... -lmlib [ library... ]
11 #include <mlib.h>
12
13 mlib_status mlib_ImageAffineTransform(mlib_image *dst,
14 const mlib_image *src, const mlib_d64 *mtx, mlib_filter filter,
15 mlib_edge edge);
16
17
19 The mlib_ImageAffineTransform() function does affine transformation on
20 an image, checking the matrix first and taking advantage of special
21 cases.
22
23
24 The following equation represents the affine transformation:
25
26 xd = a*xs + b*ys + tx
27 yd = c*xs + d*ys + ty
28
29
30
31 where a point with coordinates (xs, ys) in the source image is mapped
32 to a point with coordinates (xd, yd) in the destination image.
33
34
35 The data type of the images can be MLIB_BIT, MLIB_BYTE, MLIB_SHORT,
36 MLIB_USHORT, or MLIB_INT.
37
38
39 The width and height of the destination image can be different from the
40 width and height of the source image.
41
42
43 The center of the upper-left corner pixel of an image is located at
44 (0.5, 0.5).
45
47 The function takes the following arguments:
48
49 dst Pointer to destination image.
50
51
52 src Pointer to source image.
53
54
55 mtx Transformation matrix. mtx[0] holds a; mtx[1] holds b; mtx[2]
56 holds tx; mtx[3] holds c; mtx[4] holds d; mtx[5] holds ty.
57
58
59 filter Type of resampling filter. It can be one of the following:
60
61 MLIB_NEAREST
62 MLIB_BILINEAR
63 MLIB_BICUBIC
64 MLIB_BICUBIC2
65
66
67
68 edge Type of edge condition. It can be one of the following:
69
70 MLIB_EDGE_DST_NO_WRITE
71 MLIB_EDGE_DST_FILL_ZERO
72 MLIB_EDGE_OP_NEAREST
73 MLIB_EDGE_SRC_EXTEND
74 MLIB_EDGE_SRC_PADDED
75
76
77
79 The function returns MLIB_SUCCESS if successful. Otherwise it returns
80 MLIB_FAILURE.
81
83 See attributes(5) for descriptions of the following attributes:
84
85
86
87
88 ┌─────────────────────────────┬─────────────────────────────┐
89 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
90 ├─────────────────────────────┼─────────────────────────────┤
91 │Interface Stability │Committed │
92 ├─────────────────────────────┼─────────────────────────────┤
93 │MT-Level │MT-Safe │
94 └─────────────────────────────┴─────────────────────────────┘
95
97 mlib_ImageAffine(3MLIB), mlib_ImageAffine_Fp(3MLIB),
98 mlib_ImageAffineIndex(3MLIB), mlib_ImageAffineTransform_Fp(3MLIB),
99 mlib_ImageAffineTransformIndex(3MLIB), mlib_ImageSetPaddings(3MLIB),
100 attributes(5)
101
102
103
104SunOS 5.11 2 Mar 2007 mlib_ImageAffineTransform(3MLIB)