setProfile
Top  Previous  Next

setProfile ( integer Image, integer Shape [, integer X1, integer Y1, integer X2, integer Y2,… ] )

Use this to set the shape and position of the profile line. Equivalent to selecting Line Profile in the View menu and changing the settings in the Line Profile Tool.
.
Parameters
 
Image  
 
An integer between 0 and 116 specifying the image frame number. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Shape  
 
An enumerated integer specifying the shape of a line to be profiled. Must be one of the following values:  
 
 
SH_HLINE=0 – sets the profile to a horizontal line across the image. For this shape Y1 will define the vertical coordinate of the line and the sign of X1 direction of the line. If X1>0 the line profile data will be collected from left to right and vise versa.  
 
SH_VLINE=1 – sets the profile to a vertical line across the image. For this shape Y1 will define the horizontal coordinate of the line and the sign of Y1 direction of the line. If X1>0 the line profile data will be collected from left to right and vise versa.  
 
SH_LINE=2 – sets the shape of the profile to a straight line segment. X1 and Y1 will define the starting point of the segment, X2 and Y2 the endpoint of the segment.  
 
SH_ELLIPSE=3 – sets the shape of the profile to an ellipse. The coordinates of the top left and bottom right corners of the bounding rectangle of the ellipse will be defined by (X1, Y1) and (X2, Y2). If X2>X1, the profile will have clockwise direction, and vice versa.  
 
SH_RECT=4 – sets the shape of the profile to a rectangle. The coordinates of the top left and bottom right corners of the rectangle will be defined by (X1, Y1) and (X2, Y2). If X2>X1, the profile will have clockwise direction, and vice versa.  
 
SH_FREE=5 – assigns a freehand shape for the profile. The coordinate pairs (X1, Y1), (X2, Y2), (X3, Y3)… will define the profile line.  
 
X1, Y1, X2, Y2,…  
 
Integers specifying the position of the line profile on an image. Depending on a value of Shape, these parameters will be interpreted differently. See above for more details.  
 
 
Error flags
 
ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example
 
This set of statements sets the straight segment shape for the line profile and displays the Line Profile tool:  
 
setCurDir ("samples")  
loadIm (1,"sample8.iwd")  
setProfile (1,SH_LINE,10,15,300,320)  
showProfile (TRUE)