xil_cast(3)
NAME
xil_cast − cast an image from one data type into another
SYNOPSIS
#include <xil/xil.h>
void xil_cast (XilImage src,
XilImage dst);
DESCRIPTION
This routine casts an image of one data type into the data type specified by the dst (destination) image. When a data type with a lesser number of bits is cast into a data type with a greater number of bits, the destination pixel values are the src (source) image’s pixel values padded with zeroes in the most significant bits. When a data type with a greater number of bits is cast into a data type with a lesser number of bits, the destination image’s pixel values are a mask of the appropriate number of least significant bits of the source image’s pixel values. To control the indices in the output image, pass the image through a lookup table rather than casting it.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Cast byte image image1 into a bit image and store the result in image2 :
XilSystemState state;
XilImage image1, image2;
image1 = xil_create(state, 512, 512, 3, XIL_BYTE);
image2 = xil_create(state, 512, 512, 3, XIL_BIT);
.
.
.
xil_cast(image1, image2);
NOTES
Source and destination images must have the same number of bands.
SEE ALSO
SunOS — Last change: 01 April 1994