lvtranslat(3)

LIBRARY ROUTINE
lvtranslat - Translates an xvimage structure

LIBRARY CALL
#include "vinclude.h"
int
lvtranslat(img,vj,vi,wflg,pad)
struct xvimage *img;
int   wflg;
int   vi,vj;
float pad;

INPUT

    img - an xvimage structure (input image).
    vi - integer: Translation along i axis
    vj - integer: Translation along j axis
    wflg - integer: flag set to one if wrapping selected or zero if padding with padding value
    pad - float: padding value used to set the pixels of the result image that have not received any value during the translation process.

OUTPUT
img - Holds the result of the translation.

MODIFICATIONS
Ghosted by Pascal ADAM Mon Jun 4 12:13:28 MDT 1990

DESCRIPTION
lvtranslat Computes the translation of an xvimage structure by a vector (i,j).

Includes a Wrap option or a padding value.

The tranlation is processed in the following manner:
For each pixel (x,y) of the input image, the algorithm calculates the transformed coordinates (x+i,y+j) and determines if the translated pixel is outside of the output image.

    If the new pixel is inside of the image border, its initial value is stored in its new location.

    If the new location does not fit inside of the image, a modulo (size of rows and columns) is taken into consideration to write either the padding value in the output image (if wrap flag not selected) or the initial value of the pixel (x,y) (if wrap selected).

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

RESTRICTIONS
lvtranslat will not operate on Bit data storage types. lvtranslat does not work on explicit location data.

AUTHOR
Pascal ADAM

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