toolbox/src/exampleCode/X/pixmap/rgb2pix README ------- rgb2pix takes rgb file(s) as input and creates X11 Pixmap(s) out of them. These X11 pixmaps are used to create a Motif XmToggleButton label pixmap (XmNlabelPixmap) and select pixmap (XmNselectPixmap). A label pixmap is used to attach an image to an XmToggleButton that represents the buttons intended function. A select pixmap is used as an image to represent the state of the button when it is selected (or pressed). If, for instance, the toggle button where to represent a directory of files, the label pixmap of that button might show a closed manilla folder and the select pixmap might show an open manilla folder. If a single rgb file is specified, only the label pixmap will be created for the toggle button. rgb2pix was written for 2 reasons: 1) It serves as an example of how to read rgb (SGI imagelib image file format) files. This is handy for writing translations into other image formats or to do image processing on the raw data. 2) It serves as a utility for easily creating pixmaps out of rgb image data. rgb2pix makes has no reliance on XPM and so requires none of the XPM libraries or documentation. XPM requires that an image be specified in ASCII which gets unruly for large images. Bypassing XPM is convenient in that no other representation of the image is necessary. On SGI systems, rgb files are common and readily available. Usage The Makefile are provided does C compilation. It can be edited to do C++ instead to then compile the same source code files To exectute rgb2pix: rgb2pix <label RGB image file> [selected RGB image file] Try running in the following manner for an idea of the intended functionality: rgb2pix henry.rgb henryDown.rgb Notes Label and Selection pixmaps should be the same size. Bugs This program does not handle rgb files with 2 bytes per pixel channel. See imginfo output to check the number of bytes per pixel channel on an image. The number of bytes per channel is the "z" value.
Source
Documentation
Images
Reference