1mlib_GraphicsDrawLine(3MLIBm)ediaLib Library Functionmslib_GraphicsDrawLine(3MLIB)
2
3
4

NAME

6       mlib_GraphicsDrawLine,    mlib_GraphicsDrawLine_8,   mlib_GraphicsDraw‐
7       Line_32,     mlib_GraphicsDrawLine_X_8,     mlib_GraphicsDrawLine_X_32,
8       mlib_GraphicsDrawLine_A_8,  mlib_GraphicsDrawLine_A_32,  mlib_Graphics‐
9       DrawLine_B_8,  mlib_GraphicsDrawLine_B_32,   mlib_GraphicsDrawLine_G_8,
10       mlib_GraphicsDrawLine_G_32,  mlib_GraphicsDrawLine_Z_8,  mlib_Graphics‐
11       DrawLine_Z_32, mlib_GraphicsDrawLine_AB_8, mlib_GraphicsDrawLine_AB_32,
12       mlib_GraphicsDrawLine_ABG_8,  mlib_GraphicsDrawLine_ABG_32, mlib_Graph‐
13       icsDrawLine_ABGZ_8,  mlib_GraphicsDrawLine_ABGZ_32,  mlib_GraphicsDraw‐
14       Line_ABZ_8,  mlib_GraphicsDrawLine_ABZ_32,  mlib_GraphicsDrawLine_AG_8,
15       mlib_GraphicsDrawLine_AG_32,  mlib_GraphicsDrawLine_AGZ_8,  mlib_Graph‐
16       icsDrawLine_AGZ_32,    mlib_GraphicsDrawLine_AZ_8,   mlib_GraphicsDraw‐
17       Line_AZ_32,  mlib_GraphicsDrawLine_BG_8,   mlib_GraphicsDrawLine_BG_32,
18       mlib_GraphicsDrawLine_BGZ_8,  mlib_GraphicsDrawLine_BGZ_32, mlib_Graph‐
19       icsDrawLine_BZ_8,    mlib_GraphicsDrawLine_BZ_32,    mlib_GraphicsDraw‐
20       Line_GZ_8, mlib_GraphicsDrawLine_GZ_32 - draw line
21

SYNOPSIS

23       cc [ flag... ] file... -lmlib [ library... ]
24       #include <mlib.h>
25
26       mlib_status mlib_GraphicsDrawLine_8(mlib_image *buffer, mlib_s16 x1,
27            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c);
28
29
30       mlib_status mlib_GraphicsDrawLine_32(mlib_image *buffer, mlib_s16 x1,
31            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c);
32
33
34       mlib_status mlib_GraphicsDrawLine_X_8(mlib_image *buffer, mlib_s16 x1,
35            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 c2);
36
37
38       mlib_status mlib_GraphicsDrawLine_X_32(mlib_image *buffer, mlib_s16 x1,
39            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 c2);
40
41
42       mlib_status mlib_GraphicsDrawLine_A_8(mlib_image *buffer, mlib_s16 x1,
43            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c);
44
45
46       mlib_status mlib_GraphicsDrawLine_A_32(mlib_image *buffer, mlib_s16 x1,
47            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c);
48
49
50       mlib_status mlib_GraphicsDrawLine_B_8(mlib_image *buffer, mlib_s16 x1,
51            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 a);
52
53
54       mlib_status mlib_GraphicsDrawLine_B_32(mlib_image *buffer, mlib_s16 x1,
55            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 a);
56
57
58       mlib_status mlib_GraphicsDrawLine_G_8(mlib_image *buffer, mlib_s16 x1,
59            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2);
60
61
62       mlib_status mlib_GraphicsDrawLine_G_32(mlib_image *buffer, mlib_s16 x1,
63            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2);
64
65
66       mlib_status mlib_GraphicsDrawLine_Z_8(mlib_image *buffer,
67            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1,
68            mlib_s16 z1, mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
69            mlib_s32 c);
70
71
72       mlib_status mlib_GraphicsDrawLine_Z_32(mlib_image *buffer,
73            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1,
74            mlib_s16 z1, mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
75            mlib_s32 c);
76
77
78       mlib_status mlib_GraphicsDrawLine_AB_8(mlib_image *buffer, mlib_s16 x1,
79            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 a);
80
81
82       mlib_status mlib_GraphicsDrawLine_AB_32(mlib_image *buffer, mlib_s16 x1,
83            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c, mlib_s32 a);
84
85
86       mlib_status mlib_GraphicsDrawLine_ABG_8(mlib_image *buffer, mlib_s16 x1,
87            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2,
88            mlib_s32 a);
89
90
91       mlib_status mlib_GraphicsDrawLine_ABG_32(mlib_image *buffer, mlib_s16 x1,
92            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2,
93            mlib_s32 a);
94
95
96       mlib_status mlib_GraphicsDrawLine_ABGZ_8(mlib_image *buffer,
97            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
98            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
99            mlib_s32 c1, mlib_s32 c2, mlib_s32 a);
100
101
102       mlib_status mlib_GraphicsDrawLine_ABGZ_32(mlib_image *buffer,
103            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
104            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
105            mlib_s32 c1, mlib_s32 c2, mlib_s32 a);
106
107
108       mlib_status mlib_GraphicsDrawLine_ABZ_8(mlib_image *buffer,
109            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
110            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
111            mlib_s32 c, mlib_s32 a);
112
113
114       mlib_status mlib_GraphicsDrawLine_ABZ_32(mlib_image *buffer,
115            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
116            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
117            mlib_s32 c, mlib_s32 a);
118
119
120       mlib_status mlib_GraphicsDrawLine_AG_8(mlib_image *buffer, mlib_s16 x1,
121            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2);
122
123
124       mlib_status mlib_GraphicsDrawLine_AG_32(mlib_image *buffer, mlib_s16 x1,
125            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2);
126
127
128       mlib_status mlib_GraphicsDrawLine_AGZ_8(mlib_image *buffer,
129            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
130            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
131            mlib_s32 c1, mlib_s32 c2);
132
133
134       mlib_status mlib_GraphicsDrawLine_AGZ_32(mlib_image *buffer,
135            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
136            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
137            mlib_s32 c1, mlib_s32 c2);
138
139
140       mlib_status mlib_GraphicsDrawLine_AZ_8(mlib_image *buffer,
141            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
142            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
143            mlib_s32 c);
144
145
146       mlib_status mlib_GraphicsDrawLine_AZ_32(mlib_image *buffer,
147            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
148            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
149            mlib_s32 c);
150
151
152       mlib_status mlib_GraphicsDrawLine_BG_8(mlib_image *buffer, mlib_s16 x1,
153            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2,
154            mlib_s32 a);
155
156
157       mlib_status mlib_GraphicsDrawLine_BG_32(mlib_image *buffer, mlib_s16 x1,
158            mlib_s16 y1, mlib_s16 x2, mlib_s16 y2, mlib_s32 c1, mlib_s32 c2,
159            mlib_s32 a);
160
161
162       mlib_status mlib_GraphicsDrawLine_BGZ_8(mlib_image *buffer,
163            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
164            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
165            mlib_s32 c1, mlib_s32 c2, mlib_s32 a);
166
167
168       mlib_status mlib_GraphicsDrawLine_BGZ_32(mlib_image *buffer,
169            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
170            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
171            mlib_s32 c1, mlib_s32 c2, mlib_s32 a);
172
173
174       mlib_status mlib_GraphicsDrawLine_BZ_8(mlib_image *buffer,
175            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
176            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
177            mlib_s32 c, mlib_s32 a);
178
179
180       mlib_status mlib_GraphicsDrawLine_BZ_32(mlib_image *buffer,
181            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
182            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
183            mlib_s32 c, mlib_s32 a);
184
185
186       mlib_status mlib_GraphicsDrawLine_GZ_8(mlib_image *buffer,
187            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
188            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
189            mlib_s32 c1, mlib_s32 c2);
190
191
192       mlib_status mlib_GraphicsDrawLine_GZ_32(mlib_image *buffer,
193            mlib_image *zbuffer, mlib_s16 x1, mlib_s16 y1, mlib_s16 z1,
194            mlib_s16 x2, mlib_s16 y2, mlib_s16 z2,
195            mlib_s32 c1, mlib_s32 c2);
196
197

DESCRIPTION

199       Each  of  the  mlib_GraphicsDrawLine_*() functions draws a line between
200       (x1,y1) and (x2,y2).
201
202
203       Each of the mlib_GraphicsDrawLine_X_*() functions draws a line  between
204       (x1,y1) and (x2,y2) in Xor mode as follows:
205
206             data[x,y] ^= c ^ c2
207
208
209
210       Each  of the mlib_GraphicsDrawLine_A_*() functions draws a line between
211       (x1,y1) and (x2,y2) with antialiasing.
212
213
214       Each of the mlib_GraphicsDrawLine_B_*() functions draws a line  between
215       (x1,y1) and (x2,y2) with alpha blending as follows:
216
217             data[x,y] = (data[x,y] * (255 - a) + c * a) / 255
218
219
220
221       Each  of the mlib_GraphicsDrawLine_G_*() functions draws a line between
222       (x1,y1) and (x2,y2) with Gouraud shading.
223
224
225       Each of the mlib_GraphicsDrawLine_Z_*() functions draws a line  between
226       (x1,y1) and (x2,y2) with Z buffering.
227
228
229       Each  of  the  other functions draws a line between (x1,y1) and (x2,y2)
230       with a combination of two or more features like antialiasing (A), alpha
231       blending (B), Gouraud shading (G), and Z buffering (Z).
232

PARAMETERS

234       Each of the functions takes some of the following arguments:
235
236       buffer     Pointer to the image into which the function is drawing.
237
238
239       zbuffer    Pointer to the image that holds the Z buffer.
240
241
242       x1         X coordinate of the first point.
243
244
245       y1         Y coordinate of the first point.
246
247
248       z1         Z coordinate of the first point.
249
250
251       x2         X coordinate of the second point.
252
253
254       y2         Y coordinate of the second point.
255
256
257       z2         Z coordinate of the second point.
258
259
260       c          Color used in the drawing.
261
262
263       c1         Color of the first point.
264
265
266       c2         Color  of  the second point, or the alternation color in the
267                  Xor mode.
268
269
270       a          Alpha value for blending. 0 ≤ a ≤ 255.
271
272

RETURN VALUES

274       Each of the functions returns MLIB_SUCCESS if successful. Otherwise  it
275       returns MLIB_FAILURE.
276

ATTRIBUTES

278       See attributes(5) for descriptions of the following attributes:
279
280
281
282
283       ┌─────────────────────────────┬─────────────────────────────┐
284       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
285       ├─────────────────────────────┼─────────────────────────────┤
286       │Interface Stability          │Committed                    │
287       ├─────────────────────────────┼─────────────────────────────┤
288       │MT-Level                     │MT-Safe                      │
289       └─────────────────────────────┴─────────────────────────────┘
290

SEE ALSO

292       mlib_GraphicsDrawLineSet(3MLIB),    mlib_GraphicsDrawLineFanSet(3MLIB),
293       mlib_GraphicsDrawLineStripSet(3MLIB), attributes(5)
294
295
296
297SunOS 5.11                        2 Mar 2007      mlib_GraphicsDrawLine(3MLIB)
Impressum