1mlib_ImagePolynomialWarpTabmleed_iFapL(i3bMLLIiBb)ramrlyibF_uInmcatgieoPnoslynomialWarpTable_Fp(3MLIB)
2
3
4
6 mlib_ImagePolynomialWarpTable_Fp - polynomial-based image warp with ta‐
7 ble-driven interpolation
8
10 cc [ flag... ] file... -lmlib [ library... ]
11 #include <mlib.h>
12
13 mlib_status mlib_ImagePolynomialWarpTable_Fp(mlib_image *dst,
14 const mlib_image *src, const mlib_d64 *xCoeffs,
15 const mlib_d64 *yCoeffs, mlib_s32 n, mlib_d64 preShiftX,
16 mlib_d64 preShiftY, mlib_d64 postShiftX, mlib_d64 postShiftY,
17 mlib_d64 preScaleX, mlib_d64 preScaleY, mlib_d64 postScaleX,
18 mlib_d64 postScaleY, const void *interp_table, mlib_edge edge);
19
20
22 The mlib_ImagePolynomialWarpTable_Fp() function performs a polynomial-
23 based image warp on a floating-point image with table-driven interpola‐
24 tion.
25
26
27 The images must have the same type, and the same number of channels.
28 The images can have 1, 2, 3, or 4 channels. The data type of the images
29 can be MLIB_FLOAT or MLIB_DOUBLE. The source and destination images may
30 have different sizes.
31
32
33 The xCoeffs and yCoeffs parameters must contain the same number of
34 coefficients of the form (n + 1)(n + 2)/2 for some n, where n is the
35 degree power of the polynomial. The coefficients, in order, are associ‐
36 ated with the terms:
37
38 1, x, y, x**2, x*y, y**2, ...,
39 x**n, x**(n-1)*y, ..., x*y**(n-1), y**n
40
41
42
43 and coefficients of value 0 cannot be omitted.
44
45
46 The image pixels are assumed to be centered at .5 coordinate points. In
47 other words, the upper-left corner pixel of an image is located at
48 (0.5, 0.5).
49
50
51 For each pixel in the destination image, its center point D is backward
52 mapped to a point S in the source image. Then the source pixels with
53 their centers surrounding point S are selected to do the interpolation
54 specified by interp_table to generate the pixel value for point D.
55
56
57 The mapping is defined by the two bivariate polynomial functions X(x,
58 y) and Y(x, y) that map destination (x, y) coordinates to source X and
59 Y positions respectively.
60
61
62 The functions X(x, y) and Y(x, y) are:
63
64 preX = (x + preShiftX)*preScaleX
65
66 preY = (y + preShiftY)*preScaleY
67
68 n i
69 warpedX = SUM {SUM {xCoeffs_ij * preX**(i-j) * preY**j}}
70 i=0 j=0
71
72 n i
73 warpedY = SUM {SUM {yCoeffs_ij * preX**(i-j) * preY**j}}
74 i=0 j=0
75
76 X(x, y) = warpedX*postScaleX - postShiftX
77
78 Y(x, y) = warpedY*postScaleY - postShiftY
79
80
81
82 The destination (x, y) coordinates are pre-shifted by (preShiftX,
83 preShiftY) and pre-scaled by the factors preScaleX and preScaleY prior
84 to the evaluation of the polynomial. The results of the polynomial
85 evaluations are scaled by postScaleX and postScaleY, and then shifted
86 by (-postShiftX, -postShiftY) to produce the source pixel coordinates.
87 This process allows for better precision of the results and supports
88 tiled images.
89
91 The function takes the following arguments:
92
93 dst Pointer to destination image.
94
95
96 src Pointer to source image.
97
98
99 xCoeffs Destination to source transform coefficients for the X
100 coordinate.
101
102
103 yCoeffs Destination to source transform coefficients for the Y
104 coordinate.
105
106
107 n Degree power of the polynomial.
108
109
110 preShiftX Displacement to apply to destination X positions.
111
112
113 preShiftY Displacement to apply to destination Y positions.
114
115
116 postShiftX Displacement to apply to source X positions.
117
118
119 postShiftY Displacement to apply to source Y positions.
120
121
122 preScaleX Scale factor to apply to destination X positions.
123
124
125 preScaleY Scale factor to apply to destination Y positions.
126
127
128 postScaleX Scale factor to apply to source X positions.
129
130
131 postScaleY Scale factor to apply to source Y positions.
132
133
134 interp_table Pointer to an interpolation table. The table is created
135 by the mlib_ImageInterpTableCreate() function.
136
137
138 edge Type of edge condition. It can be one of the following:
139
140 MLIB_EDGE_DST_NO_WRITE
141 MLIB_EDGE_SRC_PADDED
142
143
144
146 The function returns MLIB_SUCCESS if successful. Otherwise it returns
147 MLIB_FAILURE.
148
150 See attributes(5) for descriptions of the following attributes:
151
152
153
154
155 ┌─────────────────────────────┬─────────────────────────────┐
156 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
157 ├─────────────────────────────┼─────────────────────────────┤
158 │Interface Stability │Committed │
159 ├─────────────────────────────┼─────────────────────────────┤
160 │MT-Level │MT-Safe │
161 └─────────────────────────────┴─────────────────────────────┘
162
164 mlib_ImageInterpTableCreate(3MLIB), mlib_ImageInterpTableDelete(3MLIB),
165 mlib_ImagePolynomialWarpTable(3MLIB), mlib_ImagePolynomialWarp(3MLIB),
166 mlib_ImagePolynomialWarp_Fp(3MLIB), attributes(5)
167
168
169
170SunOS 5.11 2 Marm2l0i0b7_ImagePolynomialWarpTable_Fp(3MLIB)