xil_divide(3)
NAME
xil_divide, xil_divide_by_const, xil_divide_into_const − image division operations
SYNOPSIS
#include <xil/xil.h>
void xil_divide (XilImage src1,
XilImage src2,
XilImage dst);
void xil_divide_by_const (XilImage src1,
float ∗constants,
XilImage dst);
void xil_divide_into_const (float ∗constants,
XilImage src1,
XilImage dst);
DESCRIPTION
xil_divide() performs a pixel-by-pixel division of image src2 into image src1 and stores the result in the dst (destination) image.
xil_divide_by_const() performs a pixel-by-pixel division of image constants values into image src1 and stores the result in the dst (destination) image.
xil_divide_into_const() performs a pixel-by-pixel division of image src1 into constants values and stores the result in the dst (destination) image.
For division operations with constants and an n-band image, n float values must be provided, one per band. If the result of the operation is out of range for a particular data type, the result is clamped to the minimum or maximum value for the data type. Results for XIL_BYTE operations, for example, are clamped to 0 if they are less than 0 and 255 if they are greater than 255.
If division of a non-zero value by zero occurs, the destination value is set to the maximum value for the pixel data type. If division of zero by zero occurs, the destination value is zero. For all division cases (image into image, constant into image, image into constant), an exception is raised once for any number of occurences of division by zero.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Divide image2 into image1 and store the result in dst :
XilImage image1, image2, dst;
xil_divide(image1, image2, dst);
Divide constants into 4-band image1 and store the result in dst :
XilImage image1, dst;
float constants[4];
constants[0] = 1.0;
constants[1] = 2.0;
constants[2] = 2.0;
constants[3] = 2.0;
xil_divide_by_const(image1, constants, dst);
Divide 4-band image1 into constants and store the result in dst :
XilImage image1, dst;
float constants[4];
constants[0] = 1.0;
constants[1] = 1.0;
constants[2] = 1.0;
constants[3] = 1.0;
xil_divide_into_const(constants, image1, dst);
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: 03 August 1993