Image
[ XITE Reference Manual | XITE home ]
Contents
Name
Image, ImageError, ImageHasColormap, ImageInstallPixelType,
ImageRedisplay, ImageRedisplayScreen, ImageRedisplayArea,
ImageKill, ImageScreenXtoPos, ImageScreenYtoPos,
ImageScreenXYtoAdr, ImageScreenToHeight, ImageScreenToWidth,
ImageHeightToScreen, ImageWidthToScreen, ImagePosXYtoAdr,
ImageTranslateZoomPanArgs, ImagePosXtoScreen,
ImagePosYtoScreen, ImageGetZoom, ImageSetZoom,
ImageCopyImagePart, ImageCopyResources, ImageGetResources,
ImageGetImageResources, ImageGetZoomAll, ImageSetZoomAll -
XITE X11 image widget
<xite/Image.h>
<xite/ImageP.h>
imageWidgetClass
Image
Composite
The Image widget is part of the XITE (X-based Image Processing
Tools and Environment) software. It is used by all the
display programs supplied with XITE.
The widget is designed to work with images in the BIFF format.
It can probably work also with other image formats, by
supplying a different set of image format description routines
(see ImageFormat(3)).
This widget handles a number of pixeltypes, see the section
Predefined pixeltypes below.
The widget handles zooming and panning through a translation
table and action functions. Various events can be caught
and supplied to callback functions.
See the documentation on the main XITE display program
xshow(1) as well as the XITE ximage toolkit ximage(3) for
more information on how this widget can be used in an
application.
Apart from the resources of the superclass:
-
XtNimageImage (class XtCImageImage)
- Type: Pointer,
Default: NULL
This refers to the complete data structure for an image.
The pointer is general enough to refer to any kind of
data structure. In most cases it will refer to a BIFF image,
but it could be used to refer to other image formats.
-
XtNimageBand (class XtCImageBand)
- Type: Pointer,
Default: NULL
This refers to the complete data structure for the
band/channel of the image. It does not refer to the first
pixel (see the resource XtNimageData).
Setting this resource while not setting the primary band
resources (XtNimageRedBand, XtNimageGreenBand,
XtNimageBlueBand) means that the image is PseudoColor (not
rgb). This will automatically update the pixel data resources
for the primaries (XtNimageRedData, XtNimageGreenData,
XtNimageBlueData). This is necessary in case the image is
displayed with a composite visual class.
-
XtNimageRedBand (class XtCImageRedBand)
- Type: Pointer,
Default: NULL
If the image is a three-band image which should be interpreted
as an rgb image where the tree bands represent the amount of
red, green and blue, then this resource refers to the complete
data structure for the band/channel with the red component.
Also refer to the XtNimageRgb and XtNimageRedData
resources.
-
XtNimageGreenBand (class XtCImageGreenBand)
- Type: Pointer,
Default: NULL
Same as XtNimageRedBand, but for the green component.
-
XtNimageBlueBand (class XtCImageBlueBand)
- Type: Pointer,
Default: NULL
Same as XtNimageRedBand, but for the blue component.
-
XtNimageRgb (class XtCImageRgb)
- Type: Boolean,
Default: False
This is a readonly resource telling whether the widget
displays a three-band rgb image or a one-band image.
-
XtNimageData (class XtCImageData)
- Type: Pointer,
Default: NULL
This refers to the first pixel of the band given by
XtNimageBand.
-
XtNimageRedData (class XtCImageRedData)
- Type: Pointer,
Default: NULL
This refers to the first pixel of the red image component,
given by XtNimageRedBand, if the image is supposed to be
interpreted as a three-band rgb image. If the image is a
one-band image, then this resource will equal XtNimageData.
-
XtNimageGreenData (class XtCImageGreenData)
- Type: Pointer,
Default: NULL
Same as XtNimageRed, but for the green component.
-
XtNimageBlueData (class XtCImageBlueData)
- Type: Pointer,
Default: NULL
Same as XtNimageRed, but for the blue component.
-
XtNimageTitle (class XtCImageTitle)
- Type: Pointer,
Default: NULL
Title of the image.
-
XtNimagePixtype (class XtCImagePixtype)
- Type: Pointer,
Default: NULL
Name of pixeltype. Typically one of "ImageBytePixel",
"ImageUnsignedShortPixel" etc.
-
XtNimageWidth (class XtCImageWidth)
- Type: int,
Default: NULL
Width of image data in pixels.
-
XtNimageHeight (class XtCImageHeight)
- Type: int,
Default: NULL
Height of image data in pixels.
-
XtNvariableAspect (class XtCVariableAspect)
- Type: Boolean,
Default: "false"
True if image can have variable aspect ratio. Otherwise
it will be forced to have a fixed aspect ratio.
-
XtNimageLineLength (class XtCImageLineLength)
- Type: int,
Default: NULL
Number of bytes which each row of the image occupies.
-
XtNimageXstart (class XtCImageXstart)
- Type: int,
Default: NULL
The global horizontal coordinate of the upper-left corner-pixel
of the image.
-
XtNimageYstart (class XtCImageYstart)
- Type: int,
Default: NULL
The global vertical coordinate of the upper-left corner-pixel
of the image.
-
XtNdisplayMethod (class XtCDisplayMethod)
- Type: int,
Default: NULL
This resource can be given one of the following values
0x0000
0x0001
0x0010 (STATIC_GRAY_1)
0x0020 (STATIC_GRAY_2)
0x0040 (STATIC_GRAY_4)
0x0080 (STATIC_GRAY_8)
0x1040 (GRAY_SCALE_4)
0x1080 (GRAY_SCALE_8)
0x3080 (PSEUDO_COLOR_8, 128-entry colormaps
(reduced-color))
0x3080 (PSEUDO_COLOR_8_A, 128-entry colormaps
(reduced-color))
0x3081 (PSEUDO_COLOR_8_B, 256-entry colormaps)
0x4180 (TRUE_COLOR_24)
0x5180 (DIRECT_COLOR_24,
128-entry composite colormaps
(reduced-color))
0x5180 (DIRECT_COLOR_24_A,
128-entry composite colormaps
(reduced-color))
0x5181 (DIRECT_COLOR_24_B,
256-entry composite colormaps)
Setting XtNdisplayMethod to 0 (default value), means that
the displaymethod is calculated from visual class and depth.
The result will be a reduced-color displaymethod if visual
class is PseudoColor or DirectColor (leaving some colors for
overlays and window manager).
Setting XtNdisplayMethod to 1 means that the displaymethod
is calculated the same way as for the value 0, but in this
case, the result will be a full-color displaymethod if
visual class is PseudoColor or DirectColor.
-
XtNprintValues (class XtCPrintValues)
- Type: Boolean,
Default: "true"
Whether or not to print the numeric value of each pixel in
the image window. This will only be done when each pixel is
large enough to give room for the textual representation.
-
XtNcolortab (class XtCColortab)
- Type: int,
Default: -1
An index into an array of colortables. This resource identifies
which colortable (in the array of colortables) is active in
the image window. The array is not local to the image widget,
but must be supplied by the application.
The default value (of -1) will make the widget Initialize
method choose the value 0.
-
XtNcolorCells (class XtCColorCells)
- Type: int,
Default: -1
Number of colors actually used to display the image. This
may be different from the length of the X colormap used by
the image, because the Image widget is capable of using only
a part of a colormap. This is to reduce the "technicolor"
effect when the mouse is moved between different windows.
For such "reduced-color" display of images, this resource will
typically have the value 128 (whereas there are typically
256 cells in an X colormap). For full-color display, the
resource will be 256.
The default value (of -1) will make the widget Initialize
method calculate a legal value based on the XtNdisplayMethod
resource and the number of cells in the colormaps for the
chosen visual.
-
XtNcolorPtr (class XtCColorPtr)
- Type: Pointer,
Default: NULL
A reference to an integer array of XtNcolorCells elements.
Each pixel value is transformed into a new value before it is
sent to the pixmap (which will be shown in a screen window).
The original pixel value is used as an index into an integer
array. The value in the array cell becomes the pixel value in
the pixmap.
The integer transformation array (which always has 256
elements) is identical to the XtNcolorPtr array for the first
XtNcolorCells elements. If XtNcolorCells < 256, then the
XtNcolorPtr array is repeated in the transformation array.
If the pixeltype is not unsigned byte, the pixelvalue is first
scaled and translated to a legal interval (typically between 0
and XtNcolorCells) before it is used as a lookup index.
With e.g. XtNcolorCells equal to 128 (reduced-color display)
and XtNcolorPtr an array from 64 to 191, the integer
transformation array contains the 256 values
64,...191,64,...,191. The scaled and translated original
pixelvalues will then be transformed (by the first 128
elements) into the range 64,...,191.
The default value will make the widget Initialize method
find an array based on the XtNdisplayMethod and
XtNcolorCells resources. For "reduced-color" display, the
array will have 128 elements with values from 64 to 191.
For "full-color" display, the array will have 256 elements
from 0 to 255.
-
XtNvisual (class XtCVisual)
- Type: Visual,
Default: NULL
Class of visual. See the "Xlib Programming Manual" by
Adrian Nye (O'Reilly & Associates, Inc.), chapter 7 for
more information about visuals.
-
XtNscaletype (class XtCScaletype)
- Type: int,
Default: NULL
This resource takes the value SCALE_LINEAR or SCALE_THRESHOLD.
In the first case, pixel values are scaled linearly during
the transformation described for the XtNcolorPtr resource.
The scaling factors are given by the resources XtNscalea and
XtNscaleb.
For SCALE_TRESHOLD, the resource XtNscalea is used as a
threshold level during the transformation described for
the XtNcolorPtr resource. If the pixel value is below the
threshold level, it is set equal to the minimum element in
the integer transformation array, otherwise it is set equal
to the maximum element in the transformation array.
This resource is always interpreted as SCALE_LINEAR for all
pixeltypes except unsigned byte and signed byte.
-
XtNscalea (class XtCScalea)
- Type: float,
Default: 1.0
Inclination of linear transformation of pixel values during
display, if XtNscaletype equals SCALE_LINEAR. For XtNscaletype
equal to SCALE_THRESHOLD, this resource is the threshold
level.
-
XtNscaleb (class XtCScaleb)
- Type: float,
Default: 0.0
Offset of linear transformation of pixel values during display.
-
XtNminval (class XtCMinval)
- Type: float,
Default: NULL
Minimum pixelvalue for an image. This has an effect on the
scaling of the image. For unsigned byte images, this is often
set to 0. If the same image is represented by a float
pixeltype, this resource is usually calculated from the
particular image. These two images may look slightly different
on the screen, although the images are actully equal.
-
XtNmaxval (class XtCMaxval)
- Type: float,
Default: NULL
Maximum pixelvalue for an image. See the comment about the
XtNminval resource.
-
XtNfont (class XtCFont)
- Type: FontStruct,
Default: "XtDefaultFont"
This is one of the fonts which may be used to print the
numerical pixelvalues in the image screen window if the
resource XtNprintValues is set.
The following three fonts are alternatives to XtNfont.
Typically these fonts will be of different sizes. The widget
will try the smallest one first. Pixelvalues will only
be printed if the textual representation fits inside the
pixel square.
-
XtNfont1 (class XtCFont1)
- Type: FontStruct,
Default: NULL
Another font for printing pixelvalues.
-
XtNfont2, (class XtCFont2)
- Type: FontStruct,
Default: NULL
Another font for printing pixelvalues.
-
XtNfont3, (class XtCFont3)
- Type: FontStruct,
Default: NULL
Another font for printing pixelvalues.
-
XtNcallback (class XtCCallback)
- Type: XtCallbackList,
Default: NULL
The functions on this callback list will be called by the
notify action function described below.
-
XtNresizeCallback (class XtCResizeCallback)
- Type: XtCallbackList,
Default: NULL
The functions on this list are called by the notify action
function described below, provided that the event which
invokes the action function is NULL.
-
XtNimageUpdate (class XtCImageUpdate)
- Type: int,
Default: NULL
This resource controls the resizing and display of an image.
For a description, see the description of redisplay routines
in the section Convenience routines below.
-
XtNmenubar (class XtCMenubar)
- Type: Boolean,
Default: "true"
Whether or not a menubar should be visible above the image.
The menubar itself is not an attribute of the image widget.
This resource merely is used to tell the application whether
there is a menubar present. It is the responsibility of the
application to take the proper action (or no action).
-
nop
- No operation.
-
notify
-
This action can be used to log position, select images and so
on. It assigns values to the attributes of the ImageCallbackRec
structure and invokes the callback functions on the
XtNcallback callback-list with a reference to the
ImageCallbackRec structure.
The attributes of the ImageCallbackRec structure are
-
reason
- An integer with value ACTIVATE or RESIZE.
-
event
- An XEvent reference to the event which triggered the action
function.
-
img
- A "struct imagestruct *" reference to the XtNimageImage
resource of the widget in which the event took place.
-
band
- A "struct bandstruct *" reference to the XtNimageBand resource
of the widget in which the event took place.
-
x, y
- Two integers which represent the coordinates where one of the
events ButtonPress, ButtonRelease, MotionNotify or Expose
took place (or where the mouse pointer happened to be located
in case of other events).
-
data
- An ImageData reference to the actual image data pixel at the
location given by x and y.
-
pixtype
- A "pixel *" reference to the pixeltype of the image data.
See the section Predefined pixeltypes below.
-
zoom
- A "float" with the current zoom factor.
-
magnification
- A "float" with the current ratio of image pixels which are
in the widget window.
-
xpan, ypan
- Two integers describing the horizontal and vertical panning.
-
kill
- Identical to the ImageKill function described below in the
section Convenience routines.
-
zoom_pan
- This action takes 3 arguments, zoom_pan(zoom, pan_x, pan_y).
The arguments may be absolute or relative values. Position
may also be translated from mouse position. If the pan
arguments end in a C, the pan arguments specify the center
position in the new image rather than the upper left corner.
<Zoom_pan> := zoom_pan(<zoom_arg>,
<pan_arg>, <pan_arg>)
<zoom_arg> := In | Out | Normal |
<zoom_op><float_value> |
<float_value>
<zoom_op> := + | - | / | *
<pan_arg> := <pos_ulc> | <pos_cp>
<pos_ulc> := MousePos | <pan_op><int_value> |
<int_value>
<pos_cp> := MousePosC | <int_value>C
<pan_op> := + | -
<zoom_arg> equal to "In" means double zoom factor, "Out"
means half zoom factor, "Normal" means zoom factor 1.0.
MousePos means get position from mouse position.
See the section Default translation bindings for examples.
-
WMColormap
- WMColormap informs the window manager about desired colormaps.
This will enable a visible menubar and visible popup menus in
an image window also when the image is displayed with some
combination of DirectColor visual and non-reduced-color mode
display.
-
WMColormap(Enter)
- Mouse pointer enters image.
-
WMColormap(Leave)
- Mouse pointer leaves image.
<Key>Q: kill()
<EnterWindow>: WMColormap(Enter)
<LeaveWindow>: WMColormap(Leave)
None<Key>Left: zoom_pan(+0, -4, +0)
None<Key>Right: zoom_pan(+0, +4, +0)
None<Key>Up: zoom_pan(+0, +0, -4)
None<Key>Down: zoom_pan(+0, +0, +4)
Shift<Key>Left: zoom_pan(+0, -16, +0)
Shift<Key>Right: zoom_pan(+0, +16, +)
Shift<Key>Up: zoom_pan(+0, +0, -16)
Shift<Key>Down: zoom_pan(+0, +0, +16)
Ctrl<Key>Left: zoom_pan(+0, -256, +0)
Ctrl<Key>Right: zoom_pan(+0, +256, +0)
Ctrl<Key>Up: zoom_pan(+0, +0, -256)
Ctrl<Key>Down: zoom_pan(+0, +0, +256)
Ctrl <Btn1Down>: zoom_pan(*2, MousePosC, MousePosC)
Ctrl <Btn2Down>: zoom_pan(0, MousePosC, MousePosC)
Ctrl <Btn3Down>: zoom_pan(/2, MousePosC, MousePosC)
Shift Ctrl <Btn1Down>:
zoom_pan(*8, MousePosC, MousePosC)
Shift Ctrl <Btn2Down>:
zoom_pan(1, MousePosC, MousePosC)
Shift Ctrl <Btn3Down>:
zoom_pan(/8, MousePosC, MousePosC)
None <Btn1Up>: notify()
None <Btn2Up>: notify()
None <Btn3Up>: notify()
<MouseMoved>: notify()
There are two callback lists, identified by the
resources XtNcallback and XtNresizeCallback. See the
description of these resources.
Each pixeltype is of type pixel, given by
typedef struct pixelstruct
{
char *pixelname;
int pixelsize;
resizefunc resize;
imageprintffunc printf;
int txtlen;
scale_type scaletype;
float scalea, scaleb;
float minval, maxval;
} pixel;
The various predefined pixeltypes are
-
bytepixel
-
pixelname : ImageBytePixel
pixelsize : 1
resize : ImageByteResize
printf : ImageBytePrintf
txtlen : 3
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : 0.0
maxval : UNS_BYTE_MAX
-
signedbytepixel
-
pixelname : ImageSignedBytePixel
pixelsize : 1
resize : ImageSignedByteResize
printf : ImageSignedBytePrintf
txtlen : 4
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : SIGN_BYTE_MIN
maxval : SIGN_BYTE_MAX
-
shortpixel
-
pixelname : ImageShortPixel
pixelsize : 2
resize : ImageShortResize
printf : ImageShortPrintf
txtlen : 6
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : SIGN_SHORT_MIN
maxval : SIGN_SHORT_MAX
-
unsignedshortpixel
-
pixelname : ImageUnsignedShortPixel
pixelsize : 2
resize : ImageUnsignedShortResize
printf : ImageUnsignedShortPrintf
txtlen : 5
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : 0.0
maxval : UNS_SHORT_MAX
-
longpixel
- This is a 4-byte integer, long on some platforms, int on
others.
pixelname : ImageLongPixel
pixelsize : 4
resize : ImageLongResize
printf : ImageLongPrintf
txtlen : 10
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : INTEGER_MIN
maxval : INTEGER_MAX
-
floatpixel
-
pixelname : ImageFloatPixel
pixelsize : 4
resize : ImageFloatResize
printf : ImageFloatPrintf
txtlen : 9
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : 0.0
maxval : 1.0
-
doublepixel
-
pixelname : ImageDoublePixel
pixelsize : 8
resize : ImageDoubleResize
printf : ImageDoublePrintf
txtlen : 9
scaletype : SCALE_LINEAR
scalea : 1.0
scaleb : 0.0
minval : 0.0
maxval : 1.0
-
Routines related to the visual class
-
-
ImageHasColormap
int ImageHasColormap( ImageWidget wid );
Return False if visual class is StaticGray, StaticColor or
TrueColor (i.e. if visual does not have a changeable colormap,
the colormap is immutable), True if Visual type is GrayScale,
PseudoColor or DirectColor.
-
Redisplay routines:
-
-
ImageRedisplay
void ImageRedisplay( ImageWidget wid,
update_status update );
If update is not equal to UPDATE_NONE, sets the private
update-variable of the image widget equal to update. Calls
the resize and expose methods of the widget class which wid
belongs to (this may be a subclass, e.g.
imageOverlayWidgetClass). The expose method is called with
NULL as event and region arguments.
The update variable governs the behaviour of the resize
method. If the widget size is unchanged, but the contents need
to be remade, use update equal to UPDATE_ZOOMPAN. If the
image is new (XtNimageImage, XtNimageBand, XtNimageData or the
corresponding color-specific bands or data resources), use
update equal to UPDATE_NEWSIZE. If the widget size is
changed, but the image data are unchanged, use update equal
to UPDATE_RESIZE. If only exposure is needed (no change to
size, zoom, pan or data), use UPDATE_NONE.
If update equals UPDATE_REDISPLAY, the resize method just
calls the pixeltype- (and displaymethod-) specific resize
function on the rectangle given by the private widget
variables updatex, updatey, updatew and updateh.
Afterwards the private update variable is set equal to
UPDATE_RESIZE before the resize method returns. This
functionality can be achieved more easily with the function
ImageRedisplayScreen or ImageRedisplayArea (see below).
If the image data and widget size are unchanged, but one of
the resources XtNscaletype, XtNscalea, XtNscaleb, XtNminval,
XtNmaxval, XtNcolorCells, XtNcolorPtr, XtNdisplayMethod have
changed, then use ImageRedisplayScreen or
ImageRedisplayArea. However, if these resources have been
changed with a call to XtVaSetValues or XtSetValues, then
there should be no need to call any of these redisplay
functions explicitly (it is taken care of by the SetValues
method of the widget).
If the window pixmap size equals the image size (data size),
the private variable resize is set to False, and the
pixeltype-specific resize function does not use the geometric
translation tables.
For more information on the pixeltype-specific resize
functions, see ImageResize(3).
-
ImageRedisplayScreen
void ImageRedisplayScreen( ImageWidget wid,
int x, int y, int width, int height );
Calls the resize method with the private image update-variable
equal to UPDATE_REDISPLAY. This will call the resize function
for the particular pixeltype (and displaymethod), on the
rectangle given by x, y, width and height. Finally,
the expose method is called with region defined by the
rectangle given by x, y, width and height. The
coordinates are relative to the screen window.
-
ImageRedisplayArea
int ImageRedisplayArea( ImageWidget wid,
int x, int y, int width, int height );
The coordinates are relative to the image (the actual data).
Translates to screen coordinates and calls
ImageRedisplayScreen.
-
Zoom-handling routines:
- Also see the action function zoom_pan in the section
Image actions above.
-
ImageTranslateZoomPanArgs
void ImageTranslateZoomPanArgs(
ImageWidget wid, char* zoomarg,
char* panxarg, char* panyarg, int mousex,
int mousey, float* zoom, int* xpan,
int* ypan );
Interprets the arguments given to the zoom_pan action
function (here supplied as strings through zoomarg,
panxarg and panyarg). Uses this along with the supplied
values for the current zoom factor (zoom), horizontal and
vertical panning (xpan and ypan) to return updated values
in zoom, xpan and ypan.
-
ImageGetZoom
void ImageGetZoom( ImageWidget wid,
float* zoom, int* xpan, int* ypan,
double* factor );
Returns the private image zoom-variable in zoom and the
private image factor-variable in factor. The factor
variable holds the ratio of image pixels which are in the
widget. The arguments xpan and ypan return the private
pan-variables with the private xstart and ystart-variables
added. (The latter two variables are inherited from the BIFF
image data structure used for the XITE image format. They
specify the relative position of the image in a global
coordinate system.) The xpan and ypan variables are
relative to the image data coordinate system.
-
ImageSetZoom
void ImageSetZoom( ImageWidget wid,
float zoom, int x, int y );
Sets the zoom factor to zoom and the horizontal and vertical
panning to x and y, respectively, after limiting the
arguments to legal intervals. If the arguments are different
from the previous zoom and pan-values, the image is
redisplayed and exposed. If all the widgets are bound to the
same zoom factor (with the function ImageSetZoomAll)
then all the widgets are treated equally.
-
ImageSetZoomAll
int ImageSetZoomAll( Widget wid, int on );
Description: Set zoom all flag, If on = TRUE, all widgets
will use the same zoom and pan parameters.
-
ImageGetZoomAll
int ImageGetZoomAll( Widget wid );
Return the value of the zoom all flag.
-
Routines for coordinates of image and screen window.
-
These functions translate between the coordinate system
of an image (the actual data) and the coordinate system
of the window on screen. The upper left corner of a window,
the origin, has coordinates (0, 0). The upper left corner
of an image has coordinates (xstart, ystart).
-
ImageScreenXtoPos
int ImageScreenXtoPos(ImageWidget wid, int x);
ImageScreenXtoPos translates from horizontal coordinate on
screen to horizontal coordinate in image data.
The input coordinate x is relative to the left edge of the
screen window.
-
ImageScreenYtoPos
int ImageScreenYtoPos(ImageWidget wid, int x);
ImageScreenYtoPos behaves like ImageScreenXtoPos, except
for the vertical coordinate. The input coordinate y is
relative to the upper edge of the screen window.
-
ImageScreenToHeight
int ImageScreenToHeight(ImageWidget wid,
int height);
ImageScreenToHeight translates from height in screen
coordinate system to height in image coordinate system.
It is allowed for height to be larger than the height of
the window.
-
ImageScreenToWidth
int ImageScreenToWidth(ImageWidget wid,
int width);
ImageScreenToWidth translates from width in screen
coordinate system to width in image coordinate system.
It is allowed for width to be larger than the width of
the window.
-
ImagePosXtoScreen
int ImagePosXtoScreen(ImageWidget wid, int x,
int right);
ImagePosXtoScreen finds horizontal screen window coordinate
from horizontal image coordinate.
-
ImagePosYtoScreen
int ImagePosYtoScreen(ImageWidget wid, int y,
int bottom);
ImagePosYtoScreen finds vertical screen window coordinate
from vertical image coordinate.
-
ImageHeightToScreen
int ImageHeightToScreen(ImageWidget wid,
int height, int maximum);
ImageHeightToScreen translates from height in image
coordinate system to height in screen coordinate system.
With nonzero maximum, round upwards to include
an integer number of image pixels. Otherwise, round
downwards.
-
ImageWidthToScreen
int ImageWidthToScreen(ImageWidget wid,
int width, int maximum);
ImageWidthToScreen translates from width in image
coordinate system to width in screen coordinate system.
With nonzero maximum, round upwards to include
an integer number of image pixels. Otherwise, round
downwards.
-
ImageScreenXYtoAdr
ImageData ImageScreenXYtoAdr(ImageWidget wid,
int x, int y, int options);
ImageScreenXYtoAdr returns a pointer to the pixel which
has screen window coordinates (x,y). options determines
what band the address is for (0: band, 1: red_band,
2: green_band, 3: blue_band).
-
ImagePosXYtoAdr
ImageData ImagePosXYtoAdr(ImageWidget wid,
int x, int y, int options);
ImagePosXYtoAdr returns a pointer to the pixel which has
image coordinates (x,y). options has the same meaning as
for ImageScreenXYtoAdr.
-
Miscellaneous routines:
-
-
ImageError
void ImageError( Widget wid, int messnr );
Call the function XtAppErrorMsg with one of the error messages
ImageWidget: No error
ImageWidget: Not enough memory
ImageWidget: Bad parameters to zoom_pan
ImageWidget: Unknown DisplayMethod
ImageWidget: Unknown Pixeltype
The messnr argument determines the message printed.
-
ImageInstallPixelType
void ImageInstallPixelType( pixel* pix );
Insert the pixel type given by pix into a list
of pixeltypes. The first element inserted is at the end of
the list with its next-attribute referencing NULL. The last
element inserted is referenced by the Image class records
pixel_class attribute.
-
ImageKill
void ImageKill( Widget wid, XEvent* event,
String* params, Cardinal* num_params );
Calls XtDestroyWidget on the toplevel shell parent of wid.
-
ImageCopyImagePart
void ImageCopyImagePart( ImageWidget widto,
ImageWidget widfrom );
Sets the ImageWidget part of the widget widto equal to the
ImageWidget part of the widget widfrom. No resizing or
exposure is done.
-
ImageCopyResources
void ImageCopyResources( ImageWidget widto,
ImageWidget widfrom );
Sets all the ImagePart resources of widto equal to the
ImagePart resources of widfrom.
-
ImageGetResources
void ImageGetResources( ImageWidget wid,
ArgList *args, Cardinal *num_args );
Returns a list of resource-value pairs for all the resources
of wid. If the function is called before the class is
initialized, the resource list as specified in the class
record is returned. If it is called after the class has been
initialized, the returned list also contains the superclass
resources.
-
ImageGetImageResources
void ImageGetImageResources( ImageWidget wid,
ArgList *args, Cardinal *num_args );
Returns a list of resource-value pairs which are specific for
the ImageWidget (not including super-class resources).
ImageResize(3), ImageFormat(3), ImageOverlay(3),
ximage(3), xshow(1)
Svein Bøe
Otto Milvang and Svein Bøe