xil_multiply(3)
NAME
xil_multiply, xil_multiply_const − image multiplication operations.
SYNOPSIS
#include <xil/xil.h>
void xil_multiply (XilImage src1,
XilImage src2,
XilImage dst);
void xil_multiply_const (XilImage src1,
float ∗constants,
XilImage dst);
DESCRIPTION
xil_multiply () performs a pixel-by-pixel multiplication of the src1 image by the src2 image and stores the result in the dst (destination) image. 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.
xil_multiply_const () performs a pixel-by-pixel multiplication of the src1 image by the constants values and stores the result in the dst (destination) image. For an n-band image, n float values must be provided, one per band. The values in band 0 are multiplied by the value the first element of the constants array, and so on. Pixel values are rounded and clipped according to image data type.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Multiply image2 by image1 and store the result in dst :
XilImage image1, image2, dst;
xil_multiply(image1, image2, dst);
Multiply 4-band image1 by constants and store the result in dst :
XilImage image1, dst;
float constants[4];
constants[0] = 1.0;
constants[1] = 2.0;
constants[2] = 0.5;
constants[3] = 2.0;
xil_multiply_const(image1, constants, 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