lvoffset(3)

LIBRARY ROUTINE
lvoffset - Add a specified offset to each pixel in the input image.

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

INPUT

    1. img1 -- input xvimage structure
    2. img2 -- mask image, xvimage structure
    3. mflg -- if set, use img2 as a mask image
    4. offset -- the amount to add to each pixel in img1

    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.
    lvoffset returns a zero upon failure.

MODIFICATIONS
Marcelo Teran, John Rasure, Tom Sauer

26-Feb-91 Jeremy Worley added processing for double precision data sets.

DESCRIPTION
lvoffset adds a specified offset to each pixel in the input image, with an operation gating image. The offset is a floating point variable.

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

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

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

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

AUTHOR
Scott Wilson

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