maskSelect
Top  Previous  Next

maskSelect (integer Input, integer Output [, integer Phase = 1 )

Use this function to convert a selection into a binary mask. Equivalent to selecting Binarize from the Edit menu. Pixels that fall within the selection will be assigned a value of Phase, while the rest of the pixels will be set to zero.

Parameters
 
Input  
 
An integer between 1 and 116 specifying the frame number of the image containing a selection. Values in the range of 100-116 correspond to hidden frames.  
 
Output  
 
An integer between 1 and 99 specifying the frame number of the multiphase image that will contain the mask.  
 
Phase  
 
An optional integers specifying the phase of the mask.  
Default values: 1  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example

The following set of statements creates a rectangular selection with an elliptical "hole" in the middle and creates a corresponding mask image:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
setSelect (1,SH_RECT,SEL_NEW, 20, 20, 300, 200)  
setSelect (1, SH_ELLIPSE, SEL_SUBTRACT, 99, 89, 305, 227)  
maskSelect (1,2)