lvmul(3)

LIBRARY ROUTINE
lvmul - Multiply two images pixel by pixel.

LIBRARY CALL
#include "vinclude.h"
int
lvmul(img1,img2,img3,mflg,jflg)
struct xvimage *img1,*img2,*img3;
int  mflg,jflg;

INPUT

    1. img1 -- first xvimage strcuture
    2. img2 -- second xvimage structure
    3. img3 -- gating mask image
    4. mflg -- a flag set (equal 1) if gating image mask
               is available
    5. jflg -- 0 means do scalar complex arithmetic
               1 means do vector complex arithmetic

    The inputs must be of the same data type and size.

OUTPUT

    1. img1 -- holds the result of the multiply
               operation. The output data
               type is the same as the input data
               type.

    img1 is used for both the input xvimage structure and the output result xvimage structure. This is done to save space, but you must be careful not to overwrite important data.

    lvmul returns a one on success and a zero upon failure.

MODIFICATIONS
Marcelo Teran, John Rasure, Tom Sauer
28-Dec-89 Added complex arithmetic switch. Scott Wilson
28-Dec-89 Upgrade to multiband. Scott Wilson
25-Feb-91 Upgrade to handle double and double complex images. Jeremy Worley

DESCRIPTION
lvmul multiplies two images pixel by pixel with a operation gating mask.

img1 and img2 are input images, img3 is the gating image, and mflg should be set to one if gating image is to be used. img1 is used for both the input xvimage structure and the output result xvimage structure. This is done to save space, but you must be careful not to overwrite important data.

A non-zero mask pixel in img3 enables the output pixel to contain the result. A zero mask pixel in img3 just transfers the value of the corresponding pixel in img1 to the output pixel.

The mask image must be the same size as the input image.

The output image data type is the same as the input data type.

If jflg is zero, then scalar arithmetic is used on COMPLEX images, otherwise vector arithmetic is used. Scalar arithmetic is always used on real images.

lvmul returns a value of one upon success and a zero on failure.

SEE ALSO
vmul(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
lvmul will not operate on:
    Bit
data storage types.

AUTHOR
Scott Wilson

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.