lvlog(3)

LIBRARY ROUTINE
lvlog - Compute the logarithm of an image pixel by pixel with an optional masking image.

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

INPUT

    1. img1 -- first xvimage strcuture
    2. img2 -- gating mask image
    3. mflg -- a flag set (equal 1) if gating image mask
               available
    4. tflg -- a flag set to nonzero will perform
               logarithm of (x+1), else perform
               logarithm (x)
    5. nflg -- a flag set to nonzero will perform
               logarithm base 10 (log10), else perform
               natural logarithm (ln).

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

OUTPUT

    1. img1 -- holds the result of the logorithm
               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.

MODIFICATIONS
27-Feb-91 Jeremy Worley added double precision handling.

DESCRIPTION

Img1 is an input image, img2 is an optional mask image to gate the logarithm operation, mflg is set to one if gating image is available, tflg is set to nonzero to perform logarithm of (x+1), else perform logarithm (x), and nflg is set to nonzero to perform logarithm base 10 (log10), else perform natural logarithm (ln).

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 causes the output pixel to contain the logarithm of (x). A zero mask pixel just transfers the value of the corresponding pixel in the input image to the output image.

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

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

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

RESTRICTIONS
lvlog will not operate on:
    Complex, and Bit
data types.

AUTHOR
Scott Wilson

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