1mlib_GraphicsFillTriangle(3mMeLdIiBa)Lib Library Funcmtliiobn_sGraphicsFillTriangle(3MLIB)
2
3
4
6 mlib_GraphicsFillTriangle, mlib_GraphicsFillTriangle_8, mlib_Graphics‐
7 FillTriangle_32, mlib_GraphicsFillTriangle_X_8, mlib_GraphicsFillTrian‐
8 gle_X_32, mlib_GraphicsFillTriangle_A_8, mlib_GraphicsFillTrian‐
9 gle_A_32, mlib_GraphicsFillTriangle_B_8, mlib_GraphicsFillTrian‐
10 gle_B_32, mlib_GraphicsFillTriangle_G_8, mlib_GraphicsFillTrian‐
11 gle_G_32, mlib_GraphicsFillTriangle_Z_8, mlib_GraphicsFillTrian‐
12 gle_Z_32, mlib_GraphicsFillTriangle_AB_8, mlib_GraphicsFillTrian‐
13 gle_AB_32, mlib_GraphicsFillTriangle_ABG_8, mlib_GraphicsFillTrian‐
14 gle_ABG_32, mlib_GraphicsFillTriangle_ABGZ_8, mlib_GraphicsFillTrian‐
15 gle_ABGZ_32, mlib_GraphicsFillTriangle_ABZ_8, mlib_GraphicsFillTrian‐
16 gle_ABZ_32, mlib_GraphicsFillTriangle_AG_8, mlib_GraphicsFillTrian‐
17 gle_AG_32, mlib_GraphicsFillTriangle_AGZ_8, mlib_GraphicsFillTrian‐
18 gle_AGZ_32, mlib_GraphicsFillTriangle_AZ_8, mlib_GraphicsFillTrian‐
19 gle_AZ_32, mlib_GraphicsFillTriangle_BG_8, mlib_GraphicsFillTrian‐
20 gle_BG_32, mlib_GraphicsFillTriangle_BGZ_8, mlib_GraphicsFillTrian‐
21 gle_BGZ_32, mlib_GraphicsFillTriangle_BZ_8, mlib_GraphicsFillTrian‐
22 gle_BZ_32, mlib_GraphicsFillTriangle_GZ_8, mlib_GraphicsFillTrian‐
23 gle_GZ_32 - draw filled triangle
24
26 cc [ flag... ] file... -lmlib [ library... ]
27 #include <mlib.h>
28
29 mlib_status mlib_GraphicsFillTriangle_8(mlib_image *buffer, mlib_s16 x1,
30 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
31 mlib_s32 c);
32
33
34 mlib_status mlib_GraphicsFillTriangle_32(mlib_image *buffer, mlib_s16 x1,
35 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
36 mlib_s32 c);
37
38
39 mlib_status mlib_GraphicsFillTriangle_X_8(mlib_image *buffer, mlib_s16 x1,
40 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
41 mlib_s32 c, mlib_s32 c2);
42
43
44 mlib_status mlib_GraphicsFillTriangle_X_32(mlib_image *buffer, mlib_s16 x1,
45 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
46 mlib_s32 c, mlib_s32 c2);
47
48
49 mlib_status mlib_GraphicsFillTriangle_A_8(mlib_image *buffer, mlib_s16 x1,
50 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
51 mlib_s32 c);
52
53
54 mlib_status mlib_GraphicsFillTriangle_A_32(mlib_image *buffer, mlib_s16 x1,
55 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
56 mlib_s16 y3, mlib_s32 c);
57
58
59 mlib_status mlib_GraphicsFillTriangle_B_8(mlib_image *buffer, mlib_s16 x1,
60 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
61 mlib_s16 y3, mlib_s32 c,
62 mlib_s32 a);
63
64
65 mlib_status mlib_GraphicsFillTriangle_B_32(mlib_image *buffer, mlib_s16 x1,
66 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
67 mlib_s16 y3, mlib_s32 c,
68 mlib_s32 a);
69
70
71 mlib_status mlib_GraphicsFillTriangle_G_8(mlib_image *buffer, mlib_s16 x1,
72 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
73 mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
74
75
76 mlib_status mlib_GraphicsFillTriangle_G_32(mlib_image *buffer, mlib_s16 x1,
77 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
78 mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
79
80
81 mlib_status mlib_GraphicsFillTriangle_Z_8(mlib_image *buffer,
82 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
83 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
84 mlib_s16 z3, mlib_s32 c);
85
86
87 mlib_status mlib_GraphicsFillTriangle_Z_32(mlib_image *buffer,
88 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
89 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
90 mlib_s16 z3, mlib_s32 c);
91
92
93 mlib_status mlib_GraphicsFillTriangle_AB_8(mlib_image *buffer, mlib_s16 x1,
94 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
95 mlib_s32 c, mlib_s32 a);
96
97
98 mlib_status mlib_GraphicsFillTriangle_AB_32(mlib_image *buffer,
99 mlib_s16 x1, mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
100 mlib_s16 y3, mlib_s32 c, mlib_s32 a);
101
102
103 mlib_status mlib_GraphicsFillTriangle_ABG_8(mlib_image *buffer,
104 mlib_s16 x1, mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
105 mlib_s16 y3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
106
107
108 mlib_status mlib_GraphicsFillTriangle_ABG_32(mlib_image *buffer,
109 mlib_s16 x1, mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
110 mlib_s16 y3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
111
112
113 mlib_status mlib_GraphicsFillTriangle_ABGZ_8(mlib_image *buffer,
114 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
115 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
116 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
117
118
119 mlib_status mlib_GraphicsFillTriangle_ABGZ_32(mlib_image *buffer,
120 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
121 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
122 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
123
124
125 mlib_status mlib_GraphicsFillTriangle_ABZ_8(mlib_image *buffer,
126 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
127 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
128 mlib_s16 z3, mlib_s32 c,
129 mlib_s32 a);
130
131
132 mlib_status mlib_GraphicsFillTriangle_ABZ_32(mlib_image *buffer,
133 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
134 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
135 mlib_s16 z3, mlib_s32 c, mlib_s32 a);
136
137
138 mlib_status mlib_GraphicsFillTriangle_AG_8(mlib_image *buffer, mlib_s16 x1,
139 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
140 mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
141
142
143 mlib_status mlib_GraphicsFillTriangle_AG_32(mlib_image *buffer,
144 mlib_s16 x1, mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
145 mlib_s16 y3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
146
147
148 mlib_status mlib_GraphicsFillTriangle_AGZ_8(mlib_image *buffer,
149 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
150 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
151 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
152
153
154 mlib_status mlib_GraphicsFillTriangle_AGZ_32(mlib_image *buffer,
155 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
156 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
157 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
158
159
160 mlib_status mlib_GraphicsFillTriangle_AZ_8(mlib_image *buffer,
161 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
162 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
163 mlib_s16 z3, mlib_s32 c);
164
165
166 mlib_status mlib_GraphicsFillTriangle_AZ_32(mlib_image *buffer,
167 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
168 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
169 mlib_s16 z3, mlib_s32 c);
170
171
172 mlib_status mlib_GraphicsFillTriangle_BG_8(mlib_image *buffer, mlib_s16 x1,
173 mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3, mlib_s16 y3,
174 mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
175
176
177 mlib_status mlib_GraphicsFillTriangle_BG_32(mlib_image *buffer,
178 mlib_s16 x1, mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s16 x3,
179 mlib_s16 y3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
180
181
182 mlib_status mlib_GraphicsFillTriangle_BGZ_8(mlib_image *buffer,
183 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
184 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
185 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
186
187
188 mlib_status mlib_GraphicsFillTriangle_BGZ_32(mlib_image *buffer,
189 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
190 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
191 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3, mlib_s32 a);
192
193
194 mlib_status mlib_GraphicsFillTriangle_BZ_8(mlib_image *buffer,
195 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
196 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
197 mlib_s16 z3, mlib_s32 c, mlib_s32 a);
198
199
200 mlib_status mlib_GraphicsFillTriangle_BZ_32(mlib_image *buffer,
201 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
202 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
203 mlib_s16 z3, mlib_s32 c, mlib_s32 a);
204
205
206 mlib_status mlib_GraphicsFillTriangle_GZ_8(mlib_image *buffer,
207 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
208 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
209 mlib_s16 x3, mlib_s16 y3,
210 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
211
212
213 mlib_status mlib_GraphicsFillTriangle_GZ_32(mlib_image *buffer,
214 mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
215 mlib_s16 x2, mlib_s16 y2, mlib_s16 z2, mlib_s16 x3, mlib_s16 y3,
216 mlib_s16 z3, mlib_s32 c1, mlib_s32 c2, mlib_s32 c3);
217
218
220 Each of the mlib_GraphicsFillTriangle_*() functions draws a filled tri‐
221 angle with the vertices at (x1,y1), (x2,y2), and (x3,y3).
222
223
224 Each of the mlib_GraphicsFillTriangle_X_*() functions draws a filled
225 triangle in Xor mode as follows:
226
227 data[x,y] ^= c ^ c2
228
229
230
231 Each of the mlib_GraphicsFillTriangle_A_*() functions draws a filled
232 triangle with antialiasing.
233
234
235 Each of the mlib_GraphicsFillTriangle_B_*() functions draws a filled
236 triangle with alpha blending as follows:
237
238 data[x,y] = (data[x,y] * (255 - a) + c * a) / 255
239
240
241
242 Each of the mlib_GraphicsFillTriangle_G_*() functions draws a filled
243 triangle with Gouraud shading.
244
245
246 Each of the mlib_GraphicsFillTriangle_Z_*() functions draws a filled
247 triangle with Z buffering.
248
249
250 Each of the other functions draws a filled triangle with a combination
251 of two or more features like antialiasing (A), alpha blending (B),
252 Gouraud shading (G), and Z buffering (Z).
253
255 Each of the functions takes some of the following arguments:
256
257 buffer Pointer to the image into which the function is drawing.
258
259
260 zbuffer Pointer to the image that holds the Z buffer.
261
262
263 x1 X coordinate of the first vertex.
264
265
266 y1 Y coordinate of the first vertex.
267
268
269 z1 Z coordinate of the first vertex.
270
271
272 x2 X coordinate of the second vertex.
273
274
275 y2 Y coordinate of the second vertex.
276
277
278 z2 Z coordinate of the second vertex.
279
280
281 x3 X coordinate of the third vertex.
282
283
284 y3 Y coordinate of the third vertex.
285
286
287 z3 Z coordinate of the third vertex.
288
289
290 c Color used in the drawing.
291
292
293 c1 Color of the first vertex.
294
295
296 c2 Color of the second vertex, or the alternation color in Xor
297 Mode.
298
299
300 c3 Color of the third vertex.
301
302
303 a Alpha value for blending. 0 ≤ a ≤ 255.
304
305
307 Each of the functions returns MLIB_SUCCESS if successful. Otherwise it
308 returns MLIB_FAILURE.
309
311 See attributes(5) for descriptions of the following attributes:
312
313
314
315
316 ┌─────────────────────────────┬─────────────────────────────┐
317 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
318 ├─────────────────────────────┼─────────────────────────────┤
319 │Interface Stability │Committed │
320 ├─────────────────────────────┼─────────────────────────────┤
321 │MT-Level │MT-Safe │
322 └─────────────────────────────┴─────────────────────────────┘
323
325 mlib_GraphicsDrawTriangle(3MLIB), attributes(5)
326
327
328
329SunOS 5.11 2 Mar 2007 mlib_GraphicsFillTriangle(3MLIB)