lvsqrt(3)

LIBRARY ROUTINE
lvsqrt - Compute the square root of an image pixel by pixel with a masking image.

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

INPUT

    1. img1 -- input xvimage structure
    2. img2 -- operation gating xvimage structure
    3. mflg -- if set to one,
               use img2 to gate the sqrt operation

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

OUTPUT

    1. img1 -- output xvimage structure
               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.

    The square root of a negative number is zero.

    lvsqrt returns a zero upon failure.

MODIFICATIONS
Marcelo Teran, John Rasure, Tom Sauer

Jeremy Worley Feb 27, 1991 added double processing

DESCRIPTION
lvsqrt computes the square root of an image pixel by pixel, with an operation gating image. The square root of a negative number is set to zero.

img1 is the input image, img2 is the mask image and mflg should be set to one if the 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.

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

A non-zero mask pixel enables the output pixel to contain the square root. A zero mask pixel just transfers the value of the corresponding pixel in the first input image to the output pixel.

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

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

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

RESTRICTIONS
lvsqrt will not operate on:
    Transform, Complex, and Bit
data storage types.

AUTHOR
Scott Wilson

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