lvlshift(3)

LIBRARY ROUTINE
lvlshift - Left shift each pixel value in an image.

LIBRARY CALL
#include "vinclude.h"
int
lvlshift(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 left

    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.

    lvlshift returns 1 upon success and 0 on failure.

MODIFICATIONS
Marcelo Teran, John Rasure, Tom Sauer

DESCRIPTION
lvlshift shifts the pixel data in an image left s bit positions. Zero's are shifted into the least significant bit position.

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.

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 first input image to the output pixel without shifting it.

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

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

RESTRICTIONS
lvlshift 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.