SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Mandrake Other XITE-3.3-3.i386.rpm

IMAGEOVERLAY

Section: C Library Functions (3)
Updated: 16 Mar 1998
Index

 

NAME

ImageOverlay, ImageOverlayColor,ImageOverlayCopyImageOverlayPart, ImageOverlayCopyImagePart,ImageOverlayCopyResources, ImageOverlayGetResources,ImageOverlayDisplay, ImageOverlayDrawBox, ImageOverlayDrawLine,ImageOverlayDrawOrigo, ImageOverlayDrawPoint,ImageOverlayDrawRectangle, ImageOverlayFill,ImageOverlayPosXYtoAdr, ImageOverlayProtect,ImageOverlayRedisplay, ImageOverlayScreenXYtoAdr,- XITE X11 image overlay widget

 

APPLICATION HEADER FILE

<xite/ImageOverlay.h>

 

CLASS HEADER FILE

<xite/ImageOverlayP.h>

 

CLASS

imageOverlayWidgetClass

 

CLASS NAME

ImageOverlay

 

SUPERCLASS

Image

 

DESCRIPTION

The ImageOverlay widget is part of the XITE (X-based ImageProcessing Tools and Environment) software. It is used by someof the display programs supplied with XITE.

Most of the functionality is taken care of by the superclassImage widget (see Image(3)for information on this).

The ImageOverlay widget provides two extra facilities overthe Image widget. They are the ability to display an overlayimage and the ability to manipulate a region of interest (ROI).

See the documentation on the main XITE display programxshow(1)as well as the XITE ximage toolkit ximage(3)formore information on how this widget can be used in anapplication.

 

RESOURCES

Apart from the resources of the superclass:

XtNoverlay (class XtCOverlay)
Type: Pointer,Default: NULL

This refers to the complete data structure for theband/channel of the overlay image. It does not necessarilyrefer to the first pixel (unless the data structure onlyconsists of the pixels with no header information).

XtNprotectOverlay (class XtCProtectOverlay)
Type: Boolean,Default: "false"

Whether or not to protect the overlay from being changed.

XtNdisplayOverlay (class XtCDisplayOverlay)
Type: Boolean,"true"

Whether or not to show the overlay.

XtNoverlaytab (class XtCOverlaytab)
Type: int,Default: -1

An index into an array of colortables. This resourceidentifies which colortable (in the array of colortables) isactive for the image overlay part. The array is not local tothe image widget, but must be supplied by the application.

The default value (of -1) will make the widget Initializemethod choose the value 0.

XtNoverlayColorCells (class XtCOverlayColorCells)
Type: int,Default: -1

Number of colors actually used to display the overlay image.This will typically be different from the length of the Xcolormap used by the window, because the non-overlay part ofthe image will probably be using more colors than the overlayimage.

The default value (of -1) will make the widget Initializemethod calculate a legal value based on the XtNdisplayMethodresource. Currently the only value used is 32.

XtNoverlayColorPtr (class XtCOverlayColorPtr)
Type: Pointer,Default: NULL

A reference to an integer array of XtNoverlayColorCellselements.

Each overlay pixel value is transformed into a new valuebefore it is sent to the pixmap (which will be shown in ascreen window). The original pixel value is used as an indexinto an integer array. The value in the array cell becomes thepixel value in the pixmap.

The integer transformation array (which always has 256elements) is identical to the XtNoverlayColorPtr array for thefirst XtNoverlayColorCells elements. IfXtNoverlayColorCells < 256, then the XtNoverlayColorPtr arrayis repeated in the transformation array.

With e.g. XtNoverlayColorCells equal to 32 andXtNoverlayColorPtr an array from 192 to 223, the integertransformation array contains the 256 values192,...223,192,...,223,.... The overlay pixelvalues will thenbe transformed (by the first 32 elements) into the range192,...,223.

The default value (NULL) will make the widget Initializemethod determine a value for this resource. Withthe XtNdisplayMethod set to give "reduced-color" display,then this array will be a 32-element array with values from192 to 223.

XtNdrawColor (class XtCDrawColor)
Type: int,Default: NULL

The color used to draw the overlay.

XtNdrawProc (class XtCDrawProc)
Type: XtCallbackList,Default: NULL

The functions on this callback list will be called by thedrawaction function described below.

XtNroiProc (class XtCRoiProc)
Type: XtCallbackList,Default: NULL

The functions on this callback list will be called by theroiaction function when the first action-function argumentis one of StartDrag, ExtendDrag, StopDrag, StopMove, Move,Drag.

XtNroiActivated (class XtCRoiActivated)
Type: int,Default: NULL

True if a ROI is active (being changed).

XtNroiX (class XtCRoiX)
Type: int,Default: NULL

Horizontal position of ROI, relative to screen.

XtNroiY (class XtCRoiY)
Type: int,Default: NULL

Vertical position of ROI, relative to screen.

XtNroiWidth (class XtCRoiWidth)
Type: int,Default: NULL

Horizontal width of ROI, relative to screen.

XtNroiHeight (class XtCRoiHeight)
Type: int,Default: NULL

Vertical height of ROI, relative to screen.

XtNroiZoomPan (class XtCRoiZoomPan)
Type: Boolean,Default: "false"

Whether or not ROI is to zoom and pan with the image.

XtNroiDisplay (class XtCRoiDisplay)
Type: int,Default: NULL

Whether or not to show ROI.

XtNroiPermanent (class XtCRoiPermanent)
Type: int,Default: NULL

Whether ROI should be permanently displayed (or only whilebeing made).

XtNroiFill (class XtCRoiFill)
Type: int,Default: NULL

Whether the inside of the ROI rectangle should be filled.

XtNroiXaspect (class XtCRoiXaspect)
Type: int,Default: NULL

Nonzero if ROI should be square.

XtNroiYaspect (class XtCRoiYaspect)
Type: int,Default: NULL

Nonzero if ROI should be square.

 

IMAGEOVERLAY ACTIONS

draw

Draw graphics in the overlay image. Some basic drawingroutines are available:

draw(origo [, on/off])Toggle origo (or on/off).

draw(point [, size])Draw a point, or a cross of size "size".

draw(line)Draw line from origo

draw(rectangle)Draw rectancle from origo

draw(box)Draw filled rectancle from origo

draw(fill)Fill region (4-neighbour)

draw(clear)Clear region (8-neighbour)

draw(graphic [, on/off])Toggle overlay plane (or on/off)

draw(protect [, on/off])Toggle protect switch (or on/off)

draw(color [, newval])Increase draw color index by one (or set to newval).

roi
Draw inverted region of interest. The available routinesare

roi(StartDrag)Set first corner of ROI

roi(Drag)Move second corner of ROI

roi(StopDrag)Set second corner of ROI

roi(StartMove)Notify ROI

roi(Move)Move ROI

roi(StopDrag)Notify stop Move

roi(ExtendDrag)Keep first corner of an existing ROI

WMColormap
WMColormap informs the window manager about desired colormaps.This will enable a visible menubar and visible popup menus inan image window also when the image is displayed with somecombination of DirectColor visual and non-reduced-color modedisplay.

WMColormap(Enter)Mouse pointer enters image.

WMColormap(Leave)Mouse pointer leaves image.

The drawand roiaction functions assign values to theattributes of the ImageOverlayCallbackRec structure and invokethe callback functions on the XtNdrawProc and XtNroiProccallback-lists respectively, with a reference to theImageOverlayCallbackRec structure.

The attributes of the ImageOverlayCallbackRec structure are

reason
An integer with a value indicating which draw action wasdesired.

event
An "XEvent *" reference to the event which triggered theaction function.

img
A "struct imagestruct *" reference to the XtNimageImageresource of the widget in which the event took place.

band
A "struct bandstruct *" reference to the XtNimageBandresource of the widget in which the event took place.

overlay
A "struct bandstruct *" reference to the XtNimageOverlayresource of the widget in which the event took place.

value
An integer with the color index used to draw the overlayplane.

x, y
Two integers which represent the coordinates where one ofthe events ButtonPress, ButtonRelease or MotionNotify tookplace (or else where the previous event took place).

width, height
Always zero.

xorigo, yorigo
The private imageoverlay widget variabels xorigo andyorigo.

 

DEFAULT TRANSLATION BINDINGS


 <Key>Q:          kill()
 <Key>C:          draw(color)
 <Key>P:          draw(protect)
 <Key>G:          draw(graphic)
 <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)
 Shift Ctrl <Btn1Down>:
        zoom_pan(*8, MousePosC, MousePosC)
 Shift Ctrl <Btn2Down>:
        zoom_pan(1, MousePosC, MousePosC)
 Shift Ctrl <Btn3Down>:
        zoom_pan(/8, MousePosC, MousePosC)
 Ctrl <Btn1Down>: zoom_pan(*2, MousePosC, MousePosC)
 Ctrl <Btn2Down>: zoom_pan(0, MousePosC, MousePosC)
 Ctrl <Btn3Down>: zoom_pan(/2, MousePosC, MousePosC)
 None <Btn2Up>:   notify()
 None <Btn3Up>:   notify()
 <MouseMoved>:    notify()

 

IMAGEOVERLAY CALLBACKS

There are two callback lists, identified by the resourcesXtNdrawProc and XtNroiProc. See the description of theseresources.

 

PREDEFINED PIXELTYPE

Apart from the pixeltypes defined by the superclass:

overlaypixel

 pixelname : ImageOverlayPixel,
 pixelsize : 1,
 resize    : ImageOverlayResize,
 printf    : ImageOverlayPrintf,
 txtlen    : 3,
 scaletype : SCALE_NONE,
 scalea    : 0.0,
 scaleb    : 0.0,

 

CONVENIENCE ROUTINES

Routines for coordinates of image and screen window.

ImageOverlayScreenXYtoAdr
 ImageData ImageOverlayScreenXYtoAdr(
    ImageOverlayWidget wid, int x, int y,
    int option );

ImageOverlayScreenXYtoAdrreturns a pointer to the pixelwhich has screen window coordinates (x,y). optionis notused.

ImageOverlayPosXYtoAdr
 ImageData ImageOverlayPosXYtoAdr(
    ImageOverlayWidget wid, int x, int y,
    int option );

ImageOverlayPosXYtoAdrreturns a pointer to the pixel whichhas image coordinates (x,y). optionis not used.

Routines for drawing in the overlay

ImageOverlayProtect
 int ImageOverlayProtect(
    ImageOverlayWidget wid, int state );

Set new protect status of overlay plane. statemay beOVERLAY_CLEAR,OVERLAY_SETor OVERLAY_TOGGLE.

ImageOverlayFill
 int ImageOverlayFill( ImageOverlayWidget wid,
    int x, int y, int search, int fill, int nc,
    int mode, update_status update );

Fill an area with the pixelvalue fill.Start in position(x,y).Follow nc.nc = 4 (4 connected neighbours) or nc = 8(8 connected neighbours).


 'mode' = 0, border fill.
             while (pix != search) fill;
 'mode' = 1, flood fill.
             while (pix == search) fill;

update= TRUE will activate ImageRedisplayArea.

ImageOverlayDrawRectangle
 int ImageOverlayDrawRectangle(
    ImageOverlayWidget wid, int x1, int y1,
    int x2, int y2, int value,
    update_status update );

Draw a filled rectangle in the overlay image at imagecoordinates (x,y)with size (width, height).The rectangleis filled with valuepixels. The special value -1is usedfor drawing by inverting the pixels. update= TRUE willactivate ImageRedisplayArea.

ImageOverlayDrawPoint
 int ImageOverlayDrawPoint(
    ImageOverlayWidget wid, int x, int y,
    int size, int value,
    update_status update );

Draw a point in the overlay image at image coordinates (x,y).If size > 1, the point is written as a cross of size size.The point is filled with valuepixels. The special value-1is used for drawing by inverting the pixels. update=TRUE will activate ImageRedisplayArea.

ImageOverlayDrawOrigo
 int ImageOverlayDrawOrigo(
    ImageOverlayWidget wid, int origo, int x,
    int y );

Set Boolean value origo and the coordinates to (x,y). Drawfunctions which need an origo will draw only if origo is true.

ImageOverlayDrawLine
 int ImageOverlayDrawLine(
    ImageOverlayWidget wid, int x1, int y1,
    int x2, int y2, int value,
    update_status update );

Draw a line in the overlay image from image coordinates(x1,y1)to (x2,y2).The line is written with valuepixels. The special value -1is used for drawing byinverting the pixels. update= TRUE will activateImageRedisplayArea.

ImageOverlayDrawBox
 int ImageOverlayDrawBox(
    ImageOverlayWidget wid, int x1, int y1,
    int x2, int y2, int value,
    update_status update );

Draw a filled rectangle in the overlay image at imagecoordinates (x1,y1)to (x2, y2).The rectangle is filledwith valuepixels. The special value -1is used fordrawing by inverting the pixels. update= TRUE will activateImageRedisplayArea.

ImageOverlayColor
 int ImageOverlayColor( ImageOverlayWidget wid,
    int col );

Set new overlay color.

ImageOverlayDisplay
 int ImageOverlayDisplay(
    ImageOverlayWidget wid,
    update_status update );

Set new display status of overlay plane. statemay beOVERLAY_CLEAR,OVERLAY_SETor OVERLAY_TOGGLE.This determines whether or not the overlay image should beshown.

Miscellaneous routines:

ImageOverlayRedisplay
 void ImageOverlayRedisplay( Widget wid,
    update_status update );

If updateis nonzero, sets the private widget variable updateequal to update.Calls the resize and expose methods. Forthe expose method, the region and event arguments are NULL.

ImageOverlayCopyImagePart
 void ImageOverlayCopyImagePart(
    ImageOverlayWidget widto,
    ImageOverlayWidget widfrom );

Sets the XtNimageImage resource in widtoequal to theXtNimageImage resource in widfrom.No resizing orexposure is done.

ImageOverlayCopyImageOverlayPart
 void ImageOverlayCopyImageOverlayPart(
    ImageOverlayWidget widto,
    ImageOverlayWidget widfrom );

Sets the image_overlay part of widtoequal to theimage_overlay part of widfrom.No resizing or exposureis done.

ImageOverlayCopyResources
 void ImageOverlayCopyResources(
    ImageOverlayWidget widto,
    ImageOverlayWidget widfrom );

Sets the resources of the ImageOverlayPart of widtoequalto the resources of the ImageOverlayPart of widfrom.

ImageOverlayGetResources
 void ImageOverlayGetResources(
    ImageOverlayWidget wid,
    ArgList *args, Cardinal *num_args );

Returns a list of resource-value pairs for all the resourcesof wid.If the function is called before the class isinitialized, the resource list as specified in the classrecord is returned. If it is called after the class has beeninitialized, the returned list also contains the superclassresources.

ImageOverlayGetImageOverlayResources
 void ImageOverlayGetImageOverlayResources(
    ImageOverlayWidget wid, ArgList *args,
    Cardinal *num_args );

Returns a list of resource-value pairs for the resourceswhich are specific for an ImageOverlay widget (not includingsuper-class resources).

 

SEE ALSO

Image(3),ImageFormat(3),xshow(1),ximage(3)

 

AUTHOR

Otto Milvang

 

REVISED

Svein Bøe

 

DOC

Svein Bøe


 

Index

NAME
APPLICATION HEADER FILE
CLASS HEADER FILE
CLASS
CLASS NAME
SUPERCLASS
DESCRIPTION
RESOURCES
IMAGEOVERLAY ACTIONS
DEFAULT TRANSLATION BINDINGS
IMAGEOVERLAY CALLBACKS
PREDEFINED PIXELTYPE
CONVENIENCE ROUTINES
SEE ALSO
AUTHOR
REVISED
DOC

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector