1ximage(1)                AfterStep X11 window manager                ximage(1)
2
3
4

NAME

6       ximage - functionality for displaying ASImages on X display libAfterIm‐
7       age/ximage.h
8

NAMEximage

10       - Defines conversion to and from XImages and Pixmaps.
11
12

DESCRIPTION

14       ximage2asimage()    - convert XImage structure into ASImage
15       pixmap2asimage()    - convert X11 pixmap into ASImage
16       asimage2ximage()    - convert ASImage into XImage
17       asimage2mask_ximage() - convert alpha channel of ASImage into XImage
18       asimage2pixmap()    - convert ASImage into Pixmap ( possibly using
19                             precreated XImage )
20       asimage2mask()  - convert alpha channel of ASImage into 1 bit
21                             mask Pixmap.
22

SEE ALSO

24       Other libAfterImage modules :
25                ascmap.h asfont.h asimage.h asvisual.h blender.h export.h
26                import.h transform.h ximage.h
27

AUTHOR

29       Sasha Vasko <sasha at aftercode dot net>
30

NAMEpicture_ximage2asimage()

SYNOPSIS

33       ASImage *picture_ximage2asimage ( struct ASVisual *asv,
34                                         XImage * xim, XImage *alpha_xim,
35                                         unsigned int compression );
36

INPUTS

38       asv    - pointer to valid ASVisual structure
39
40       xim    - source XImage
41
42       alpha_xim
43              - source XImage for Alpha channel
44
45       compression
46              - degree of compression of resulting ASImage.
47
48

RETURN VALUE

50       pointer to newly allocated ASImage, containing encoded data, on
51       success. NULL on failure.
52

DESCRIPTION

54       picture_ximage2asimage will attempt to create new ASImage with the same
55       dimensions as supplied XImage. If both XImages are supplied - they must
56       have same dimentions. XImage will be decoded based on
57       supplied ASVisual, and resulting scanlines will be encoded into
58       ASImage.
59

NAMEximage2asimage()

61       - same as picture_ximage2asimage with alpha_ximage set  to  NULL.  Sup‐
62       plied for compatibility with older versions and for convinience.
63
64

SYNOPSIS

66       ASImage *ximage2asimage ( struct ASVisual *asv, XImage * xim,
67                                 unsigned int compression );
68

INPUTS

70       asv    - pointer to valid ASVisual structure
71
72       xim    - source XImage
73
74       compression
75              - degree of compression of resulting ASImage.
76
77

RETURN VALUE

79       pointer to newly allocated ASImage, containing encoded data, on
80       success. NULL on failure.
81

DESCRIPTIONlibAfterImage/pixmap2asimage()

NAMEpixmap2asimage()

SYNOPSIS

85       ASImage *pixmap2ximage( ASVisual *asv, Pixmap p, int x, int y,
86                               unsigned int width, unsigned int height,
87                                  unsigned long plane_mask,
88                               unsigned int compression);
89

INPUTS

91       asv    - pointer to valid ASVisual structure
92
93       p      - source Pixmap
94
95       x,     y,
96
97       width, height- rectangle on Pixmap to be encoded into ASImage.
98
99       plane_mask
100              - limits color planes to be copied from Pixmap.
101
102       keep_cache
103              -  indicates  if  we should keep XImage, used to copy image data
104              from the X server, and attached it to ximage member of resulting
105              ASImage.
106
107       compression
108              - degree of compression of resulting ASImage.
109
110

RETURN VALUE

112       pointer to newly allocated ASImage, containing data in XImage format,
113       on success. NULL on failure.
114

DESCRIPTION

116       pixmap2ximage will obtain XImage of the requested area of the
117       X Pixmap, and it will attach it to newly created ASImage using
118       alt.ximage member. After that newly created ASImage could be used
119       in any transformations.
120

NAMEpixmap2asimage()

SYNOPSIS

123       ASImage *pixmap2asimage ( struct ASVisual *asv, Pixmap p,
124                                 int x, int y,
125                                 unsigned int width,
126                                 unsigned int height,
127                                 unsigned long plane_mask,
128                                 Bool keep_cache,
129                                 unsigned int compression );
130

INPUTS

132       asv    - pointer to valid ASVisual structure
133
134       p      - source Pixmap
135
136       x,     y,
137
138       width, height- rectangle on Pixmap to be encoded into ASImage.
139
140       plane_mask
141              - limits color planes to be copied from Pixmap.
142
143       keep_cache
144              -  indicates  if  we should keep XImage, used to copy image data
145              from the X server, and attached it to ximage member of resulting
146              ASImage.
147
148       compression
149              - degree of compression of resulting ASImage.
150
151

RETURN VALUE

153       pointer to newly allocated ASImage, containing encoded data, on
154       success. NULL on failure.
155

DESCRIPTION

157       same as picture2asimage() with alpha pixmap set to None. Supplied for
158       compatibility and convinience.
159

NAMEpicture2asimage()

SYNOPSIS

162       ASImage *picture2asimage (struct ASVisual *asv,
163                                 Pixmap rgb, Pixmap a,
164                                 int x, int y,
165                                 unsigned int width,
166                                 unsigned int height,
167                                 unsigned long plane_mask,
168                                 Bool keep_cache,
169                                 unsigned int compression );
170

INPUTS

172       asv    - pointer to valid ASVisual structure
173
174       rgb    - source Pixmap for red, green and blue channels
175
176       a      - source Pixmap for the alpha channel
177
178       x,     y,
179
180       width, height- rectangle on Pixmap to be encoded into ASImage.
181
182       plane_mask
183              - limits color planes to be copied from Pixmap.
184
185       keep_cache
186              -  indicates  if  we should keep XImage, used to copy image data
187              from the X server, and attached it to ximage member of resulting
188              ASImage.
189
190       compression
191              - degree of compression of resulting ASImage.
192
193

RETURN VALUE

195       pointer to newly allocated ASImage, containing encoded data, on
196       success. NULL on failure.
197

DESCRIPTION

199       picture2asimage will obtain XImage of the requested area of the
200       X Pixmap, If alpha channel pixmap is supplied - it will be used to
201       encode ASImage's alpha channel. Alpha channel pixmap must be either
202       8 or 1 bit deep, and it must have the same dimentions as main Pixmap.
203

NAMEasimage2ximage()

SYNOPSIS

206       XImage  *asimage2ximage  (struct ASVisual *asv, ASImage *im);
207

INPUTS

209       asv    - pointer to valid ASVisual structure
210
211       im     - source ASImage
212
213

RETURN VALUE

215       On success returns newly created and encoded XImage of the same
216       colordepth as the supplied ASVisual. NULL on failure.
217

DESCRIPTION

219       asimage2ximage() creates new XImage of the exact same size as
220       supplied ASImage, and depth of supplied ASVisual. REd, Green and
221       Blue channels of ASImage then gets decoded, and encoded into XImage.
222       Missing scanlines get filled with black color.
223

NOTES

225       Returned pointer to XImage will also be stored in im->alt.ximage,
226       and It will be destroyed when XImage is destroyed, or reused in any
227       subsequent calls to asimage2ximage(). If any other behaviour is
228       desired - make sure you set im->alt.ximage to NULL, to dissociate
229       XImage object from ASImage.
230

SEE ALSO

232       create_visual_ximage()
233

NAMEasimage2alpha_ximage()

SYNOPSIS

236       XImage  *asimage2alpha_ximage (struct ASVisual *asv,
237                                      ASImage *im, Bool bitmap);
238

INPUTS

240       asv    - pointer to valid ASVisual structure
241
242       im     - source ASImage
243
244       bitmap -  if  True  resulting  XImage will have depth of 1 bit - tradi‐
245              tional X mask; otherwise it will have depth of  8  (usefull  for
246              XFree86 RENDER extension)
247
248

RETURN VALUE

250       On success returns newly created and encoded XImage of the depth 1 or 8.
251       NULL on failure.
252

DESCRIPTION

254       asimage2alpha_ximage() creates new XImage of the exact same size as
255       supplied ASImage, and depth 1 or 8. Alpha channels of ASImage then gets
256       decoded, and encoded into XImage. In case requested depth is 1 then
257       alpha channel is interpreted like so: 127 or greater is encoded as 1,
258       otherwise as 0.
259       Missing scanlines get filled with 1s as they signify absence of mask.
260

NOTES

262       Returned pointer to XImage will also be stored in im->alt.mask_ximage,
263       and It will be destroyed when XImage is destroyed, or reused in any
264       subsequent calls to asimage2mask_ximage(). If any other behaviour is
265       desired - make sure you set im->alt.mask_ximage to NULL, to dissociate
266       XImage object from ASImage.
267

NAMEasimage2mask_ximage()

269       - same as asimage2alpha_ximage(). Supplied for convinience and compati‐
270       bility with older versions.
271
272

SYNOPSIS

274       XImage  *asimage2mask_ximage (struct ASVisual *asv, ASImage *im);
275

INPUTS

277       asv    - pointer to valid ASVisual structure
278
279       im     - source ASImage
280
281

RETURN VALUE

283       On success returns newly created and encoded XImage of the depth 1.
284       NULL on failure.
285

NAMEasimage2pixmap()

SYNOPSIS

288       Bool     asimage2drawable( struct ASVisual *asv, Drawable d, ASImage *im,
289                               GC gc,
290                              int src_x, int src_y, int dest_x, int dest_y,
291                              unsigned int width, unsigned int height,
292                                  Bool use_cached);
293

INPUTS

295       asv    - pointer to valid ASVisual structure
296
297       d      - destination drawable - Pixmap or Window
298
299       im     - source ASImage
300
301       gc     - precreated GC to use  for  XImage  transfer.  If  NULL,  asim‐
302              age2drawable() will use DefaultGC.
303
304       src_x  -  Specifies  the  offset  in  X from the left edge of the image
305              defined by the ASImage structure.
306
307       src_y  - Specifies the offset in Y from  the  top  edge  of  the  image
308              defined by the ASImage structure.
309
310       dest_x,dest_y-
311              Specify  the x and y coordinates, which are relative to the ori‐
312              gin of the drawable and are the coordinates of the subimage.
313
314       width,height
315              - Specify the width and height of the subimage, which define the
316              dimensions of the rectangle.
317
318       use_cached
319              -  If  True will make asimage2pixmap() to use XImage attached to
320              ASImage, instead of  creating  new  one.  Only  works  if  ASIm‐
321              age->ximage data member is not NULL.
322
323

RETURN VALUE

325       On success returns True.
326

DESCRIPTION

328       asimage2drawable() creates will copy portion of ASImage onto the X
329       Drawable. It checks if it needs to encode XImage
330       from ASImage data, and calls asimage2ximage() if yes, it has to.
331       It then supplied gc or DefaultGC of the screen to transfer
332       XImage to the server.
333       Missing scanlines get filled with black color.
334

SEE ALSO

336       asimage2ximage()
337       asimage2pixmap()
338       create_visual_pixmap()
339

NAMEasimage2pixmap()

SYNOPSIS

342       Pixmap   asimage2pixmap  ( struct ASVisual *asv, Window root,
343                                  ASImage *im, GC gc, Bool use_cached);
344

INPUTS

346       asv    - pointer to valid ASVisual structure
347
348       root   - root window of destination screen
349
350       im     - source ASImage
351
352       gc     -  precreated  GC  to  use  for  XImage transfer. If NULL, asim‐
353              age2pixmap() will use DefaultGC.
354
355       use_cached
356              - If True will make asimage2pixmap() to use XImage  attached  to
357              ASImage,  instead  of  creating  new  one.  Only  works if ASIm‐
358              age->ximage data member is not NULL.
359
360

RETURN VALUE

362       On success returns newly pixmap of the same colordepth as ASVisual.
363       None on failure.
364

DESCRIPTION

366       asimage2pixmap() creates new pixmap of exactly same size as
367       supplied ASImage. It then calls asimage2drawable to copy entire content
368       of the ASImage onto that created pixmap.
369

EXAMPLE

371       asview.c: ASView.5
372

SEE ALSO

374       asimage2ximage()
375       asimage2drawable()
376       create_visual_pixmap()
377

NAMEasimage2mask()

SYNOPSIS

380       Pixmap   asimage2mask ( struct ASVisual *asv, Window root,
381                               ASImage *im, GC gc, Bool use_cached);
382       asv        - pointer to valid ASVisual structure
383       root       - root window of destination screen
384       im         - source ASImage
385       gc         - precreated GC for 1 bit deep drawables to use for
386                    XImage transfer. If NULL, asimage2mask() will create one.
387       use_cached - If True will make asimage2mask() to use mask XImage
388                   attached to ASImage, instead of creating new one. Only
389                   works if ASImage->alt.mask_ximage data member is not NULL.
390

RETURN VALUE

392       On success returns newly created pixmap of the colordepth 1.
393       None on failure.
394

DESCRIPTION

396       asimage2mask() creates new pixmap of exactly same size as
397       supplied ASImage. It then calls asimage2mask_ximage().
398       It then uses supplied gc, or creates new gc, to transfer
399       XImage to the server and put it on Pixmap.
400       Missing scanlines get filled with 1s.
401

SEE ALSO

403       asimage2mask_ximage()
404
405
406
4073rd Berkeley Distribution      AfterStep v.2.2.6                     ximage(1)
Impressum