lvsamp(3)

LIBRARY ROUTINE
lvsamp - Sample an image along an arbitrary line.

LIBRARY CALL
#include "vinclude.h"
int lvsamp(image,line,x1,y1,x2,y2,n)
struct xvimage *image,**line;
int x1,y1,x2,y2,n;

INPUT

image
    pointer to image to be sampled

line
    pointer to image pointer to receive the output image

x1  X coordinate of start point

y1  Y coordinate of start point

x2  X coordinate of end point

y2  Y coordinate of end point

n   number of samples to generate between the endpoints

OUTPUT

line
    xvimage pointer indicated by line is attached to the new image

MODIFICATIONS

6-Feb-91 Scott Wilson - Cleaned up for installation, completed documentation.

8-Feb-91 Scott Wilson - changed length to n, added pixel size stuff.

10-Feb-91 Scott Wilson -re-wrote the entire inner loop - the original had bugs and did not handle the boundary conditions.

20-Feb-91 Scott Wilson - corrected pixel size computation bug.

DESCRIPTION
Given an image of arbitrary size and a line through that image, sample the image along the line. The sampling interval is independent of image size and line orientation. The value at each sample point is obtained by bilinear interpolation.

The first sample point is precisely at the starting point and the final sample is precisely at the ending point.

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

RESTRICTIONS
lvsamp will only work on images of type FLOAT.

AUTHOR
Richard Krukar

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