xil_set_value(3)
NAME
xil_set_value − set pixels of an image to constant values
SYNOPSIS
#include <xil/xil.h>
void xil_set_value (XilImage dst,
float ∗constants);
DESCRIPTION
This routine assigns floating point constant values on a pixel-by-pixel basis to the dst (destination) image. For an n-band image, the array of constants must contain n floating point values. Pixel values are clipped according to image data type.
For XIL_BIT images, values below 0.5 cause the pixel to be set to 0, and values 0.5 and above cause the pixel to be set to 1. For XIL_BYTE images, values below 0.5 cause the pixel to be set to 0, values above 254.5 cause the pixel to be set to 255, and all values in between are rounded to the nearest integer. For XIL_SHORT images, values below -32768.5 cause the pixel to be set to -32768, values above 32766.5 cause the pixel to be set to 32767, and all values in between are rounded to the nearest signed integer.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Assign pixel values of a 4-band image and store the result in dst:
XilImage dst;
float values[4];
values[0] = 1.0;
values[1] = 127.5;
values[2] = 256.0;
values[3] = 0.0;
xil_set_value(dst, values);
SEE ALSO
SunOS 5.6 — Last change: 17 August 1993