lvsamp(3) University of New Mexico 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 out- put 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, com- pleted 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 condi- tions. 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 inter- val is independent of image size and line orientation. The value at each sample point is obtained by bilinear interpo- lation. 7/91 Last change: 03/ 1 lvsamp(3) University of New Mexico lvsamp(3) 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 _l_v_s_a_m_p will only work on images of type FLOAT. AUTHOR Richard Krukar COPYRIGHT Copyright 1991, University of New Mexico. All rights reserved. 7/91 Last change: 03/ 2