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