


IMXWD(3IM)             SDSC IMAGE LIBRARY              IMXWD(3IM)



NAME
     imxwd - X11 XWD file translation

SYNOPSIS
     #include <stdio.h>
     #include "sdsc.h"
     #include "im.h"

     int ImFileRead( fd, "xwd", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFRead( fp, "xwd", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileWrite( fd, "xwd", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFWrite( fp, "xwd", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;


DESCRIPTION
     xwd window dump image files  are  used  by  the  xwd(1)  and
     xwud(1)   tools   of  MIT's  X  Window  System,  version  11
     (hereafter referred to as X11).  See the  X11  documentation
     set for details on how to use these tools.

FILE RECOGNITION
     X11 xwd files are recognized by the following filename  suf-
     fixes:  .xwd and .x11.

NOTES
     SDSC image library support of the X11 xwd  format  does  not
     require use of any X11 libraries and contains no proprietary
     code.  X11 xwd format handling is available on  any  machine
     for which the SDSC image library is available.

  Reading X11 XWD files
     The SDSC image library supports reading of  xwd  files  that
     have the following file format features:

          Version 7 format (X Window system, version 11).





SDSC              Last change: August 19, 1992                  1






IMXWD(3IM)             SDSC IMAGE LIBRARY              IMXWD(3IM)



          Z-format pixmaps only.

          8-bit color index images with color maps and 24-bit RGB
          images with color maps.

          Pixel values stored in 8-bit, 16-bit, or 32-bit  bitmap
          units  in  MBF  (most-significant  byte  first)  or LBF
          (least-significant byte first) byte order.

     The SDSC image library does not support reading of xwd files
     that have the following file format features:

          Version 6 format or older (obsolete  X  Window  System,
          version 10).

          XY bitmaps or XY pixmaps.   Primarily  used  for  mono-
          chrome images.

     xwd fields meant for use  to  display  the  image  on  an  X
     display are ignored.  These fields include the window width,
     height, and (x,y) location; and border width.

     Incoming 8-bit  xwd  images  are  mapped  to  image  library
     IMVFBINDEX8 VFBs.  If the xwd file includes a color map, the
     VFB contains a color lookup table (CLT).

     Incoming 24-bit xwd  images  are  mapped  to  image  library
     IMVFBRGB  VFBs.   If  the  xwd  file  includes  a  color map
     (DirectColor visual class), the color map  is  automatically
     applied  to  incoming RGB data as pixels are stored into the
     VFB.  The returned VFB will not contain the xwd file's color
     map.

  Writing X11 XWD files
     The SDSC image library writes IMVFBINDEX8 and IMVFBRGB  VFBs
     as  X11  xwd  image  files.  IMVFBINDEX8 VFBs with a CLT are
     written including a color map.

     Other image library VFB types are converted  to  IMVFBINDEX8
     or  IMVFBRGB  VFBs  prior  to  being  written  out.  See the
     ImFileWrite(3IM) man page for further details.

     xwd files written by the SDSC image library are always  ver-
     sion  7  (X11),  Z-format pixmaps.  8-bit images are written
     with 8-bits per pixel and  an  8-bit  bitmap  unit.   24-bit
     images  are written with 32-bits per pixel and a 32-bit bit-
     map  unit.   Byte  and  bit  order  are  always  MBF  (most-
     significant byte first).

     Window display attributes are set to use a pseudo-color  (8-
     bit)  or  true-color  (24-bit) visual class, a window height
     and width the same as the image height and width,  a  window



2                 Last change: August 19, 1992               SDSC






IMXWD(3IM)             SDSC IMAGE LIBRARY              IMXWD(3IM)



     (x,y)  location  of  (0,0) and a 0 border width.  The window
     name is set to xwdump if no "image name" tag is found in the
     dataTable.

ERRORS
     In addition to those listed for  ImFileWrite(3IM),  X11  xwd
     file reading returns the following error codes:

          IMEMALLOC        Cannot allocate enough memory
          IMESYNTAX        Syntax error in parsing xwd file
          IMESYS           System call error in read operation
          IMEUNSUPPORTED   Unsupported feature of xwd file format

     In addition to those listed for  ImFileWrite(3IM),  X11  xwd
     file writing returns the following error codes:

          IMEMALLOC   Cannot allocate enough memory
          IMESYS      System call error in write operation

DOCUMENTATION
     xwd(1) and xwud(1) from the X11 man page set.

     _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e, MIT X Window System,  Version
     11.

SEE ALSO
     ImIntro(3IM),   ImErrNo(3IM),   imconv(1IM),    imfile(1IM),
     imformats(1IM), imxbm(3IM)

AUTHOR
     Dave Nadeau and Toan-Vinh Le
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu




















SDSC              Last change: August 19, 1992                  3



