DESIGN (xvisual) functions


LIBRARY ROUTINE

xvw_create_threshold - create a threshold object

LIBRARY CALL

xvobject xvw_create_threshold(
   xvobject parent,
   char     *name)

INPUT

OUTPUT

none

RETURN VALUE

The threshold object on success, NULL on failure

DESCRIPTION

Creates an threshold object which will display the colormap values of an object's colormap.

The threshold object is used by the user to mask out certain parts of the image so that they are only looking at desired range of pixels. The threshold objects contains an upper and lower scrollbar from which we can extract the pixel range to be threshold.

The threshold objects also contains the "pixel" that we are going to be setting the threshold values to, and whether we are to accept or reject that range. The "accept" value is a boolean which tells us if we are to threshold everything outside the lower & upper range or whether we threshold everything inside that range. (If accept is true then we threshold everything outside the range otherwise we threshold the pixels inside the range).

The threshold works by setting the pixels in the threshold range to the current threshold color (specified by pixel). And then storing these values in the xvdisplay colormap. But in order to make sure none of the other displays over-ride this threshold we set the pixel's active boolean array to zero. By setting the histogram to zero, none of the other displays will update those pixels with new values, until we restore the active states.

Note that thresholding should not be used with RGB images when the calling application is displayed on an 8-bit screen. This is because a mapping transformation is used in order to convert the RGB image into an 8-bit representation for visual display on an 8-bit screen.

Because of this transformation, thresholding an RGB image on an 8-bit screen will not make sense; any changes to the colormap made via thresholding would alter the 24-bit to 8-bit transformation (a 3-3-2 RGB map is used), rather than the RGB values themselves, producing an unexpected result.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DESIGN/objects/library/xvisual/src/Threshold.c

SEE ALSO

xvisual(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.