# E.S.O. - VLT project 
#
# "@(#) $Id: ImageDisplay.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" 
#
# This file is processed by the ESO/VLT docDoManPages command to
# produce a man page in nroff, TeX and MIF formats. 
# See docDoManPages(1) for a description of the input format.
# 
# who             when       what
# --------------  ---------  ----------------------------------------
# Allan Brighton  20 Jul 95  Created

NAME
ImageDisplay - A C++ class for managing the display of an XImage

SYNOPSIS
#include "ImageDisplay.h"

class ImageDisplay {
...
public:

    // constructor
    ImageDisplay(Display *display, Visual *visual, GC gc, 
		 int depth, int useXShm, int verbose);

    // destructor
    ~ImageDisplay();

    // create or update an XImage with the given size
    int update(int width, int height);
    
    // copy the XImage to a Drawable in the X Server
    void put(Drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height);

    // return a pointer to the XImage data
    unsigned char* data();

    // inline query methods
    int width();
    int height();
    int bitmapPad();
    int bytesPerLine();

    // return true if we are really using X shared memory
    int usingXShm();
};

DESCRIPTION
This class manages the creation, display and disposal of an XImage,
optionally using X shared memory, if available.

CONSTRUCTOR
The constructor takes as arguments: the X display, visual, GC and
image depth, all for later reference in X calls. In addition, 2 flags
may be specified: "useXshm" is set to true if X shared memory should
be tried for and "verbose" is set to true if diagnostic messages
should be printed out at run time.

METHODS
There are two main methods. One to create or update an XImage and one to 
copy it to the X server:

int update(int width, int height)
	Create or update the XImage so that it has the given width and
	height, using X shared memory, if applicable.


void put(Drawable d, int src_x, int src_y, 
	    int dest_x, int dest_y, 
	    int width, int height)
	Copy the contents of the XImage to the given drawable with the
	given arguments, using X shared memory, if applicable.

In addition, there are inline methods defined to query the XImage
width and height, bytes per line and padding.  Note: always use
"bytesPerLine()" rather than width() in calculations, since padding in
X shared memory can make the two different.

SEE ALSO
RtdImage
---------------------------------------------------------------------------
