010ac410f7aff0e483f771854e6e017a273565f7
[platform/upstream/libX11.git] / man / XPutImage.man
1 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be included
12 .\" in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 .\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 .\" OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .\" Except as contained in this notice, the name of the X Consortium shall
23 .\" not be used in advertising or otherwise to promote the sale, use or
24 .\" other dealings in this Software without prior written authorization
25 .\" from the X Consortium.
26 .\"
27 .\" Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by
28 .\" Digital Equipment Corporation
29 .\"
30 .\" Portions Copyright \(co 1990, 1991 by
31 .\" Tektronix, Inc.
32 .\"
33 .\" Permission to use, copy, modify and distribute this documentation for
34 .\" any purpose and without fee is hereby granted, provided that the above
35 .\" copyright notice appears in all copies and that both that copyright notice
36 .\" and this permission notice appear in all copies, and that the names of
37 .\" Digital and Tektronix not be used in in advertising or publicity pertaining
38 .\" to this documentation without specific, written prior permission.
39 .\" Digital and Tektronix makes no representations about the suitability
40 .\" of this documentation for any purpose.
41 .\" It is provided ``as is'' without express or implied warranty.
42 .\" 
43 .\"
44 .ds xT X Toolkit Intrinsics \- C Language Interface
45 .ds xW Athena X Widgets \- C Language X Toolkit Interface
46 .ds xL Xlib \- C Language X Interface
47 .ds xC Inter-Client Communication Conventions Manual
48 .na
49 .de Ds
50 .nf
51 .\\$1D \\$2 \\$1
52 .ft 1
53 .\".ps \\n(PS
54 .\".if \\n(VS>=40 .vs \\n(VSu
55 .\".if \\n(VS<=39 .vs \\n(VSp
56 ..
57 .de De
58 .ce 0
59 .if \\n(BD .DF
60 .nr BD 0
61 .in \\n(OIu
62 .if \\n(TM .ls 2
63 .sp \\n(DDu
64 .fi
65 ..
66 .de FD
67 .LP
68 .KS
69 .TA .5i 3i
70 .ta .5i 3i
71 .nf
72 ..
73 .de FN
74 .fi
75 .KE
76 .LP
77 ..
78 .de IN          \" send an index entry to the stderr
79 ..
80 .de C{
81 .KS
82 .nf
83 .D
84 .\"
85 .\"     choose appropriate monospace font
86 .\"     the imagen conditional, 480,
87 .\"     may be changed to L if LB is too
88 .\"     heavy for your eyes...
89 .\"
90 .ie "\\*(.T"480" .ft L
91 .el .ie "\\*(.T"300" .ft L
92 .el .ie "\\*(.T"202" .ft PO
93 .el .ie "\\*(.T"aps" .ft CW
94 .el .ft R
95 .ps \\n(PS
96 .ie \\n(VS>40 .vs \\n(VSu
97 .el .vs \\n(VSp
98 ..
99 .de C}
100 .DE
101 .R
102 ..
103 .de Pn
104 .ie t \\$1\fB\^\\$2\^\fR\\$3
105 .el \\$1\fI\^\\$2\^\fP\\$3
106 ..
107 .de ZN
108 .ie t \fB\^\\$1\^\fR\\$2
109 .el \fI\^\\$1\^\fP\\$2
110 ..
111 .de hN
112 .ie t <\fB\\$1\fR>\\$2
113 .el <\fI\\$1\fP>\\$2
114 ..
115 .de NT
116 .ne 7
117 .ds NO Note
118 .if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
119 .if \\n(.$ .if !'\\$1'C' .ds NO \\$1
120 .ie n .sp
121 .el .sp 10p
122 .TB
123 .ce
124 \\*(NO
125 .ie n .sp
126 .el .sp 5p
127 .if '\\$1'C' .ce 99
128 .if '\\$2'C' .ce 99
129 .in +5n
130 .ll -5n
131 .R
132 ..
133 .               \" Note End -- doug kraft 3/85
134 .de NE
135 .ce 0
136 .in -5n
137 .ll +5n
138 .ie n .sp
139 .el .sp 10p
140 ..
141 .ny0
142 .TH XPutImage __libmansuffix__ __xorgversion__ "XLIB FUNCTIONS"
143 .SH NAME
144 XPutImage, XGetImage, XGetSubImage \- transfer images
145 .SH SYNTAX
146 .HP
147 int XPutImage\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, GC \fIgc\fP\^,
148 XImage *\fIimage\fP\^, int \fIsrc_x\fP\^, int \fIsrc_y\fP\^, int
149 \fIdest_x\fP\^, int \fIdest_y\fP\^, unsigned int \fIwidth\fP\^, unsigned int
150 \fIheight\fP\^); 
151 .HP
152 XImage *XGetImage\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, int
153 \fIx\fP\^, int \fIy\fP\^, unsigned int \fIwidth\fP\^, unsigned int
154 \fIheight\fP\^, unsigned long \fIplane_mask\fP\^, int \fIformat\fP\^); 
155 .HP
156 XImage *XGetSubImage\^(\^Display *\fIdisplay\fP\^, Drawable \fId\fP\^, int
157 \fIx\fP\^, int \fIy\fP\^, unsigned int \fIwidth\fP\^, unsigned int
158 \fIheight\fP\^, unsigned long \fIplane_mask\fP\^, int \fIformat\fP\^, XImage
159 *\fIdest_image\fP\^, int \fIdest_x\fP\^, \fIdest_y\fP\^); 
160 .SH ARGUMENTS
161 .IP \fId\fP 1i
162 Specifies the drawable. 
163 .IP \fIdest_image\fP 1i
164 Specifies the destination image.
165 .ds Dx , which are relative to the origin of the drawable \
166 and are the coordinates of the subimage \
167 or which are relative to the origin of the destination rectangle, \
168 specify its upper-left corner, and determine where the subimage \
169 is placed in the destination image
170 .IP \fIdest_x\fP 1i
171 .br
172 .ns
173 .IP \fIdest_y\fP 1i
174 Specify the x and y coordinates\*(Dx.
175 .IP \fIdisplay\fP 1i
176 Specifies the connection to the X server.
177 .IP \fIformat\fP 1i
178 Specifies the format for the image.
179 You can pass
180 .ZN XYPixmap
181 or 
182 .ZN ZPixmap .
183 .IP \fIgc\fP 1i
184 Specifies the GC.
185 .IP \fIimage\fP 1i
186 Specifies the image you want combined with the rectangle. 
187 .IP \fIplane_mask\fP 1i
188 Specifies the plane mask.
189 .\" *** JIM: NEED MORE INFO FOR THIS. ***
190 .IP \fIsrc_x\fP 1i
191 Specifies the offset in X from the left edge of the image defined
192 by the 
193 .ZN XImage 
194 structure.
195 .IP \fIsrc_y\fP 1i
196 Specifies the offset in Y from the top edge of the image defined
197 by the 
198 .ZN XImage 
199 structure.
200 .ds Wh \ of the subimage, which define the dimensions of the rectangle
201 .IP \fIwidth\fP 1i
202 .br
203 .ns
204 .IP \fIheight\fP 1i
205 Specify the width and height\*(Wh.
206 .ds Xy , which are relative to the origin of the drawable \
207 and define the upper-left corner of the rectangle
208 .IP \fIx\fP 1i
209 .br
210 .ns
211 .IP \fIy\fP 1i
212 Specify the x and y coordinates\*(Xy.
213 .SH DESCRIPTION
214 The
215 .ZN XPutImage
216 function
217 combines an image with a rectangle of the specified drawable.
218 The section of the image defined by the src_x, src_y, width, and height 
219 arguments is drawn on the specified part of the drawable.
220 If 
221 .ZN XYBitmap 
222 format is used, the depth of the image must be one,
223 or a
224 .ZN BadMatch 
225 error results.
226 The foreground pixel in the GC defines the source for the one bits in the image,
227 and the background pixel defines the source for the zero bits.
228 For 
229 .ZN XYPixmap 
230 and 
231 .ZN ZPixmap , 
232 the depth of the image must match the depth of the drawable,
233 or a
234 .ZN BadMatch
235 error results.
236 .LP
237 If the characteristics of the image (for example, byte_order and bitmap_unit)
238 differ from what the server requires,
239 .ZN XPutImage 
240 automatically makes the appropriate
241 conversions.
242 .LP
243 This function uses these GC components: 
244 function, plane-mask, subwindow-mode, clip-x-origin, clip-y-origin, 
245 and clip-mask.
246 It also uses these GC mode-dependent components:
247 foreground and background.
248 .LP
249 .ZN XPutImage
250 can generate
251 .ZN BadDrawable ,
252 .ZN BadGC ,
253 .ZN BadMatch ,
254 and
255 .ZN BadValue 
256 errors.
257 .LP
258 The
259 .ZN XGetImage
260 function returns a pointer to an
261 .ZN XImage
262 structure.
263 This structure provides you with the contents of the specified rectangle of
264 the drawable in the format you specify.
265 If the format argument is 
266 .ZN XYPixmap ,
267 the image contains only the bit planes you passed to the plane_mask argument.
268 If the plane_mask argument only requests a subset of the planes of the
269 display, the depth of the returned image will be the number of planes
270 requested.
271 If the format argument is 
272 .ZN ZPixmap ,
273 .ZN XGetImage
274 returns as zero the bits in all planes not 
275 specified in the plane_mask argument.
276 The function performs no range checking on the values in plane_mask and ignores
277 extraneous bits.
278 .LP
279 .ZN XGetImage
280 returns the depth of the image to the depth member of the
281 .ZN XImage
282 structure.
283 The depth of the image is as specified when the drawable was created,
284 except when getting a subset of the planes in 
285 .ZN XYPixmap
286 format, when the depth is given by the number of bits set to 1 in plane_mask.
287 .LP
288 If the drawable is a pixmap, 
289 the given rectangle must be wholly contained within the pixmap, 
290 or a
291 .ZN BadMatch
292 error results.
293 If the drawable is a window, 
294 the window must be viewable, 
295 and it must be the case that if there were no inferiors or overlapping windows,
296 the specified rectangle of the window would be fully visible on the screen
297 and wholly contained within the outside edges of the window,
298 or a
299 .ZN BadMatch
300 error results.
301 Note that the borders of the window can be included and read with
302 this request.
303 If the window has backing-store, the backing-store contents are
304 returned for regions of the window that are obscured by noninferior
305 windows. 
306 If the window does not have backing-store,
307 the returned contents of such obscured regions are undefined.
308 The returned contents of visible regions of inferiors
309 of a different depth than the specified window's depth are also undefined.
310 The pointer cursor image is not included in the returned contents.
311 If a problem occurs,
312 .ZN XGetImage
313 returns NULL.
314 .LP
315 .ZN XGetImage
316 can generate
317 .ZN BadDrawable ,
318 .ZN BadMatch ,
319 and
320 .ZN BadValue 
321 errors.
322 .LP
323 The 
324 .ZN XGetSubImage 
325 function updates dest_image with the specified subimage in the same manner as 
326 .ZN XGetImage . 
327 If the format argument is 
328 .ZN XYPixmap ,
329 the image contains only the bit planes you passed to the plane_mask argument.
330 If the format argument is 
331 .ZN ZPixmap ,
332 .ZN XGetSubImage
333 returns as zero the bits in all planes not 
334 specified in the plane_mask argument.
335 The function performs no range checking on the values in plane_mask and ignores
336 extraneous bits.
337 As a convenience,
338 .ZN XGetSubImage
339 returns a pointer to the same
340 .ZN XImage
341 structure specified by dest_image.
342 .LP
343 The depth of the destination
344 .ZN XImage
345 structure must be the same as that of the drawable.
346 If the specified subimage does not fit at the specified location
347 on the destination image, the right and bottom edges are clipped.
348 If the drawable is a pixmap,
349 the given rectangle must be wholly contained within the pixmap,
350 or a
351 .ZN BadMatch
352 error results.
353 If the drawable is a window, 
354 the window must be viewable, 
355 and it must be the case that if there were no inferiors or overlapping windows,
356 the specified rectangle of the window would be fully visible on the screen
357 and wholly contained within the outside edges of the window,
358 or a
359 .ZN BadMatch
360 error results.
361 If the window has backing-store, 
362 then the backing-store contents are returned for regions of the window 
363 that are obscured by noninferior windows. 
364 If the window does not have backing-store, 
365 the returned contents of such obscured regions are undefined.
366 The returned contents of visible regions of inferiors
367 of a different depth than the specified window's depth are also undefined.
368 If a problem occurs,
369 .ZN XGetSubImage
370 returns NULL.
371 .LP
372 .ZN XGetSubImage
373 can generate
374 .ZN BadDrawable ,
375 .ZN BadGC ,
376 .ZN BadMatch ,
377 and
378 .ZN BadValue 
379 errors.
380 .SH DIAGNOSTICS
381 .TP 1i
382 .ZN BadDrawable
383 A value for a Drawable argument does not name a defined Window or Pixmap.
384 .TP 1i
385 .ZN BadGC
386 A value for a GContext argument does not name a defined GContext.
387 .TP 1i
388 .ZN BadMatch
389 An
390 .ZN InputOnly
391 window is used as a Drawable.
392 .TP 1i
393 .ZN BadMatch
394 Some argument or pair of arguments has the correct type and range but fails
395 to match in some other way required by the request.
396 .TP 1i
397 .ZN BadValue
398 Some numeric value falls outside the range of values accepted by the request.
399 Unless a specific range is specified for an argument, the full range defined
400 by the argument's type is accepted.  Any argument defined as a set of
401 alternatives can generate this error.
402 .SH "SEE ALSO"
403 \fI\*(xL\fP