File: draw.html

package info (click to toggle)
imagemagick 4.2.8-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 11,116 kB
  • ctags: 5,107
  • sloc: ansic: 98,927; sh: 11,151; cpp: 8,810; perl: 1,922; tcl: 458; makefile: 347
file content (236 lines) | stat: -rw-r--r-- 5,713 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<HTML>
<HEAD>
<TITLE>draw - Methods to Draw on an Image</TITLE>
<LINK REV="made" HREF="mailto:magick@wizards.dupont.com">
</HEAD>

<body background="../../images/background.gif">

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A>
	<UL>

		<LI><A HREF="#ColorFloodfillImage">ColorFloodfillImage</A>
		<LI><A HREF="#DrawImage">DrawImage</A>
		<LI><A HREF="#InsidePrimitive">InsidePrimitive</A>
		<LI><A HREF="#MatteFloodfillImage">MatteFloodfillImage</A>
		<LI><A HREF="#OpagueImage">OpagueImage</A>
	</UL>

</UL>
<!-- INDEX END -->

<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
draw - Methods to Draw on an Image

<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
void <STRONG>DrawImage</STRONG>(Image*image,constAnnotateInfo*annotate_info)

<P>
<HR>
<H1><A NAME="FUNCTION_DESCRIPTIONS">FUNCTION DESCRIPTIONS</A></H1>
<P>
<HR>
<H2><A NAME="ColorFloodfillImage">ColorFloodfillImage</A></H2>
<P>
Method ColorFloodfillImage floodfills the designated area with a color. The
floodfill algorithm is strongly based on a similar algorithm in ``Graphics
Gems'' by Paul Heckbert.

<P>
The format of the ColorFloodfillImage method is:

<P>
<PRE>    void ColorFloodfillImage(Image *image,const RunlengthPacket *target,
      Image *tile,const int x_offset,const int y_offset,const PaintMethod method)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG><A NAME="item_o">image:</A></STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>target:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> RunlengthPacket structure. This is the 
<FONT SIZE=-1>RGB</FONT> value of the target color.


<DT><STRONG>tile:</STRONG><DD>
<P>
An image representing the image to tile onto the floodplane.

<DT><STRONG>x,y:</STRONG><DD>
<P>
Unsigned integers representing the current location of the pen.

<DT><STRONG>method:</STRONG><DD>
<P>
drawing method of type PrimitiveType: floodfill or fill to border.

</DL></DL>
<P>
<HR>
<H2><A NAME="DrawImage">DrawImage</A></H2>
<P>
Method DrawImage draws a primitive (line, rectangle, ellipse) on the image.

<P>
The format of the DrawImage method is:

<blockquote>void DrawImage (<A HREF="types/Image.html">Image</A> *image, const AnnotateInfo *annotate_info) </blockquote>

<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>annotate_info:</STRONG><DD>
<P>
The address of a DrawInfo structure.

</DL></DL>
<P>
<HR>
<H2><A NAME="InsidePrimitive">InsidePrimitive</A></H2>
<P>
Method InsidePrimitive returns the opacity of the pen at the (x,y) position of the image. The opacity is Opaque if the (x,y) position is within the primitive as defined in primitive_info. 
<FONT SIZE=-1>A</FONT> value less than fully opaque and greater than fully transparent is returned for a primitive edge pixel to allow for anti-aliasing. Otherwise fully transparent is returned.


<P>
Rick Mabry provided the algorithms for anti-aliased primitives.

<P>
The format of the InsidePrimitive method is:

<P>
<PRE>    unsigned short InsidePrimitive(PrimitiveInfo *primitive_info,
      const AnnotateInfo *annotate_info,const PointInfo *pixel,Image *image)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>opacity:</STRONG><DD>
<P>
Method InsidePrimitive returns a pen opacity associated with the (x,y)
position of the image.

<DT><STRONG>primitive_info:</STRONG><DD>
<P>
Specifies a pointer to a PrimitiveInfo structure.

<DT><STRONG>annotate_info:</STRONG><DD>
<P>
Specifies a pointer to a AnnotateInfo structure.

<DT><STRONG>target:</STRONG><DD>
<P>
PointInfo representing the (x,y) location in the image.

<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

</DL></DL>
<P>
<HR>
<H2><A NAME="MatteFloodfillImage">MatteFloodfillImage</A></H2>
<P>
Method MatteFloodfillImage floodfills the designated area with a matte
value. The floodfill algorithm is strongly based on a similar algorithm in
``Graphics Gems'' by Paul Heckbert.

<P>
The format of the MatteFloodfillImage method is:

<P>
<PRE>    void MatteFloodfillImage(Image *image,const RunlengthPacket *target,
      const unsigned int matte,const int x_offset,const int y_offset,
      const PaintMethod method)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image.

<DT><STRONG>target:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> RunlengthPacket structure. This is the 
<FONT SIZE=-1>RGB</FONT> value of the target color.


<DT><STRONG>matte:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> integer value representing the amount of
transparency.

<DT><STRONG>x,y:</STRONG><DD>
<P>
Unsigned integers representing the current location of the pen.

<DT><STRONG>method:</STRONG><DD>
<P>
drawing method of type PrimitiveType: floodfill or fill to border.

</DL></DL>
<P>
<HR>
<H2><A NAME="OpagueImage">OpagueImage</A></H2>
<P>
Method OpaqueImage changes the color of an opaque pixel to the pen color.

<P>
The format of the OpaqueImage method is:

<P>
<PRE>    void OpaqueImage(Image *image,const char *opaque_color,
      const char *pen_color)
</PRE>
<P>

<FONT SIZE=-1>A</FONT> description of each parameter follows:

<DL><DL>
<DT><STRONG>image:</STRONG><DD>
<P>
The address of a structure of type Image; returned from ReadImage.

<DT><STRONG>opaque_color, pen_color:</STRONG><DD>
<P>

<FONT SIZE=-1>A</FONT> character string that contain an 
<FONT SIZE=-1>X11</FONT> color string.


</DL></DL>
</BODY>

</HTML>