• regNew
  • subRegNew
  • regNewFromReg
  • regDel
  • regReadFromPool
  • regPhysUpdate
  • tclRegion.c

    	These procedures allow regions to be created, deleted, and parented.
    	Subregions may be created from regions. Overall, these modules present 
    	the basic features of regions to the 
    	TCL user.
    
    
    
    

    regNew

     

    This procedure creates a region of the size indicated by NROWS and NCOLS. If the size is not specified a region with 0 rows and 0 columns is created. If the -physical switch is specified, The region is allocated from the pools of physical space. (Physical regions are meaningful only in the data acquisition systems.) Pixels are not cleared, and have unpredictable contents.

    If the -mask switch is present, a mask is created with along with the pixels. The mask is cleared?? has random contents?

    The -type switch specified the type of the pixels in the region. If omitted, the type of the pixels is U16. Available types are U8 S8 S16 U16 S32 U32 and FL32.

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

    TCL SYNTAX:
       regNew [-physical] [-type U16] [-mask] [-name] [nrows 0 ncols 0]
    
    	nrows		Integer giving number of rows.
    	ncols		Integer giving number of rows.
    	-physical	Specifying region is to be created from Physical Pool.
    	-type		Specifies type of underlying pixels.
    	-name		Specifies name for a region.
    
    RETURNS:
    	TCL_OK		Successful completion. Handle to region is returned.
    	TCL_ERROR	Error occurred.  The Interp result explains the error.
    
    

    subRegNew

     

    Generate a sub-region from the given region. The basic features of regions give the rules for the behavior of this procedure.

    TCL SYNTAX:
      subRegNew <parent> nrow ncol srow scol [-read]
    
    	parent		handle to parent region
    	nrow		number of rows in sub-region
    	ncol		number of columns in sub region
    	srow		smallest row of parent in sub region
    	scol		smallest col of parent in sub region.
    	-read		switch specifying the subregion as readonly
    
    RETURNS:
    	TCL_OK		Successful completion.
    	TCL_ERROR	Error occurred.  The Interp result explains the error.
    
    

    regNewFromReg

     

    Generate a new region whose properties are derived from the input region. The user may specify a new type for the region using the -type switch. This procedure can be used to promote a sub region to region(i.e. allow it to own its own pixels).

    By default, the new region has a mask if its parent does. The mask is Cleared? Set to a copy of its parent? if the -mask switch is present, the region will have a (cleared?) mask even if the parent does not.

    If the -name switch is present, it is used as the name of the region. Be sure to not confuse this name with the name of the handle pointing to the region. If -name is omitted, the handle to the region is used instead.

    TCL SYNTAX:
      regNewFromReg <region> [-type image_type] [-hdr] [-mask] [-name name]
    
    	region		handle to parent region
    	-hdr		specifying that the new region have a hdr
    	-mask		specifying that the new region have a mask
    	-name		specifying the name of the new region
    	-type		specifying the image type of the new region
    			(default = source region type)
    RETURNS:
    	TCL_OK		Successful completion.
    	TCL_ERROR	Error occurred.  The Interp result explains the error.
    
    

    regDel

     

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

    TCL SYNTAX:
      regDel <region>
    
    	region		handle to parent region
    
    RETURNS:
    	TCL_OK		Successful completion.
    	TCL_ERROR	Error occurred.  The Interp result explains the error.
    
    

    regReadFromPool

    DESCRIPTION:
    	Read in a physical region from the frame pool.  In all cases, the
    	existing region is overwritten.
    
    TCL SYNTAX:
      regReadFromPool  "<reg>" "<frame>" "-group" 
    
    TCL HELP STRING:
      Read region data from the pool
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : Region to read into
      "<frame>"    : Frame number
      "-group"       : e.g. DEF_POOL_GROUP
    
    

    regPhysUpdate

    DESCRIPTION:
          This routine is used to simply re-construct the hdr and
          pixel vectors if the physical region was updated by some 
    	means other than through shTclRegReadFromPool.
    
    TCL SYNTAX:
      regPhysUpdate  "<reg>" 
    
    TCL HELP STRING:
      Update handles when a physical region has changed
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : Handle to physical region that has changed