lvrshift(3)

LIBRARY ROUTINE
lvrshift - Do a right shift pixel by pixel on an image.

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

INPUT

    img1 -- input image xvimage structure
    img2 -- mask image for gating operation
    mflg -- indicates that the mask image should be
            used
    s -- number of bit positions to shift pixel data right

    The input images 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.

    librshift returns 1 upon success and 0 upon failure.

MODIFICATIONS
Ron E. Neher, Marcelo Teran, John Rasure, Tom Sauer

DESCRIPTION
lvrshift shifts the pixel data in an image right s bit positions. The shift could be an arithmetic shift (1's into the most significant bit) or a logical shift (0's into the most significant bit) depending on the type machine it is executed on.

img1 is the input image and 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 and data type as the input image.

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

A non-zero mask pixel enables the output pixel to contain the shifted value. A zero mask pixel simply transfers the value of the corresponding pixel in the input image to the output pixel without shifting it.

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

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

RESTRICTIONS
lvrshift will not operate on:
    Transforms, Float, Complex, and Bit
data storage types.

AUTHOR
Scott Wilson

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