xil_threshold(3)
NAME
xil_threshold − set value of image pixel bands within a specified range
SYNOPSIS
#include <xil/xil.h>
void xil_threshold (XilImage src,
XilImage dst,
float ∗low,
float ∗high,
float ∗map);
DESCRIPTION
For each band of an image, this function maps to a constant all the values that fall between a low value and a high value. src is the source image handle. dst is the destination image handle. low is a pointer to the floating-point array that specifies the low value of the range for band [0...(nbands-1)]. low[0] is the low value for band 0, and so forth. high is a pointer to the floating-point array that specifies the high value of the range for band [0...(nbands-1)]. high[0] is the high value for band 0, and so forth. map is a pointer to the floating-point array that specifies the map value for each pixel band within the range [low:high].
For an n-band image, the array of floats for low, high, and map must be of size n. Each band is independently evaluated for its range. Values outside the range are passed through without change.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
For this example, the source and destination images contain 2 bands. Force each pixel in band[0] between [192:255] to value 191. Force each pixel in band[1] between [0:63] to value 64.
XilImage src;
XilImage dst;
float low[2] = {192.0, 0.0};
float high[2] = {255.0, 63.0};
float map[2] = {191.0, 64.0};
xil_threshold(src, dst, low, high, map);
NOTES
Source and destination images must be the same data type and have the same number of bands. In-place operations are supported.
SunOS 5.6 — Last change: 17 June 1993