Histogram

[ XITE Reference Manual | XITE home ]

Contents


Name

Histogram - Widget class for histograms in XITE programs

Application header file

<xite/Histogram.h>

Class header file

<xite/HistogramP.h>

Class

histogramWidgetClass

Class name

Histogram

Superclass

Core

Description

The Histogram widget is part of the XITE (X-based Image Processing Tools and Environment) software. It is used by the histogram application window included with several of the display programs supplied with XITE (and available via the ximage toolkit).

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.

Resources

Apart from the resources of the superclass:

XtNhistogramHistogram (class XtCHistogramHistogram)
Type: Pointer, Default: NULL

A reference to an integer array with histogram values.

XtNhistogramLength (class XtCHistogramLength)
Type: int, Default: NULL

Length of histogram and cumulative histogram arrays.

XtNhistogramTitle (class XtCHistogramTitle)
Type: Pointer, Default: NULL

Title of histogram. Used to form window manager decoration title.

XtNhistogramVisual (class XtCHistogramVisual)
Type: Pointer, Default: NULL

Visual of Histogram widget. See the "Xlib Programming Manual" by Adrian Nye (O'Reilly & Associates, Inc.), chapter 7 for more information about visuals.

XtNhistogramColormap (class XtCHistogramColormap)
Type: Pointer, Default: NULL

Colormap used by the histogram widget.

XtNhistogramImage (class XtCHistogramImage)
Type: Pointer, Default: NULL

A reference to the BIFF image data structure.

XtNhistogramBand (class XtCHistogramBand)
Type: Pointer, Default: NULL

A reference to the BIFF band data structure for which this histogram is made.

XtNhistogramCrossing (class XtCCallback)
Type: XtCallbackList, Default: NULL

The functions on this callback list will be called by the Crossing action function described below.

XtNhistogramButton (class XtCCallback)
Type: XtCallbackList, Default: NULL

The functions on this callback list may be called by the Button action function described below.

XtNhistogramMotion (class XtCHistogramMotion)
Type: XtCallbackList, Default: NULL

The functions on this callback list may be called by the Button action function described below.

XtNhistogramKill (class XtCHistogramKill)
Type: XtCallbackList, Default: NULL

Not invoked by the Histogram widget.

Histogram actions

Crossing
Invokes the functions on the callback list XtNhistogramCrossing.

Button
This action assigns values to the attributes of the HistogramButtonCallbackRec structure and invokes the callback functions on the XtNhistogramButton (if the event was ButtonPress or ButtonRelease) or XtNhistogramMotion (if the event was MotionNotify) callback-list with a reference to the HistogramButtonCallbackRec structure.

The attributes of the HistogramButtonCallbackRec structure are

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

image
Identical to the resource XtNhistogramImage.

band
Identical to the resource XtNhistogramBand.

histogram
Identical to the resource XtNhistogramHistogram.

kumulativ
A reference to an integer array with cumulative histogram values.

length
Idential to the resource XtNhistogramLength.

korh
Integer which is set if the displayed histogram is cumulative, unset if it is normal.

x, y
Two integers which represent the coordinates where one of the events ButtonPress, ButtonRelease or MotionNotify took place. y is 255 minus the actual event vertical coordinate, so that it represents the height above the baseline in the Histogram widget.

ChangeMode

This action function changes mode between display of histogram and display of cumulative histogram.

HistogramKill

Same as the HistogramKill convenience function described below.

Default translation bindings

 <EnterWindow>:         Crossing()
 <LeaveWindow>:         Crossing()
 <Key>Q:                HistogramKill()
 Ctrl <BtnDown>:        ChangeMode()
 Ctrl <BtnUp>:          ChangeMode()
 <BtnDown>:             Button()
 <BtnUp>:               Button()
 <Motion>:              Button()

Histogram callbacks

See the resources XtNhistogramCrossing, XtNhistogramButton, XtNhistogramMotion and XtNhistogramKill.

Convenience routines

HistogramRedisplay

 void HistogramRedisplay( Widget wid );

Invoke the expose method, with NULL as event and region arguments.

Draw_all_lines

 void Draw_all_lines( Widget wid, int func );

Draw the manipulating lines in the Histogram widget. func gives the logical drawing function, typically GXor (draw) or GXandInverted (erase).

HistogramKill

 void HistogramKill ( Widget wid, XEvent *event,
    String *params, Cardinal *num_params );

Kill the widget tree starting with the ancestor shell.

HistogramInitLines

 void HistogramInitLines( HistogramWidget wid,
    int col, int threshold );

Setup to draw a unit ramp or a threshold line (depending on whether threshold is set or not) in the Histogram widget, for the primaries given by col (which may be inclusive or of DoRed, DoGreen and DoBlue). Then draw all three manipulating lines (one or more of which has now been changed).

HistogramThreshold

 void HistogramThreshold( HistogramWidget wid,
    int point, int col );

Make treshold manipulating lines for the primaries indicated by col (which may by inclusive or of DoRed, DoGreen and DoBlue). Use point as the bin number where the threshold will be. Draw all three manipulating lines (of which some may now be thresholds, some are as before).

HistogramInsertPoint

 void HistogramInsertPoint( HistogramWidget wid,
    int point, int val, int col );

Insert a point at point (for a broken line) in the manipulating primary given by col.

HistogramMovePoint

 void HistogramMovePoint( HistogramWidget wid,
    int point, int val, int col );

Move the line breakpoint (in primaries given by col) closest to point to new location point (if the closest point is not too far off).

HistogramDeletePoint

 void HistogramDeletePoint( HistogramWidget wid,
 int point, int val, int col );

Delete line breakpoint closest to point for primaries given by col. Only delete point if it is not too far off point. val is not used.

HistogramInspect

 void HistogramInspect( HistogramWidget wid,
    XColor *colortab );

Return in colortab (which must be allocated by the caller) a colortable which reflects the manipulating primary lines in the Histogram widget.

HistogramGet

 void HistogramGet( HistogramWidget wid,
    XColor *tab, int *len );

Return in tab the entries in the Histogram widget manipulating lines which are set (i.e. breakpoints). the flags attribute of a colortable entry is taken from the mask attribute of the Histogram widget (inclusive or of DoRed, DoGreen and DoBlue).

len returns the number of cells set in tab (from cell number zero to cell number len-1.

HistogramSet

 void HistogramSet( HistogramWidget wid,
    XColor *tab, int len );

Set the manipulating primary lines from tab.

Author

Otto Milvang and Svein Bøe

See also

ximage(3), Image(3), ImageOverlay(3), xhistogram(3), xshow(1)

Doc

Svein Bøe