TCL Routines for making masks.

These procedures allow masks to be created, deleted, and parented. Submasks may be created from masks. Overall, these modules present the basic features of masks to the TCL user. Note that it is possible to access individual pixels in a mask by using exprGet and handleSet.

  • maskNew
  • subMaskNew
  • maskDel
  • subMaskGet
  • 
    
    

    maskNew

    This procedure creates a mask of the size indicated by NROWS and NCOLS. If the size is not specified a mask with 0 rows and 0 columns is created. On Creation, the mask pixles are cleared.

    The -name switch may be used to load the name field in the mask structure. This name should not be confused with the handle to the mask returned by this command. If not specified, the name of the mask's handle is placed in the name field.

    TCL SYNTAX: maskNew [-name name] [nrows 0 ncols 0] nrows Optional, Integer giving number of rows. ncols Optional, Integer giving number of rows. -name Optional, Specifies name for a mask. RETURNS: TCL_OK Successful completion. The handle to the mask is returned. TCL_ERROR Error occurred. The Interp result explains the error
     
    
    
    

    subMaskNew

    Generate a sub-mask from the given mask.

    TCL SYNTAX: subMaskNew <parent> <nrow> <ncol> <srow> <scol> <parent> Required, handle to parent mask <nrow> Required, number of rows in sub-mask <ncol> Required, number of columns in sub mask <srow> Required, smallest row of parent in sub mask <scol> Required, smallest col of parent in sub mask. RETURNS: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result explains the error.
    
    
    
    

    maskDel

    Delete the mask specified by the MASK parameter. The handle is freed, the mask is deleted if there are not other handles to it. It is an error to delete a mask with sub-masks attached to it.

    TCL SYNTAX: maskDel <mask> <mask> Required, handle to parent mask RETURNS: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result explains the error.
    
    
    

    subMaskGet

    Return a list of handles to submasks parented in this mask. Return an empty list if this mask parents no submasks.

    For each submask, if a handle to the submask exists, use that handle. If no handle points to the submask, create one.

    TCL SYNTAX: subMaskGet <mask> <mask> Required handle to mask. RETURNS: TCL_OK Successful completion. TCL_ERROR Error occurred. The Interp result explains the error.